diff --git a/dist/PEP.js b/dist/PEP.js index 42a71b7e..f6a1b6d0 100644 --- a/dist/PEP.js +++ b/dist/PEP.js @@ -1,5 +1,5 @@ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -25,8 +25,8 @@ **/ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -52,4 +52,4 @@ **/ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("PEP",[],n):"object"==typeof exports?exports.PEP=n():e.PEP=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function c(t){if(n[t])return n[t].exports;var l=n[t]={i:t,l:!1,exports:{}};return e[t].call(l.exports,l,l.exports,c),l.l=!0,l.exports}return c.m=e,c.c=n,c.d=function(e,n,t){c.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},c.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(n,"a",n),n},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.p="",c(c.s=140)}([function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz8xNWUwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjUuNycgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZ2xvYmFsLmpzP2VjYWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzg2I2lzc3VlY29tbWVudC0xMTU3NTkwMjhcbnZhciBnbG9iYWwgPSBtb2R1bGUuZXhwb3J0cyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93Lk1hdGggPT0gTWF0aFxuICA/IHdpbmRvdyA6IHR5cGVvZiBzZWxmICE9ICd1bmRlZmluZWQnICYmIHNlbGYuTWF0aCA9PSBNYXRoID8gc2VsZlxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tbmV3LWZ1bmNcbiAgOiBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuaWYgKHR5cGVvZiBfX2cgPT0gJ251bWJlcicpIF9fZyA9IGdsb2JhbDsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(31)('wks');\nvar uid = __webpack_require__(22);\nvar Symbol = __webpack_require__(1).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLmpzPzc1MmMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHN0b3JlID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ3drcycpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xudmFyIFN5bWJvbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLlN5bWJvbDtcbnZhciBVU0VfU1lNQk9MID0gdHlwZW9mIFN5bWJvbCA9PSAnZnVuY3Rpb24nO1xuXG52YXIgJGV4cG9ydHMgPSBtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHJldHVybiBzdG9yZVtuYW1lXSB8fCAoc3RvcmVbbmFtZV0gPVxuICAgIFVTRV9TWU1CT0wgJiYgU3ltYm9sW25hbWVdIHx8IChVU0VfU1lNQk9MID8gU3ltYm9sIDogdWlkKSgnU3ltYm9sLicgKyBuYW1lKSk7XG59O1xuXG4kZXhwb3J0cy5zdG9yZSA9IHN0b3JlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy5qc1xuLy8gbW9kdWxlIGlkID0gMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY2xhc3NDYWxsQ2hlY2suanM/NjZiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(64);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLC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B9XG5cbiAgcmV0dXJuIGZ1bmN0aW9uIChDb25zdHJ1Y3RvciwgcHJvdG9Qcm9wcywgc3RhdGljUHJvcHMpIHtcbiAgICBpZiAocHJvdG9Qcm9wcykgZGVmaW5lUHJvcGVydGllcyhDb25zdHJ1Y3Rvci5wcm90b3R5cGUsIHByb3RvUHJvcHMpO1xuICAgIGlmIChzdGF0aWNQcm9wcykgZGVmaW5lUHJvcGVydGllcyhDb25zdHJ1Y3Rvciwgc3RhdGljUHJvcHMpO1xuICAgIHJldHVybiBDb25zdHJ1Y3RvcjtcbiAgfTtcbn0oKTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanNcbi8vIG1vZHVsZSBpZCA9IDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4\n')},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar ctx = __webpack_require__(16);\nvar hide = __webpack_require__(11);\nvar has = __webpack_require__(10);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzPzkwY2QiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCc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9kdWxlcy9fZXhwb3J0LmpzXG4vLyBtb2R1bGUgaWQgPSA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYW4tb2JqZWN0LmpzP2VmYjMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoIWlzT2JqZWN0KGl0KSkgdGhyb3cgVHlwZUVycm9yKGl0ICsgJyBpcyBub3QgYW4gb2JqZWN0IScpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(13)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/Zjg0ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(6);\nvar IE8_DOM_DEFINE = __webpack_require__(43);\nvar toPrimitive = __webpack_require__(29);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwLmpzPzdhZjAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgSUU4X0RPTV9ERUZJTkUgPSByZXF1aXJlKCcuL19pZTgtZG9tLWRlZmluZScpO1xudmFyIHRvUHJpbWl0aXZlID0gcmVxdWlyZSgnLi9fdG8tcHJpbWl0aXZlJyk7XG52YXIgZFAgPSBPYmplY3QuZGVmaW5lUHJvcGVydHk7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydHkgOiBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGFuT2JqZWN0KEF0dHJpYnV0ZXMpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGRQKE8sIFAsIEF0dHJpYnV0ZXMpO1xuICB9IGNhdGNoIChlKSB7IC8qIGVtcHR5ICovIH1cbiAgaWYgKCdnZXQnIGluIEF0dHJpYnV0ZXMgfHwgJ3NldCcgaW4gQXR0cmlidXRlcykgdGhyb3cgVHlwZUVycm9yKCdBY2Nlc3NvcnMgbm90IHN1cHBvcnRlZCEnKTtcbiAgaWYgKCd2YWx1ZScgaW4gQXR0cmlidXRlcykgT1tQXSA9IEF0dHJpYnV0ZXMudmFsdWU7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///8\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzEyYTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz8wZjYyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(8);\nvar createDesc = __webpack_require__(21);\nmodule.exports = __webpack_require__(7) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ODQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(62);\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NGRjNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSAxM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///13\n")},function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gMTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///14\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(20);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n")},function(module,exports){eval("module.exports = {};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXJhdG9ycy5qcz9mZGI0Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0ge307XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlcmF0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSAxN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///17\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(71), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3Byb21pc2UuanM/ZmZmMSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vcHJvbWlzZVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9wcm9taXNlLmpzXG4vLyBtb2R1bGUgaWQgPSAxOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///18\n')},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(44);\nvar enumBugKeys = __webpack_require__(32);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///21\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(8).f;\nvar has = __webpack_require__(10);\nvar TAG = __webpack_require__(2)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC10by1zdHJpbmctdGFnLmpzPzdiYTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRlZiA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgVEFHID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvU3RyaW5nVGFnJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCB0YWcsIHN0YXQpIHtcbiAgaWYgKGl0ICYmICFoYXMoaXQgPSBzdGF0ID8gaXQgOiBpdC5wcm90b3R5cGUsIFRBRykpIGRlZihpdCwgVEFHLCB7IGNvbmZpZ3VyYWJsZTogdHJ1ZSwgdmFsdWU6IHRhZyB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXRvLXN0cmluZy10YWcuanNcbi8vIG1vZHVsZSBpZCA9IDIzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///23\n")},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/NTJlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/ZTc2OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///25\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(102), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzY3MWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAyNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///26\n')},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/MzY5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSAyN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///27\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar document = __webpack_require__(1).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/MzhkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAyOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(9);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8zMjYzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIF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0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(31)('keys');\nvar uid = __webpack_require__(22);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/NmIxZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAzMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///30\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(14) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qcz83YmMwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIFNIQVJFRCA9ICdfX2NvcmUtanNfc2hhcmVkX18nO1xudmFyIHN0b3JlID0gZ2xvYmFsW1NIQVJFRF0gfHwgKGdsb2JhbFtTSEFSRURdID0ge30pO1xuXG4obW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkge1xuICByZXR1cm4gc3RvcmVba2V5XSB8fCAoc3RvcmVba2V5XSA9IHZhbHVlICE9PSB1bmRlZmluZWQgPyB2YWx1ZSA6IHt9KTtcbn0pKCd2ZXJzaW9ucycsIFtdKS5wdXNoKHtcbiAgdmVyc2lvbjogY29yZS52ZXJzaW9uLFxuICBtb2RlOiByZXF1aXJlKCcuL19saWJyYXJ5JykgPyAncHVyZScgOiAnZ2xvYmFsJyxcbiAgY29weXJpZ2h0OiAnwqkgMjAxOCBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSdcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qc1xuLy8gbW9kdWxlIGlkID0gMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///31\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YzY3NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///32\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///33\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _typeof2 = __webpack_require__(60);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n\n return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3Bvc3NpYmxlQ29uc3RydWN0b3JSZXR1cm4uanM/Y2YwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF90eXBlb2YyID0gcmVxdWlyZShcIi4uL2hlbHBlcnMvdHlwZW9mXCIpO1xuXG52YXIgX3R5cGVvZjMgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF90eXBlb2YyKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKHNlbGYsIGNhbGwpIHtcbiAgaWYgKCFzZWxmKSB7XG4gICAgdGhyb3cgbmV3IFJlZmVyZW5jZUVycm9yKFwidGhpcyBoYXNuJ3QgYmVlbiBpbml0aWFsaXNlZCAtIHN1cGVyKCkgaGFzbid0IGJlZW4gY2FsbGVkXCIpO1xuICB9XG5cbiAgcmV0dXJuIGNhbGwgJiYgKCh0eXBlb2YgY2FsbCA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiAoMCwgX3R5cGVvZjMuZGVmYXVsdCkoY2FsbCkpID09PSBcIm9iamVjdFwiIHx8IHR5cGVvZiBjYWxsID09PSBcImZ1bmN0aW9uXCIpID8gY2FsbCA6IHNlbGY7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9wb3NzaWJsZUNvbnN0cnVjdG9yUmV0dXJuLmpzXG4vLyBtb2R1bGUgaWQgPSAzNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///34\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = __webpack_require__(104);\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = __webpack_require__(108);\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = __webpack_require__(60);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2luaGVyaXRzLmpzPzNkZmQiXSwic291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JDbGFzcykpKTtcbiAgfVxuXG4gIHN1YkNsYXNzLnByb3RvdHlwZSA9ICgwLCBfY3JlYXRlMi5kZWZhdWx0KShzdXBlckNsYXNzICYmIHN1cGVyQ2xhc3MucHJvdG90eXBlLCB7XG4gICAgY29uc3RydWN0b3I6IHtcbiAgICAgIHZhbHVlOiBzdWJDbGFzcyxcbiAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgd3JpdGFibGU6IHRydWUsXG4gICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9XG4gIH0pO1xuICBpZiAoc3VwZXJDbGFzcykgX3NldFByb3RvdHlwZU9mMi5kZWZhdWx0ID8gKDAsIF9zZXRQcm90b3R5cGVPZjIuZGVmYXVsdCkoc3ViQ2xhc3MsIHN1cGVyQ2xhc3MpIDogc3ViQ2xhc3MuX19wcm90b19fID0gc3VwZXJDbGFzcztcbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2luaGVyaXRzLmpzXG4vLyBtb2R1bGUgaWQgPSAzNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///35\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(69);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _keys = __webpack_require__(48);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.divideURL = divideURL;\nexports.emptyObject = emptyObject;\nexports.secondsSinceEpoch = secondsSinceEpoch;\nexports.deepClone = deepClone;\nexports.removePathFromURL = removePathFromURL;\nexports.getUserURLFromEmail = getUserURLFromEmail;\nexports.getUserEmailFromURL = getUserEmailFromURL;\nexports.convertToUserURL = convertToUserURL;\nexports.isDataObjectURL = isDataObjectURL;\nexports.isLegacy = isLegacy;\nexports.isURL = isURL;\nexports.isUserURL = isUserURL;\nexports.isHypertyURL = isHypertyURL;\nexports.getConfigurationResources = getConfigurationResources;\nexports.buildURL = buildURL;\nexports.generateGUID = generateGUID;\nexports.getUserIdentityDomain = getUserIdentityDomain;\nexports.isBackendServiceURL = isBackendServiceURL;\nexports.divideEmail = divideEmail;\nexports.assign = assign;\nexports.splitObjectURL = splitObjectURL;\nexports.checkAttribute = checkAttribute;\nexports.parseAttributes = parseAttributes;\nexports.isEmpty = isEmpty;\nexports.chatkeysToStringCloner = chatkeysToStringCloner;\nexports.chatkeysToArrayCloner = chatkeysToArrayCloner;\nexports.parseMessageURL = parseMessageURL;\nexports.availableSpace = availableSpace;\nexports.encode = encode;\nexports.decode = decode;\nexports.decodeToUint8Array = decodeToUint8Array;\nexports.stringify = stringify;\nexports.parse = parse;\nexports.parseToUint8Array = parseToUint8Array;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * Support module with some functions will be useful\n * @module utils\n */\n\n/**\n * @typedef divideURL\n * @type Object\n * @property {string} type The type of URL\n * @property {string} domain The domain of URL\n * @property {string} identity The identity of URL\n */\n\n/**\n * Divide an url in type, domain and identity\n * @param {URL.URL} url - url address\n * @return {divideURL} the result of divideURL\n */\nfunction divideURL(url) {\n\n function recurse(value) {\n var regex = /([a-zA-Z-]*)(:\\/\\/(?:\\.)?|:)([-a-zA-Z0-9@:%._+~#=]{2,256})([-a-zA-Z0-9@:%._+~#=/]*)/gi;\n var subst = '$1,$3,$4';\n var parts = value.replace(regex, subst).split(',');\n return parts;\n }\n\n var parts = recurse(url);\n\n // If the url has no scheme\n if (parts[0] === url && !parts[0].includes('@')) {\n\n var _result = {\n type: '',\n domain: url,\n identity: ''\n };\n\n console.warn('[DivideURL] DivideURL don\\'t support url without scheme. Please review your url address', url);\n\n return _result;\n }\n\n // check if the url has the scheme and includes an @\n if (parts[0] === url && parts[0].includes('@')) {\n var scheme = parts[0] === url ? 'smtp' : parts[0];\n parts = recurse(scheme + '://' + parts[0]);\n }\n\n // if the domain includes an @, divide it to domain and identity respectively\n if (parts[1].includes('@')) {\n parts[2] = parts[0] + '://' + parts[1];\n parts[1] = parts[1].substr(parts[1].indexOf('@') + 1);\n } /*else if (parts[2].includes('/')) {\n parts[2] = parts[2].substr(parts[2].lastIndexOf('/')+1);\n }*/\n\n var result = {\n type: parts[0],\n domain: parts[1],\n identity: parts[2]\n };\n\n return result;\n}\n\n/**\n * Check if an Object is empty\n * @param {Object} object Object to be checked\n * @return {Boolean} status of Object, empty or not (true|false);\n */\nfunction emptyObject(object) {\n return (0, _keys2.default)(object).length > 0 ? false : true;\n}\n\nfunction secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n}\n\n/**\n * Make a COPY of the original data\n * @param {Object} obj - object to be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n //TODO: simple but inefficient JSON deep clone...\n if (obj) return JSON.parse((0, _stringify2.default)(obj));\n}\n\nfunction removePathFromURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n}\n\n/**\n * Obtains the user URL that corresponds to a given email\n * @param {string} userEmail The user email\n * @return {URL.URL} userURL The user URL\n */\nfunction getUserURLFromEmail(userEmail) {\n var indexOfAt = userEmail.indexOf('@');\n return 'user://' + userEmail.substring(indexOfAt + 1, userEmail.length) + '/' + userEmail.substring(0, indexOfAt);\n}\n\n/**\n * Obtains the user email that corresponds to a given URL\n * @param {URL.URL} userURL The user URL\n * @return {string} userEmail The user email\n */\nfunction getUserEmailFromURL(userURL) {\n var url = divideURL(userURL);\n return url.identity.replace('/', '') + '@' + url.domain; // identity field has '/exampleID' instead of 'exampleID'\n}\n\n/**\n * Check if the user identifier is already in the URL format, if not, convert to URL format\n * @param {string} identifier user identifier\n * @return {string} userURL the user URL\n */\nfunction convertToUserURL(identifier) {\n\n // check if the identifier is already in the url format\n if (identifier.substring(0, 7) === 'user://') {\n var dividedURL = divideURL(identifier);\n\n //check if the url is well formated\n if (dividedURL.domain && dividedURL.identity) {\n return identifier;\n } else {\n throw 'userURL with wrong format';\n }\n\n //if not, convert the user email to URL format\n } else {\n return getUserURLFromEmail(identifier);\n }\n}\n\nfunction isDataObjectURL(url) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain', 'hyperty'];\n var splitURL = url.split('://');\n var urlSchema = splitURL[0];\n\n return schemasToIgnore.indexOf(urlSchema) === -1;\n}\n\nfunction isLegacy(url) {\n if (url.split('@').length > 1) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction isURL(url) {\n return url.split('/').length >= 3;\n}\n\nfunction isUserURL(url) {\n return divideURL(url).type === 'user';\n}\n\nfunction isHypertyURL(url) {\n return divideURL(url).type === 'hyperty';\n}\n\n/**\n * get information relative each component configured on runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @return {object} return an object with all configurations;\n */\nfunction getConfigurationResources(configuration, component, resource) {\n var objectResource = configuration[component];\n var resourceType = objectResource[resource];\n\n return resourceType;\n}\n\n/**\n * Build a full url with the runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @param {string} type resource to get, like a hyperty name or protocolstub name;\n * @param {boolean} useFallback if true the function will check if have a fallback url;\n * @return {string} partial url to contact the resource;\n */\nfunction buildURL(configuration, component, resource, type) {\n var useFallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n var objectResource = configuration[component];\n var url = void 0;\n\n if (!objectResource.hasOwnProperty(resource)) {\n throw Error('The configuration ' + (0, _stringify2.default)(objectResource, '', 2) + ' don\\'t have the ' + resource + ' resource you are looking for');\n }\n\n var resourceType = objectResource[resource];\n\n if (type) {\n url = resourceType.prefix + configuration.domain + resourceType.suffix + type;\n if (resourceType.hasOwnProperty('fallback') && useFallback) {\n if (resourceType.fallback.indexOf('%domain%')) {\n url = resourceType.fallback.replace(/(%domain%)/g, configuration.domain) + type;\n } else {\n url = resourceType.fallback + type;\n }\n }\n } else {\n url = resourceType.prefix + configuration.domain + resourceType.suffix;\n }\n\n // console.log(url);\n\n return url;\n}\n\n/**\n * Generate a Global Unique ID\n *\n * @returns String;\n */\nfunction generateGUID() {\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\nfunction getUserIdentityDomain(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var splitedLength = splitedDomain.length;\n if (splitedLength == 1) {\n return splitedDomain[splitedLength - 1];\n }\n var domain = splitedDomain[splitedLength - 2] + '.' + splitedDomain[splitedLength - 1];\n return domain;\n}\n\n/**\n * Check if URL is from a backend service\n * @param {string} url URL to be processed\n * @return {boolean}\n */\n\nfunction isBackendServiceURL(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var backendSchemes = ['domain', 'global', 'domain-idp']; // should be defined in the runtime configuration\n var backendSubDomains = ['registry', 'msg-node']; // should be defined in the runtime configuration\n var subDomain = void 0;\n\n if (splitedDomain.length > 1) {\n subDomain = splitedDomain.filter(function (item) {\n return backendSubDomains.indexOf(item) !== -1;\n })[0];\n }\n\n if (subDomain && backendSubDomains.indexOf(subDomain) !== -1) {\n return true;\n }\n\n if (dividedURL.type) {\n return backendSchemes.indexOf(dividedURL.type) !== -1;\n }\n\n return false;\n}\n\nfunction divideEmail(email) {\n var indexOfAt = email.indexOf('@');\n\n var result = {\n username: email.substring(0, indexOfAt),\n domain: email.substring(indexOfAt + 1, email.length)\n };\n\n return result;\n}\n\nfunction assign(obj, keyPath, value) {\n\n if (!obj) obj = {};\n if (typeof keyPath === 'string') keyPath = parseAttributes(keyPath);\n\n var lastKeyIndex = keyPath.length - 1;\n\n for (var i = 0; i < lastKeyIndex; ++i) {\n var key = keyPath[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n obj[keyPath[lastKeyIndex]] = value;\n}\n\nfunction splitObjectURL(dataObjectURL) {\n console.info('[utils - splitObjectURL]: ', dataObjectURL);\n\n var splitedURL = dataObjectURL.split('/');\n var url = splitedURL[0] + '//' + splitedURL[2] + '/' + splitedURL[3];\n var resource = splitedURL[5];\n\n var result = {\n url: url,\n resource: resource\n };\n\n console.info('[utils - splitObjectURL]: ', result);\n\n return result;\n}\n\nfunction checkAttribute(path) {\n\n var regex = /((([a-zA-Z]+):\\/\\/([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\\/[a-zA-Z0-9.]+@[a-zA-Z0-9]+(-)?[a-zA-Z0-9]+(\\.)?[a-zA-Z0-9]{2,10}?\\.[a-zA-Z]{2,10})(.+(?=.identity))?/gm;\n\n var list = [];\n var final = [];\n var test = path.match(regex);\n\n if (test == null) {\n final = path.split('.');\n } else {\n var m = void 0;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach(function (match, groupIndex) {\n if (groupIndex === 0) {\n list.push(match);\n }\n });\n }\n var result = void 0;\n list.forEach(function (url) {\n\n result = path.replace(url, '*-*');\n final = result.split('.').map(function (item) {\n\n if (item === '*-*') {\n return url;\n }\n\n return item;\n });\n });\n }\n\n console.log('[RuntimeCore.Utils.checkAttribute]', final);\n return final;\n}\n\nfunction parseAttributes(path) {\n var regex = /([0-9a-zA-Z][-\\w]*):\\/\\//g;\n\n var string3 = 'identity';\n\n if (!path.includes('://')) {\n return path.split('.');\n } else {\n var string1 = path.split(regex)[0];\n\n var array1 = string1.split('.');\n\n var string2 = path.replace(string1, '');\n\n if (path.includes(string3)) {\n\n var array2 = string2.split(string3 + '.');\n\n console.log('array2 ' + array2);\n\n string2 = array2[0].slice('.', -1);\n\n array2 = array2[1].split('.');\n\n array1.push(string2, string3);\n\n array1 = array1.concat(array2);\n } else {\n array1.push(string2);\n }\n\n return array1.filter(Boolean);\n }\n}\n\nfunction isEmpty(obj) {\n for (var prop in obj) {\n\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return (0, _stringify2.default)(obj) === (0, _stringify2.default)({});\n}\n\nfunction chatkeysToStringCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n dataObjectSessionKeysClone[field].sessionKey = sessionKeys[field].sessionKey.toString();\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToStringCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction chatkeysToArrayCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n var arrayValues = JSON.parse('[' + sessionKeys[field].sessionKey + ']');\n dataObjectSessionKeysClone[field].sessionKey = new Uint8Array(arrayValues);\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToArrayCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction parseMessageURL(URL) {\n var splitedToURL = URL.split('/');\n if (splitedToURL.length <= 6) {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3];\n } else {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3] + '/' + splitedToURL[4];\n }\n}\n\nfunction availableSpace(usage, quota) {\n var available = (usage / quota).toFixed(2);\n return {\n quota: quota,\n usage: usage,\n percent: Number(available)\n };\n}\n\n/**\n* Encodes a JS object to base 64 encode\n* @param {Object} value byteArray value\n* @return {string} encoded value\n*/\nfunction encode(value) {\n try {\n var stringValue = stringify(value);\n return btoa(stringValue);\n } catch (err) {\n console.error('[Utils.encode:err] ' + err);\n throw err;\n }\n}\n\n/**\n * Decode a base64 string to object\n * @param {string_b64} value value encoded in base 64\n * @return {Object} decodedValue\n */\nfunction decode(value) {\n try {\n return JSON.parse(atob(value));\n } catch (err) {\n console.log('[Utils.decode:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Decode a base64 string to Uint8Array\n* @param {string_b64} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction decodeToUint8Array(value) {\n try {\n return new Uint8Array(decode(value));\n } catch (err) {\n console.error('[Utils.decodeToUint8Array:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a JS object to string\n* NOTE: Special conversion for Uint8Arrays\n* @param {Object} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction stringify(value) {\n try {\n var stringValue = void 0;\n if (value.constructor === Uint8Array) {\n stringValue = '[' + value.toString() + ']'; // the [] is for JSON.parse compatibility\n } else {\n stringValue = (0, _stringify2.default)(value);\n }\n return stringValue;\n } catch (err) {\n console.error('[Utils.stringify:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Object} encoded value\n*/\nfunction parse(value) {\n try {\n return JSON.parse(value);\n } catch (err) {\n console.error('[Utils.parse:err]' + err);\n console.trace();\n console.error('That that cause the error:', value);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction parseToUint8Array(value) {\n try {\n return new Uint8Array(parse(value));\n } catch (err) {\n console.error('[Utils.parseToUint8Array:err]' + err);\n throw err;\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL3V0aWxzL3V0aWxzLmpzP2JlNzMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjA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this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX25ldy1wcm9taXNlLWNhcGFiaWxpdHkuanM/YTgwNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyAyNS40LjEuNSBOZXdQcm9taXNlQ2FwYWJpbGl0eShDKVxudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcblxuZnVuY3Rpb24gUHJvbWlzZUNhcGFiaWxpdHkoQykge1xuICB2YXIgcmVzb2x2ZSwgcmVqZWN0O1xuICB0aGlzLnByb21pc2UgPSBuZXcgQyhmdW5jdGlvbiAoJCRyZXNvbHZlLCAkJHJlamVjdCkge1xuICAgIGlmIChyZXNvbHZlICE9PSB1bmRlZmluZWQgfHwgcmVqZWN0ICE9PSB1bmRlZmluZWQpIHRocm93IFR5cGVFcnJvcignQmFkIFByb21pc2UgY29uc3RydWN0b3InKTtcbiAgICByZXNvbHZlID0gJCRyZXNvbHZlO1xuICAgIHJlamVjdCA9ICQkcmVqZWN0O1xuICB9KTtcbiAgdGhpcy5yZXNvbHZlID0gYUZ1bmN0aW9uKHJlc29sdmUpO1xuICB0aGlzLnJlamVjdCA9IGFGdW5jdGlvbihyZWplY3QpO1xufVxuXG5tb2R1bGUuZXhwb3J0cy5mID0gZnVuY3Rpb24gKEMpIHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlQ2FwYWJpbGl0eShDKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbmV3LXByb21pc2UtY2FwYWJpbGl0eS5qc1xuLy8gbW9kdWxlIGlkID0gMzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///37\n")},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n "use strict";\n if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof module === \'object\' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n "use strict";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = "undefined";\n\n var logMethods = [\n "trace",\n "debug",\n "info",\n "warn",\n "error"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === \'function\') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === \'debug\') {\n methodName = \'log\';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, \'log\');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn\'t present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n var storageKey = "loglevel";\n if (name) {\n storageKey += ":" + name;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || \'silent\').toUpperCase();\n\n if (typeof window === undefinedType) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + "=" + levelName + ";";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + "=");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,\n "ERROR": 4, "SILENT": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return "No console available for logging";\n }\n } else {\n throw "log.setLevel() called with invalid level: " + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? "WARN" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if (typeof name !== "string" || name === "") {\n throw new TypeError("You must supply a name when creating a logger.");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n return defaultLogger;\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvbG9nbGV2ZWwvbGliL2xvZ2xldmVsLmpzPzA2ZmMiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiogbG9nbGV2ZWwgLSBodHRwczovL2dpdGh1Yi5jb20vcGltdGVycnkvbG9nbGV2ZWxcbipcbiogQ29weXJpZ2h0IChjKSAyMDEzIFRpbSBQZXJyeVxuKiBMaWNlbnNlZCB1bmRlciB0aGUgTUlUIGxpY2Vuc2UuXG4qL1xuKGZ1bmN0aW9uIChyb290LCBkZWZpbml0aW9uKSB7XG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG4gICAgaWYgKHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCkge1xuICAgICAgICBkZWZpbmUoZGVmaW5pdGlvbik7XG4gICAgfSBlbHNlIGlmICh0eXBlb2YgbW9kdWxlID09PSAnb2JqZWN0JyAmJiBtb2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29va2llcyBpZiBsb2NhbCBzdG9yYWdlIGdpdmVzIHVzIG5vdGhpbmdcbiAgICAgICAgICBpZiAodHlwZW9mIHN0b3JlZExldmVsID09PSB1bmRlZmluZWRUeXBlKSB7XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICB2YXIgY29va2llID0gd2luZG93LmRvY3VtZW50LmNvb2tpZTtcbiAgICAgICAgICAgICAgICAgIHZhciBsb2NhdGlvbiA9IGNvb2tpZS5pbmRleE9mKFxuICAgICAgICAgICAgICAgICAgICAgIGVuY29kZVVSSUNvbXBvbmVudChzdG9yYWdlS2V5KSArIFwiPVwiKTtcbiAgICAgICAgICAgICAgICAgIGlmIChsb2NhdGlvbiAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICBzdG9yZWRMZXZlbCA9IC9eKFteO10rKS8uZXhlYyhjb29raWUuc2xpY2UobG9jYXRpb24pKVsxXTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBjYXRjaCAoaWdub3JlKSB7fVxuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIElmIHRoZSBzdG9yZWQgbGV2ZWwgaXMgbm90IHZhbGlkLCB0cmVhdCBpdCBhcyBpZiBub3RoaW5nIHdhcyBzdG9yZWQuXG4gICAgICAgICAgaWYgKHNlbGYubGV2ZWxzW3N0b3JlZExldmVsXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIHN0b3JlZExldmVsID0gdW5kZWZpbmVkO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBzdG9yZWRMZXZlbDtcbiAgICAgIH1cblxuICAgICAgLypcbiAgICAgICAqXG4gICAgICAgKiBQdWJsaWMgbG9nZ2VyIEFQSSAtIHNlZSBodHRwczovL2dpdGh1Yi5jb20vcGltdGVycnkvbG9nbGV2ZWwgZm9yIGRldGFpbHNcbiAgICAgICAqXG4gICAgICAgKi9cblxuICAgICAgc2VsZi5uYW1lID0g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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///38\n')},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(2);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1leHQuanM/MmExZSJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSByZXF1aXJlKCcuL193a3MnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAzOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///39\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar LIBRARY = __webpack_require__(14);\nvar wksExt = __webpack_require__(39);\nvar defineProperty = __webpack_require__(8).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1kZWZpbmUuanM/NzJiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyIHdrc0V4dCA9IHJlcXVpcmUoJy4vX3drcy1leHQnKTtcbnZhciBkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHZhciAkU3ltYm9sID0gY29yZS5TeW1ib2wgfHwgKGNvcmUuU3ltYm9sID0gTElCUkFSWSA/IHt9IDogZ2xvYmFsLlN5bWJvbCB8fCB7fSk7XG4gIGlmIChuYW1lLmNoYXJBdCgwKSAhPSAnXycgJiYgIShuYW1lIGluICRTeW1ib2wpKSBkZWZpbmVQcm9wZXJ0eSgkU3ltYm9sLCBuYW1lLCB7IHZhbHVlOiB3a3NFeHQuZihuYW1lKSB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///40\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(6);\nvar dPs = __webpack_require__(74);\nvar enumBugKeys = __webpack_require__(32);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(28)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(55).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1q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vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gNDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///41\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(72)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(53)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qcz9jZDA0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jzt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dCI6IiJ9\n//# sourceURL=webpack-internal:///42\n")},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(7) && !__webpack_require__(13)(function () {\n return Object.defineProperty(__webpack_require__(28)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzPzQ5ZjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(10);\nvar toIObject = __webpack_require__(12);\nvar arrayIndexOf = __webpack_require__(65)(false);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzPzIxYjgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUluZGV4T2YgPSByZXF1aXJlKCcuL19hcnJheS1pbmNsdWRlcycpKGZhbHNlKTtcbnZhciBJRV9QUk9UTyA9IHJlcXVpcmUoJy4vX3NoYXJlZC1rZXknKSgnSUVfUFJPVE8nKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBuYW1lcykge1xuICB2YXIgTyA9IHRvSU9iamVjdChvYmplY3QpO1xuICB2YXIgaSA9IDA7XG4gIHZhciByZXN1bHQgPSBbXTtcbiAgdmFyIGtleTtcbiAgZm9yIChrZXkgaW4gTykgaWYgKGtleSAhPSBJRV9QUk9UTykgaGFzKE8sIGtleSkgJiYgcmVzdWx0LnB1c2goa2V5KTtcbiAgLy8gRG9uJ3QgZW51bSBidWcgJiBoaWRkZW4ga2V5c1xuICB3aGlsZSAobmFtZXMubGVuZ3RoID4gaSkgaWYgKGhhcyhPLCBrZXkgPSBuYW1lc1tpKytdKSkge1xuICAgIH5hcnJheUluZGV4T2YocmVzdWx0LCBrZXkpIHx8IHJlc3VsdC5wdXNoKGtleSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDQ0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(24);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz80MTExIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(75);\nvar global = __webpack_require__(1);\nvar hide = __webpack_require__(11);\nvar Iterators = __webpack_require__(17);\nvar TO_STRING_TAG = __webpack_require__(2)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvd2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ge1xuICB2YXIgTkFNRSA9IERPTUl0ZXJhYmxlc1tpXTtcbiAgdmFyIENvbGxlY3Rpb24gPSBnbG9iYWxbTkFNRV07XG4gIHZhciBwcm90byA9IENvbGxlY3Rpb24gJiYgQ29sbGVjdGlvbi5wcm90b3R5cGU7XG4gIGlmIChwcm90byAmJiAhcHJvdG9bVE9fU1RSSU5HX1RBR10pIGhpZGUocHJvdG8sIFRPX1NUUklOR19UQUcsIE5BTUUpO1xuICBJdGVyYXRvcnNbTkFNRV0gPSBJdGVyYXRvcnMuQXJyYXk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///46\n")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BzLmpzP2Q2NDQiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qc1xuLy8gbW9kdWxlIGlkID0gNDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///47\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(112), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzPzdkOTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9rZXlzXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA0OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSA0IDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///48\n')},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(15);\nvar TAG = __webpack_require__(2)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NsYXNzb2YuanM/NDU4ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBnZXR0aW5nIHRhZyBmcm9tIDE5LjEuMy42IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcoKVxudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xudmFyIFRBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuLy8gRVMzIHdyb25nIGhlcmVcbnZhciBBUkcgPSBjb2YoZnVuY3Rpb24gKCkgeyByZXR1cm4gYXJndW1lbnRzOyB9KCkpID09ICdBcmd1bWVudHMnO1xuXG4vLyBmYWxsYmFjayBmb3IgSUUxMSBTY3JpcHQgQWNjZXNzIERlbmllZCBlcnJvclxudmFyIHRyeUdldCA9IGZ1bmN0aW9uIChpdCwga2V5KSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGl0W2tleV07XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgdmFyIE8sIFQsIEI7XG4gIHJldHVybiBpdCA9PT0gdW5kZWZpbmVkID8gJ1VuZGVmaW5lZCcgOiBpdCA9PT0gbnVsbCA/ICdOdWxsJ1xuICAgIC8vIEBAdG9TdHJpbmdUYWcgY2FzZVxuICAgIDogdHlwZW9mIChUID0gdHJ5R2V0KE8gPSBPYmplY3QoaXQpLCBUQUcpKSA9PSAnc3RyaW5nJyA/IFRcbiAgICAvLyBidWlsdGluVGFnIGNhc2VcbiAgICA6IEFSRyA/IGNvZihPKVxuICAgIC8vIEVTMyBhcmd1bWVudHMgZmFsbGJhY2tcbiAgICA6IChCID0gY29mKE8pKSA9PSAnT2JqZWN0JyAmJiB0eXBlb2YgTy5jYWxsZWUgPT0gJ2Z1bmN0aW9uJyA/ICdBcmd1bWVudHMnIDogQjtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY2xhc3NvZi5qc1xuLy8gbW9kdWxlIGlkID0gNDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///49\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar fails = __webpack_require__(13);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1zYXAuanM/YmFhNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBtb3N0IE9iamVjdCBtZXRob2RzIGJ5IEVTNiBzaG91bGQgYWNjZXB0IHByaW1pdGl2ZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVksIGV4ZWMpIHtcbiAgdmFyIGZuID0gKGNvcmUuT2JqZWN0IHx8IHt9KVtLRVldIHx8IE9iamVjdFtLRVldO1xuICB2YXIgZXhwID0ge307XG4gIGV4cFtLRVldID0gZXhlYyhmbik7XG4gICRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogZmFpbHMoZnVuY3Rpb24gKCkgeyBmbigxKTsgfSksICdPYmplY3QnLCBleHApO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzXG4vLyBtb2R1bGUgaWQgPSA1MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///50\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(27);\nvar createDesc = __webpack_require__(21);\nvar toIObject = __webpack_require__(12);\nvar toPrimitive = __webpack_require__(29);\nvar has = __webpack_require__(10);\nvar IE8_DOM_DEFINE = __webpack_require__(43);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BkLmpzPzJjYTYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHBJRSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIElFOF9ET01fREVGSU5FID0gcmVxdWlyZSgnLi9faWU4LWRvbS1kZWZpbmUnKTtcbnZhciBnT1BEID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGdPUEQgOiBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoTywgUCkge1xuICBPID0gdG9JT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZ09QRChPLCBQKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIGlmIChoYXMoTywgUCkpIHJldHVybiBjcmVhdGVEZXNjKCFwSUUuZi5jYWxsKE8sIFApLCBPW1BdKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcGQuanNcbi8vIG1vZHVsZSBpZCA9IDUxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///51\n")},function(module,exports){eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///52\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(14);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(54);\nvar hide = __webpack_require__(11);\nvar Iterators = __webpack_require__(17);\nvar $iterCreate = __webpack_require__(73);\nvar setToStringTag = __webpack_require__(23);\nvar getPrototypeOf = __webpack_require__(63);\nvar ITERATOR = __webpack_require__(2)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# source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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///53\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(11);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLmpzP2YzY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19oaWRlJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fcmVkZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///54\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(1).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanM/NDRmMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbm1vZHVsZS5leHBvcnRzID0gZG9jdW1lbnQgJiYgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDU1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///55\n")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(6);\nvar aFunction = __webpack_require__(20);\nvar SPECIES = __webpack_require__(2)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NwZWNpZXMtY29uc3RydWN0b3IuanM/YjdjYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjMuMjAgU3BlY2llc0NvbnN0cnVjdG9yKE8sIGRlZmF1bHRDb25zdHJ1Y3RvcilcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbnZhciBTUEVDSUVTID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKE8sIEQpIHtcbiAgdmFyIEMgPSBhbk9iamVjdChPKS5jb25zdHJ1Y3RvcjtcbiAgdmFyIFM7XG4gIHJldHVybiBDID09PSB1bmRlZmluZWQgfHwgKFMgPSBhbk9iamVjdChDKVtTUEVDSUVTXSkgPT0gdW5kZWZpbmVkID8gRCA6IGFGdW5jdGlvbihTKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc3BlY2llcy1jb25zdHJ1Y3Rvci5qc1xuLy8gbW9kdWxlIGlkID0gNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///56\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(16);\nvar invoke = __webpack_require__(83);\nvar html = __webpack_require__(55);\nvar cel = __webpack_require__(28);\nvar global = __webpack_require__(1);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(15)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHV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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///57\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3BlcmZvcm0uanM/NzRkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChleGVjKSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIHsgZTogZmFsc2UsIHY6IGV4ZWMoKSB9O1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHsgZTogdHJ1ZSwgdjogZSB9O1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3BlcmZvcm0uanNcbi8vIG1vZHVsZSBpZCA9IDU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///58\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(6);\nvar isObject = __webpack_require__(9);\nvar newPromiseCapability = __webpack_require__(37);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\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0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///59\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(91);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(93);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {\n return typeof obj === "undefined" ? "undefined" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz9hNDU2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2l0ZXJhdG9yID0gcmVxdWlyZShcIi4uL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yXCIpO1xuXG52YXIgX2l0ZXJhdG9yMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2l0ZXJhdG9yKTtcblxudmFyIF9zeW1ib2wgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9zeW1ib2xc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hPT0gX3N5bWJvbDIuZGVmYXVsdC5wcm90b3R5cGUgPyBcInN5bWJvbFwiIDogdHlwZW9mIG9iaiA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiBfdHlwZW9mKG9iaik7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90eXBlb2YuanNcbi8vIG1vZHVsZSBpZCA9IDYwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///60\n')},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(44);\nvar hiddenKeys = __webpack_require__(32).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLmpzPzlmNDQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjcgLyAxNS4yLjMuNCBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhPKVxudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMtaW50ZXJuYWwnKTtcbnZhciBoaWRkZW5LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpLmNvbmNhdCgnbGVuZ3RoJywgJ3Byb3RvdHlwZScpO1xuXG5leHBvcnRzLmYgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyB8fCBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKE8pIHtcbiAgcmV0dXJuICRrZXlzKE8sIGhpZGRlbktleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi5qc1xuLy8gbW9kdWxlIGlkID0gNjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///61\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(15);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/MzE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///62\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(10);\nvar toObject = __webpack_require__(33);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1ncG8uanM/M2YzYy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require__){eval('module.exports = { "default": __webpack_require__(67), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/MGI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA2NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///64\n')},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(12);\nvar toLength = __webpack_require__(45);\nvar toAbsoluteIndex = __webpack_require__(66);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzP2JjNTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXNcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0Fic29sdXRlSW5kZXggPSByZXF1aXJlKCcuL190by1hYnNvbHV0ZS1pbmRleCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoSVNfSU5DTFVERVMpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uICgkdGhpcywgZWwsIGZyb21JbmRleCkge1xuICAgIHZhciBPID0gdG9JT2JqZWN0KCR0aGlzKTtcbiAgICB2YXIgbGVuZ3RoID0gdG9MZW5ndGgoTy5sZW5ndGgpO1xuICAgIHZhciBpbmRleCA9IHRvQWJzb2x1dGVJbmRleChmcm9tSW5kZXgsIGxlbmd0aCk7XG4gICAgdmFyIHZhbHVlO1xuICAgIC8vIEFycmF5I2luY2x1ZGVzIHVzZXMgU2FtZVZhbHVlWmVybyBlcXVhbGl0eSBhbGdvcml0aG1cbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gICAgaWYgKElTX0lOQ0xVREVTICYmIGVsICE9IGVsKSB3aGlsZSAobGVuZ3RoID4gaW5kZXgpIHtcbiAgICAgIHZhbHVlID0gT1tpbmRleCsrXTtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgIGlmICh2YWx1ZSAhPSB2YWx1ZSkgcmV0dXJuIHRydWU7XG4gICAgLy8gQXJyYXkjaW5kZXhPZiBpZ25vcmVzIGhvbGVzLCBBcnJheSNpbmNsdWRlcyAtIG5vdFxuICAgIH0gZWxzZSBmb3IgKDtsZW5ndGggPiBpbmRleDsgaW5kZXgrKykgaWYgKElTX0lOQ0xVREVTIHx8IGluZGV4IGluIE8pIHtcbiAgICAgIGlmIChPW2luZGV4XSA9PT0gZWwpIHJldHVybiBJU19JTkNMVURFUyB8fCBpbmRleCB8fCAwO1xuICAgIH0gcmV0dXJuICFJU19JTkNMVURFUyAmJiAtMTtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYXJyYXktaW5jbHVkZXMuanNcbi8vIG1vZHVsZSBpZCA9IDY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///65\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(24);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzPzdlNDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(68);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/ZjViMCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5Jyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpIHtcbiAgcmV0dXJuICRPYmplY3QuZGVmaW5lUHJvcGVydHkoaXQsIGtleSwgZGVzYyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///67\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(8).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanM/OTgyOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjQgLyAxNS4yLjMuNiBPYmplY3QuZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnR5OiByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///68\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(111), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzPzlhZjEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5XCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSA2OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///69\n')},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(49);\nvar ITERATOR = __webpack_require__(2)('iterator');\nvar Iterators = __webpack_require__(17);\nmodule.exports = __webpack_require__(0).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kLmpzP2RkZmIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgSVRFUkFUT1IgPSByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fY29yZScpLmdldEl0ZXJhdG9yTWV0aG9kID0gZnVuY3Rpb24gKGl0KSB7XG4gIGlmIChpdCAhPSB1bmRlZmluZWQpIHJldHVybiBpdFtJVEVSQVRPUl1cbiAgICB8fCBpdFsnQEBpdGVyYXRvciddXG4gICAgfHwgSXRlcmF0b3JzW2NsYXNzb2YoaXQpXTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QuanNcbi8vIG1vZHVsZSBpZCA9IDcwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///70\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(52);\n__webpack_require__(42);\n__webpack_require__(46);\n__webpack_require__(78);\n__webpack_require__(89);\n__webpack_require__(90);\nmodule.exports = __webpack_require__(0).Promise;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3Byb21pc2UuanM/NTM5OCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi9tb2R1bGVzL2VzNi5vYmplY3QudG8tc3RyaW5nJyk7XG5yZXF1aXJlKCcuLi9tb2R1bGVzL2VzNi5zdHJpbmcuaXRlcmF0b3InKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczYucHJvbWlzZScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczcucHJvbWlzZS5maW5hbGx5Jyk7XG5yZXF1aXJlKCcuLi9tb2R1bGVzL2VzNy5wcm9taXNlLnRyeScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi9tb2R1bGVzL19jb3JlJykuUHJvbWlzZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9wcm9taXNlLmpzXG4vLyBtb2R1bGUgaWQgPSA3MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///71\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(24);\nvar defined = __webpack_require__(25);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3N0cmluZy1hdC5qcz84N2FlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbi8vIHRydWUgIC0+IFN0cmluZyNhdFxuLy8gZmFsc2UgLT4gU3RyaW5nI2NvZGVQb2ludEF0XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChUT19TVFJJTkcpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uICh0aGF0LCBwb3MpIHtcbiAgICB2YXIgcyA9IFN0cmluZyhkZWZpbmVkKHRoYXQpKTtcbiAgICB2YXIgaSA9IHRvSW50ZWdlcihwb3MpO1xuICAgIHZhciBsID0gcy5sZW5ndGg7XG4gICAgdmFyIGEsIGI7XG4gICAgaWYgKGkgPCAwIHx8IGkgPj0gbCkgcmV0dXJuIFRPX1NUUklORyA/ICcnIDogdW5kZWZpbmVkO1xuICAgIGEgPSBzLmNoYXJDb2RlQXQoaSk7XG4gICAgcmV0dXJuIGEgPCAweGQ4MDAgfHwgYSA+IDB4ZGJmZiB8fCBpICsgMSA9PT0gbCB8fCAoYiA9IHMuY2hhckNvZGVBdChpICsgMSkpIDwgMHhkYzAwIHx8IGIgPiAweGRmZmZcbiAgICAgID8gVE9fU1RSSU5HID8gcy5jaGFyQXQoaSkgOiBhXG4gICAgICA6IFRPX1NUUklORyA/IHMuc2xpY2UoaSwgaSArIDIpIDogKGEgLSAweGQ4MDAgPDwgMTApICsgKGIgLSAweGRjMDApICsgMHgxMDAwMDtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc3RyaW5nLWF0LmpzXG4vLyBtb2R1bGUgaWQgPSA3MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///72\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(41);\nvar descriptor = __webpack_require__(21);\nvar setToStringTag = __webpack_require__(23);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(11)(IteratorPrototype, __webpack_require__(2)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY3JlYXRlLmpzP2Y3ODUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciBkZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciBJdGVyYXRvclByb3RvdHlwZSA9IHt9O1xuXG4vLyAyNS4xLjIuMS4xICVJdGVyYXRvclByb3RvdHlwZSVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faGlkZScpKEl0ZXJhdG9yUHJvdG90eXBlLCByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKSwgZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpczsgfSk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKENvbnN0cnVjdG9yLCBOQU1FLCBuZXh0KSB7XG4gIENvbnN0cnVjdG9yLnByb3RvdHlwZSA9IGNyZWF0ZShJdGVyYXRvclByb3RvdHlwZSwgeyBuZXh0OiBkZXNjcmlwdG9yKDEsIG5leHQpIH0pO1xuICBzZXRUb1N0cmluZ1RhZyhDb25zdHJ1Y3RvciwgTkFNRSArICcgSXRlcmF0b3InKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlci1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDczXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///73\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(8);\nvar anObject = __webpack_require__(6);\nvar getKeys = __webpack_require__(19);\n\nmodule.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcHMuanM/YWEyYSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydGllcyA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcykge1xuICBhbk9iamVjdChPKTtcbiAgdmFyIGtleXMgPSBnZXRLZXlzKFByb3BlcnRpZXMpO1xuICB2YXIgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG4gIHZhciBpID0gMDtcbiAgdmFyIFA7XG4gIHdoaWxlIChsZW5ndGggPiBpKSBkUC5mKE8sIFAgPSBrZXlzW2krK10sIFByb3BlcnRpZXNbUF0pO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gNzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///74\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(76);\nvar step = __webpack_require__(77);\nvar Iterators = __webpack_require__(17);\nvar toIObject = __webpack_require__(12);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(53)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LmFycmF5Lml0ZXJhdG9yLmpzP2M0NjkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGFkZFRvVW5zY29wYWJsZXMgPSByZXF1aXJlKCcuL19hZGQtdG8tdW5zY29wYWJsZXMnKTtcbnZhciBzdGVwID0gcmVxdWlyZSgnLi9faXRlci1zdGVwJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xuXG4vLyAyMi4xLjMuNCBBcnJheS5wcm90b3R5cGUuZW50cmllcygpXG4vLyAyMi4xLjMuMTMgQXJyYXkucHJvdG90eXBlLmtleXMoKVxuLy8gMjIuMS4zLjI5IEFycmF5LnByb3RvdHlwZS52YWx1ZXMoKVxuLy8gMjIuMS4zLjMwIEFycmF5LnByb3RvdHlwZVtAQGl0ZXJhdG9yXSgpXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2l0ZXItZGVmaW5lJykoQXJyYXksICdBcnJheScsIGZ1bmN0aW9uIChpdGVyYXRlZCwga2luZCkge1xuICB0aGlzLl90ID0gdG9JT2JqZWN0KGl0ZXJhdGVkKTsgLy8gdGFyZ2V0XG4gIHRoaXMuX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DQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///75\n")},function(module,exports){eval("module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qcz9lMjY3Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qc1xuLy8gbW9kdWxlIGlkID0gNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///76\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qcz8xMDY2Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGRvbmUsIHZhbHVlKSB7XG4gIHJldHVybiB7IHZhbHVlOiB2YWx1ZSwgZG9uZTogISFkb25lIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qc1xuLy8gbW9kdWxlIGlkID0gNzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///77\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(14);\nvar global = __webpack_require__(1);\nvar ctx = __webpack_require__(16);\nvar classof = __webpack_require__(49);\nvar $export = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar aFunction = __webpack_require__(20);\nvar anInstance = __webpack_require__(79);\nvar forOf = __webpack_require__(80);\nvar speciesConstructor = __webpack_require__(56);\nvar task = __webpack_require__(57).set;\nvar microtask = __webpack_require__(84)();\nvar newPromiseCapabilityModule = __webpack_require__(37);\nvar perform = __webpack_require__(58);\nvar userAgent = __webpack_require__(85);\nvar promiseResolve = __webpack_require__(59);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(2)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(86)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(23)($Promise, PROMISE);\n__webpack_require__(87)(PROMISE);\nWrapper = __webpack_require__(0)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(88)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnByb21pc2UuanM/MDk3YyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgTElCUkFSWSA9IHJlcXVpcmUoJy4vX2xpYnJhcnknKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBjbGFzc29mID0gcmVxdWlyZSgnLi9fY2xhc3NvZicpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbnZhciBhbkluc3RhbmNlID0gcmVxdWlyZSgnLi9fY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B9XG4gICAgICAgICAgaWYgKGhhbmRsZXIgPT09IHRydWUpIHJlc3VsdCA9IHZhbHVlO1xuICAgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKGRvbWFpbikgZG9tYWluLmVudGVyKCk7XG4gICAgICAgICAgICByZXN1bHQgPSBoYW5kbGVyKHZhbHVlKTsgLy8gbWF5IHRocm93XG4gICAgICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICAgIGRvbWFpbi5leGl0KCk7XG4gICAgICAgICAgICAgIGV4aXRlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyZXN1bHQgPT09IHJlYWN0aW9uLnByb21pc2UpIHtcbiAgICAgICAgICAgIHJlamVjdChUeXBlRXJyb3IoJ1Byb21pc2UtY2hhaW4gY3ljbGUnKSk7XG4gICAgICAgICAgfSBlbHNlIGlmICh0aGVuID0gaXNUaGVuYWJsZShyZXN1bHQpKSB7XG4gICAgICAgICAgICB0aGVuLmNhbGwocmVzdWx0LCByZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgIH0gZWxzZSByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH0gZWxzZSByZWplY3QodmFsdWUpO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBpZiAoZG9tYWluICYmICFleGl0ZWQpIGRvbWFpbi5leGl0KCk7XG4gICAgICAgIHJlamVjdChlKTtcbiAgICAgIH1cbiAgICB9O1xuICAgIHdoaWxlIChjaGFpbi5sZW5ndGggPiBpKSBydW4oY2hhaW5baSsrXSk7IC8vIHZhcmlhYmxlIGxlbmd0aCAtIGNhbid0IHVzZSBmb3JFYWNoXG4gICAgcHJvbWlzZS5fYyA9IFtdO1xuICAgIHByb21pc2UuX24gPSBmYWxzZTtcbiAgICBpZiAoaXNSZWplY3QgJiYgIXByb21pc2UuX2gpIG9uVW5oYW5kbGVkKHByb21pc2UpO1xuICB9KTtcbn07XG52YXIgb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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///78\n")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLWluc3RhbmNlLmpzP2Q4YWMiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIENvbnN0cnVjdG9yLCBuYW1lLCBmb3JiaWRkZW5GaWVsZCkge1xuICBpZiAoIShpdCBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSB8fCAoZm9yYmlkZGVuRmllbGQgIT09IHVuZGVmaW5lZCAmJiBmb3JiaWRkZW5GaWVsZCBpbiBpdCkpIHtcbiAgICB0aHJvdyBUeXBlRXJyb3IobmFtZSArICc6IGluY29ycmVjdCBpbnZvY2F0aW9uIScpO1xuICB9IHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYW4taW5zdGFuY2UuanNcbi8vIG1vZHVsZSBpZCA9IDc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///79\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(16);\nvar call = __webpack_require__(81);\nvar isArrayIter = __webpack_require__(82);\nvar anObject = __webpack_require__(6);\nvar toLength = __webpack_require__(45);\nvar getIterFn = __webpack_require__(70);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2Zvci1vZi5qcz8zNTZiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBjYWxsID0gcmVxdWlyZSgnLi9faXRlci1jYWxsJyk7XG52YXIgaXNBcnJheUl0ZXIgPSByZXF1aXJlKCcuL19pcy1hcnJheS1pdGVyJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xudmFyIGdldEl0ZXJGbiA9IHJlcXVpcmUoJy4vY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kJyk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sIGYsIHN0ZXAudmFsdWUsIGVudHJpZXMpO1xuICAgIGlmIChyZXN1bHQgPT09IEJSRUFLIHx8IHJlc3VsdCA9PT0gUkVUVVJOKSByZXR1cm4gcmVzdWx0O1xuICB9XG59O1xuZXhwb3J0cy5CUkVBSyA9IEJSRUFLO1xuZXhwb3J0cy5SRVRVUk4gPSBSRVRVUk47XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZm9yLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA4MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///80\n")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(6);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY2FsbC5qcz85YWM1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGNhbGwgc29tZXRoaW5nIG9uIGl0ZXJhdG9yIHN0ZXAgd2l0aCBzYWZlIGNsb3Npbmcgb24gZXJyb3JcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXRlcmF0b3IsIGZuLCB2YWx1ZSwgZW50cmllcykge1xuICB0cnkge1xuICAgIHJldHVybiBlbnRyaWVzID8gZm4oYW5PYmplY3QodmFsdWUpWzBdLCB2YWx1ZVsxXSkgOiBmbih2YWx1ZSk7XG4gIC8vIDcuNC42IEl0ZXJhdG9yQ2xvc2UoaXRlcmF0b3IsIGNvbXBsZXRpb24pXG4gIH0gY2F0Y2ggKGUpIHtcbiAgICB2YXIgcmV0ID0gaXRlcmF0b3JbJ3JldHVybiddO1xuICAgIGlmIChyZXQgIT09IHVuZGVmaW5lZCkgYW5PYmplY3QocmV0LmNhbGwoaXRlcmF0b3IpKTtcbiAgICB0aHJvdyBlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY2FsbC5qc1xuLy8gbW9kdWxlIGlkID0gODFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///81\n")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(17);\nvar ITERATOR = __webpack_require__(2)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LWl0ZXIuanM/MzIxYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBjaGVjayBvbiBkZWZhdWx0IEFycmF5IGl0ZXJhdG9yXG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgSVRFUkFUT1IgPSByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKTtcbnZhciBBcnJheVByb3RvID0gQXJyYXkucHJvdG90eXBlO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXQgIT09IHVuZGVmaW5lZCAmJiAoSXRlcmF0b3JzLkFycmF5ID09PSBpdCB8fCBBcnJheVByb3RvW0lURVJBVE9SXSA9PT0gaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1hcnJheS1pdGVyLmpzXG4vLyBtb2R1bGUgaWQgPSA4MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///82\n")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ludm9rZS5qcz85MjdiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhc3QgYXBwbHksIGh0dHA6Ly9qc3BlcmYubG5raXQuY29tL2Zhc3QtYXBwbHkvNVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZm4sIGFyZ3MsIHRoYXQpIHtcbiAgdmFyIHVuID0gdGhhdCA9PT0gdW5kZWZpbmVkO1xuICBzd2l0Y2ggKGFyZ3MubGVuZ3RoKSB7XG4gICAgY2FzZSAwOiByZXR1cm4gdW4gPyBmbigpXG4gICAgICAgICAgICAgICAgICAgICAgOiBmbi5jYWxsKHRoYXQpO1xuICAgIGNhc2UgMTogcmV0dXJuIHVuID8gZm4oYXJnc1swXSlcbiAgICAgICAgICAgICAgICAgICAgICA6IGZuLmNhbGwodGhhdCwgYXJnc1swXSk7XG4gICAgY2FzZSAyOiByZXR1cm4gdW4gPyBmbihhcmdzWzBdLCBhcmdzWzFdKVxuICAgICAgICAgICAgICAgICAgICAgIDogZm4uY2FsbCh0aGF0LCBhcmdzWzBdLCBhcmdzWzFdKTtcbiAgICBjYXNlIDM6IHJldHVybiB1biA/IGZuKGFyZ3NbMF0sIGFyZ3NbMV0sIGFyZ3NbMl0pXG4gICAgICAgICAgICAgICAgICAgICAgOiBmbi5jYWxsKHRoYXQsIGFyZ3NbMF0sIGFyZ3NbMV0sIGFyZ3NbMl0pO1xuICAgIGNhc2UgNDogcmV0dXJuIHVuID8gZm4oYXJnc1swXSwgYXJnc1sxXSwgYXJnc1syXSwgYXJnc1szXSlcbiAgICAgICAgICAgICAgICAgICAgICA6IGZuLmNhbGwodGhhdCwgYXJnc1swXSwgYXJnc1sxXSwgYXJnc1syXSwgYXJnc1szXSk7XG4gIH0gcmV0dXJuIGZuLmFwcGx5KHRoYXQsIGFyZ3MpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pbnZva2UuanNcbi8vIG1vZHVsZSBpZCA9IDgzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///83\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar macrotask = __webpack_require__(57).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(15)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21pY3JvdGFzay5qcz9mMzYzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBtYWNyb3Rhc2sgPSByZXF1aXJlKCcuL190YXNrJykuc2V0O1xudmFyIE9ic2VydmVyID0gZ2xvYmFsLk11dGF0aW9uT2JzZXJ2ZXIgfHwgZ2xvYmFsLldlYktpdE11dGF0aW9uT2JzZXJ2ZXI7XG52YXIgcHJvY2VzcyA9IGdsb2JhbC5wcm9jZXNzO1xudmFyIFByb21pc2UgPSBnbG9iYWwuUHJvbWlzZTtcbnZhciBpc05vZGUgPSByZXF1aXJlKCcuL19jb2YnKShwcm9jZXNzKSA9PSAncHJvY2Vzcyc7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkge1xuICB2YXIgaGVhZCwgbGFzdCwgbm90aWZ5O1xuXG4gIHZhciBmbHVzaCA9IGZ1bmN0a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ZWFkKSB7XG4gICAgICBoZWFkID0gdGFzaztcbiAgICAgIG5vdGlmeSgpO1xuICAgIH0gbGFzdCA9IHRhc2s7XG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21pY3JvdGFzay5qc1xuLy8gbW9kdWxlIGlkID0gODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///84\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VzZXItYWdlbnQuanM/ODk0NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgbmF2aWdhdG9yID0gZ2xvYmFsLm5hdmlnYXRvcjtcblxubW9kdWxlLmV4cG9ydHMgPSBuYXZpZ2F0b3IgJiYgbmF2aWdhdG9yLnVzZXJBZ2VudCB8fCAnJztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL191c2VyLWFnZW50LmpzXG4vLyBtb2R1bGUgaWQgPSA4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///85\n")},function(module,exports,__webpack_require__){eval("var hide = __webpack_require__(11);\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLWFsbC5qcz9jNDdmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGFyZ2V0LCBzcmMsIHNhZmUpIHtcbiAgZm9yICh2YXIga2V5IGluIHNyYykge1xuICAgIGlmIChzYWZlICYmIHRhcmdldFtrZXldKSB0YXJnZXRba2V5XSA9IHNyY1trZXldO1xuICAgIGVsc2UgaGlkZSh0YXJnZXQsIGtleSwgc3JjW2tleV0pO1xuICB9IHJldHVybiB0YXJnZXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLWFsbC5qc1xuLy8gbW9kdWxlIGlkID0gODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///86\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar dP = __webpack_require__(8);\nvar DESCRIPTORS = __webpack_require__(7);\nvar SPECIES = __webpack_require__(2)('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC1zcGVjaWVzLmpzPzZkMWEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgU1BFQ0lFUyA9IHJlcXVpcmUoJy4vX3drcycpKCdzcGVjaWVzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKEtFWSkge1xuICB2YXIgQyA9IHR5cGVvZiBjb3JlW0tFWV0gPT0gJ2Z1bmN0aW9uJyA/IGNvcmVbS0VZXSA6IGdsb2JhbFtLRVldO1xuICBpZiAoREVTQ1JJUFRPUlMgJiYgQyAmJiAhQ1tTUEVDSUVTXSkgZFAuZihDLCBTUEVDSUVTLCB7XG4gICAgY29uZmlndXJhYmxlOiB0cnVlLFxuICAgIGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpczsgfVxuICB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDg3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///87\n")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(2)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItZGV0ZWN0LmpzPzc1OGQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgU0FGRV9DTE9TSU5HID0gZmFsc2U7XG5cbnRyeSB7XG4gIHZhciByaXRlciA9IFs3XVtJVEVSQVRPUl0oKTtcbiAgcml0ZXJbJ3JldHVybiddID0gZnVuY3Rpb24gKCkgeyBTQUZFX0NMT1NJTkcgPSB0cnVlOyB9O1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdGhyb3ctbGl0ZXJhbFxuICBBcnJheS5mcm9tKHJpdGVyLCBmdW5jdGlvbiAoKSB7IHRocm93IDI7IH0pO1xufSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGV4ZWMsIHNraXBDbG9zaW5nKSB7XG4gIGlmICghc2tpcENsb3NpbmcgJiYgIVNBRkVfQ0xPU0lORykgcmV0dXJuIGZhbHNlO1xuICB2YXIgc2FmZSA9IGZhbHNlO1xuICB0cnkge1xuICAgIHZhciBhcnIgPSBbN107XG4gICAgdmFyIGl0ZXIgPSBhcnJbSVRFUkFUT1JdKCk7XG4gICAgaXRlci5uZXh0ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4geyBkb25lOiBzYWZlID0gdHJ1ZSB9OyB9O1xuICAgIGFycltJVEVSQVRPUl0gPSBmdW5jdGlvbiAoKSB7IHJldHVybiBpdGVyOyB9O1xuICAgIGV4ZWMoYXJyKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIHJldHVybiBzYWZlO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWRldGVjdC5qc1xuLy8gbW9kdWxlIGlkID0gODhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///88\n")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar speciesConstructor = __webpack_require__(56);\nvar promiseResolve = __webpack_require__(59);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXM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xseVxuICApO1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLmZpbmFsbHkuanNcbi8vIG1vZHVsZSBpZCA9IDg5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///89\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(5);\nvar newPromiseCapability = __webpack_require__(37);\nvar perform = __webpack_require__(58);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnByb21pc2UudHJ5LmpzPzhjYTUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtcHJvbWlzZS10cnlcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgbmV3UHJvbWlzZUNhcGFiaWxpdHkgPSByZXF1aXJlKCcuL19uZXctcHJvbWlzZS1jYXBhYmlsaXR5Jyk7XG52YXIgcGVyZm9ybSA9IHJlcXVpcmUoJy4vX3BlcmZvcm0nKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdQcm9taXNlJywgeyAndHJ5JzogZnVuY3Rpb24gKGNhbGxiYWNrZm4pIHtcbiAgdmFyIHByb21pc2VDYXBhYmlsaXR5ID0gbmV3UHJvbWlzZUNhcGFiaWxpdHkuZih0aGlzKTtcbiAgdmFyIHJlc3VsdCA9IHBlcmZvcm0oY2FsbGJhY2tmbik7XG4gIChyZXN1bHQuZSA/IHByb21pc2VDYXBhYmlsaXR5LnJlamVjdCA6IHByb21pc2VDYXBhYmlsaXR5LnJlc29sdmUpKHJlc3VsdC52KTtcbiAgcmV0dXJuIHByb21pc2VDYXBhYmlsaXR5LnByb21pc2U7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnByb21pc2UudHJ5LmpzXG4vLyBtb2R1bGUgaWQgPSA5MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///90\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(92), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC9pdGVyYXRvci5qcz82NzM4Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///91\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(42);\n__webpack_require__(46);\nmodule.exports = __webpack_require__(39).f('iterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qcz9mZTdlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvcicpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX3drcy1leHQnKS5mKCdpdGVyYXRvcicpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gOTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///92\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(94), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC5qcz9lNTA1Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2xcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sLmpzXG4vLyBtb2R1bGUgaWQgPSA5M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///93\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(95);\n__webpack_require__(52);\n__webpack_require__(100);\n__webpack_require__(101);\nmodule.exports = __webpack_require__(0).Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qcz8wNzA3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN5bWJvbCcpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZycpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcuc3ltYm9sLmFzeW5jLWl0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuU3ltYm9sO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gOTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///94\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(1);\nvar has = __webpack_require__(10);\nvar DESCRIPTORS = __webpack_require__(7);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(54);\nvar META = __webpack_require__(96).KEY;\nvar $fails = __webpack_require__(13);\nvar shared = __webpack_require__(31);\nvar setToStringTag = __webpack_require__(23);\nvar uid = __webpack_require__(22);\nvar wks = __webpack_require__(2);\nvar wksExt = __webpack_require__(39);\nvar wksDefine = __webpack_require__(40);\nvar enumKeys = __webpack_require__(97);\nvar isArray = __webpack_require__(98);\nvar anObject = __webpack_require__(6);\nvar isObject = __webpack_require__(9);\nvar toIObject = __webpack_require__(12);\nvar toPrimitive = __webpack_require__(29);\nvar createDesc = __webpack_require__(21);\nvar _create = __webpack_require__(41);\nvar gOPNExt = __webpack_require__(99);\nvar $GOPD = __webpack_require__(51);\nvar $DP = __webpack_require__(8);\nvar $keys = __webpack_require__(19);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(61).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(27).f = $propertyIsEnumerable;\n __webpack_require__(47).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(14)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(11)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN5bWJvbC5qcz83ZDY3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEVDTUFTY3JpcHQgNiBzeW1ib2xzIHNoaW1cbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHJlZGVmaW5lID0gcmVxdWlyZSgnLi9fcmVkZWZpbmUnKTtcbnZhciBNRVRBID0gcmVxdWlyZSgnLi9fbWV0YScpLktFWTtcbnZhciAkZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIHNoYXJlZCA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbnZhciB3a3MgPSByZXF1aXJlKCcuL193a3MnKTtcbnZhciB3a3NFeHQgPSByZXF1aXJlKCcuL193a3MtZXh0Jyk7XG52YXIgd2tzRGVmaW5lID0gcmVxdWlyZSgnLi9fd2tzLWRlZmluZScpO1xudmFyIGVudW1LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1rZXlz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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///95\n")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(22)('meta');\nvar isObject = __webpack_require__(9);\nvar has = __webpack_require__(10);\nvar setDesc = __webpack_require__(8).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(13)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21ldGEuanM/ZDNhMyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgTUVUQSA9IHJlcXVpcmUoJy4vX3VpZCcpKCdtZXRhJyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBzZXREZXNjID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbnZhciBpZCA9IDA7XG52YXIgaXNFeHRlbnNpYmxlID0gT2JqZWN0LmlzRXh0ZW5zaWJsZSB8fCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiB0cnVlO1xufTtcbnZhciBGUkVFWkUgPSAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBpc0V4dGVuc2libGUoT2JqZWN0LnByZXZlbnRFeHRlbnNpb25zKHt9KSk7XG59KTtcbnZhciBzZXRNZXRhID0gZnVuY3Rpb24gKGl0KSB7XG4gIHNldERlc2MoaXQsIE1FVEEsIHsgdmFsdWU6IHtcbiAgICBpOiAnTycgKyArK2lkLCAvLyBvYmplY3QgSURcbiAgICB3OiB7fSAgICAgICAgICAvLyB3ZWFrIGNvbGxlY3Rpb25zIElEc1xuICB9IH0pO1xufTtcbnZhciBmYXN0S2V5ID0gZnVuY3Rpb24gKGl0LCBjcmVhdGUpIHtcbiAgLy8gcmV0dXJuIHByaW1pdGl2ZSB3aXRoIHByZWZpeFxuICBpZiAoIWlzT2JqZWN0KGl0KSkgcmV0dXJuIHR5cGVvZiBpdCA9PSAnc3ltYm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YmxlKGl0KSAmJiAhaGFzKGl0LCBNRVRBKSkgc2V0TWV0YShpdCk7XG4gIHJldHVybiBpdDtcbn07XG52YXIgbWV0YSA9IG1vZHVsZS5leHBvcnRzID0ge1xuICBLRVk6IE1FVEEsXG4gIE5FRUQ6IGZhbHNlLFxuICBmYXN0S2V5OiBmYXN0S2V5LFxuICBnZXRXZWFrOiBnZXRXZWFrLFxuICBvbkZyZWV6ZTogb25GcmVlemVcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbWV0YS5qc1xuLy8gbW9kdWxlIGlkID0gOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///96\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(19);\nvar gOPS = __webpack_require__(47);\nvar pIE = __webpack_require__(27);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0ta2V5cy5qcz81ZGNlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGFsbCBlbnVtZXJhYmxlIG9iamVjdCBrZXlzLCBpbmNsdWRlcyBzeW1ib2xzXG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG52YXIgZ09QUyA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BzJyk7XG52YXIgcElFID0gcmVxdWlyZSgnLi9fb2JqZWN0LXBpZScpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgdmFyIHJlc3VsdCA9IGdldEtleXMoaXQpO1xuICB2YXIgZ2V0U3ltYm9scyA9IGdPUFMuZjtcbiAgaWYgKGdldFN5bWJvbHMpIHtcbiAgICB2YXIgc3ltYm9scyA9IGdldFN5bWJvbHMoaXQpO1xuICAgIHZhciBpc0VudW0gPSBwSUUuZjtcbiAgICB2YXIgaSA9IDA7XG4gICAgdmFyIGtleTtcbiAgICB3aGlsZSAoc3ltYm9scy5sZW5ndGggPiBpKSBpZiAoaXNFbnVtLmNhbGwoaXQsIGtleSA9IHN5bWJvbHNbaSsrXSkpIHJlc3VsdC5wdXNoKGtleSk7XG4gIH0gcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZW51bS1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA5N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///97\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(15);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LmpzP2VkNDMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjIgSXNBcnJheShhcmd1bWVudClcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gQXJyYXkuaXNBcnJheSB8fCBmdW5jdGlvbiBpc0FycmF5KGFyZykge1xuICByZXR1cm4gY29mKGFyZykgPT0gJ0FycmF5Jztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDk4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///98\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(12);\nvar gOPN = __webpack_require__(61).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qcz80NmI3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbGxiYWNrIGZvciBJRTExIGJ1Z2d5IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzIHdpdGggaWZyYW1lIGFuZCB3aW5kb3dcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgZ09QTiA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BuJykuZjtcbnZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG52YXIgd2luZG93TmFtZXMgPSB0eXBlb2Ygd2luZG93ID09ICdvYmplY3QnICYmIHdpbmRvdyAmJiBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lc1xuICA/IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHdpbmRvdykgOiBbXTtcblxudmFyIGdldFdpbmRvd05hbWVzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGdPUE4oaXQpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHdpbmRvd05hbWVzLnNsaWNlKCk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzLmYgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKGl0KSB7XG4gIHJldHVybiB3aW5kb3dOYW1lcyAmJiB0b1N0cmluZy5jYWxsKGl0KSA9PSAnW29iamVjdCBXaW5kb3ddJyA/IGdldFdpbmRvd05hbWVzKGl0KSA6IGdPUE4odG9JT2JqZWN0KGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gOTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///99\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(40)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanM/Mzk4OSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL193a3MtZGVmaW5lJykoJ2FzeW5jSXRlcmF0b3InKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDEwMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///100\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(40)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZS5qcz80MTY3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKSgnb2JzZXJ2YWJsZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5vYnNlcnZhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///101\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(103);\nmodule.exports = __webpack_require__(0).Object.getPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LXByb3RvdHlwZS1vZi5qcz83ZDJlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3QuZ2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2dldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDEwMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///102\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(33);\nvar $getPrototypeOf = __webpack_require__(63);\n\n__webpack_require__(50)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qcz8yYTFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi45IE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdwbycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldFByb3RvdHlwZU9mJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gZnVuY3Rpb24gZ2V0UHJvdG90eXBlT2YoaXQpIHtcbiAgICByZXR1cm4gJGdldFByb3RvdHlwZU9mKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gMTAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///103\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(105), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz85MjIwIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZlwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gMTA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///104\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(106);\nmodule.exports = __webpack_require__(0).Object.setPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz84YmYwIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5zZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Quc2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L3NldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDEwNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///105\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(5);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(107).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qcz83YjE4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMy4xOSBPYmplY3Quc2V0UHJvdG90eXBlT2YoTywgcHJvdG8pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IHNldFByb3RvdHlwZU9mOiByZXF1aXJlKCcuL19zZXQtcHJvdG8nKS5zZXQgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDEwNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///106\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(9);\nvar anObject = __webpack_require__(6);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(16)(Function.call, __webpack_require__(51).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtcHJvdG8uanM/NjVhNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBXb3JrcyB3aXRoIF9fcHJvdG9fXyBvbmx5LiBPbGQgdjggY2FuJ3Qgd29yayB3aXRoIG51bGwgcHJvdG8gb2JqZWN0cy5cbi8qIGVzbGludC1kaXNhYmxlIG5vLXByb3RvICovXG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGNoZWNrID0gZnVuY3Rpb24gKE8sIHByb3RvKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBpZiAoIWlzT2JqZWN0KHByb3RvKSAmJiBwcm90byAhPT0gbnVsbCkgdGhyb3cgVHlwZUVycm9yKHByb3RvICsgXCI6IGNhbid0IHNldCBhcyBwcm90b3R5cGUhXCIpO1xufTtcbm1vZHVsZS5leHBvcnRzID0ge1xuICBzZXQ6IE9iamVjdC5zZXRQcm90b3R5cGVPZiB8fCAoJ19fcHJvdG9fXycgaW4ge30gPyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lXG4gICAgZnVuY3Rpb24gKHRlc3QsIGJ1Z2d5LCBzZXQpIHtcbiAgICAgIHRyeSB7XG4gICAgICAgIHNldCA9IHJlcXVpcmUoJy4vX2N0eCcpKEZ1bmN0aW9uLmNhbGwsIHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJykuZihPYmplY3QucHJvdG90eXBlLCAnX19wcm90b19fJykuc2V0LCAyKTtcbiAgICAgICAgc2V0KHRlc3QsIFtdKTtcbiAgICAgICAgYnVnZ3kgPSAhKHRlc3QgaW5zdGFuY2VvZiBBcnJheSk7XG4gICAgICB9IGNhdGNoIChlKSB7IGJ1Z2d5ID0gdHJ1ZTsgfVxuICAgICAgcmV0dXJuIGZ1bmN0aW9uIHNldFByb3RvdHlwZU9mKE8sIHByb3RvKSB7XG4gICAgICAgIGNoZWNrKE8sIHByb3RvKTtcbiAgICAgICAgaWYgKGJ1Z2d5KSBPLl9fcHJvdG9fXyA9IHByb3RvO1xuICAgICAgICBlbHNlIHNldChPLCBwcm90byk7XG4gICAgICAgIHJldHVybiBPO1xuICAgICAgfTtcbiAgICB9KHt9LCBmYWxzZSkgOiB1bmRlZmluZWQpLFxuICBjaGVjazogY2hlY2tcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXByb3RvLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///107\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(109), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvY3JlYXRlLmpzPzNhZjQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGVcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2NyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTA4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///108\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(110);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvY3JlYXRlLmpzP2EwY2UiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZScpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBjcmVhdGUoUCwgRCkge1xuICByZXR1cm4gJE9iamVjdC5jcmVhdGUoUCwgRCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDEwOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///109\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(41) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuY3JlYXRlLmpzP2IwNWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4yIC8gMTUuMi4zLjUgT2JqZWN0LmNyZWF0ZShPIFssIFByb3BlcnRpZXNdKVxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IGNyZWF0ZTogcmVxdWlyZSgnLi9fb2JqZWN0LWNyZWF0ZScpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDExMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///110\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9qc29uL3N0cmluZ2lmeS5qcz9hYTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpO1xudmFyICRKU09OID0gY29yZS5KU09OIHx8IChjb3JlLkpTT04gPSB7IHN0cmluZ2lmeTogSlNPTi5zdHJpbmdpZnkgfSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHN0cmluZ2lmeShpdCkgeyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gIHJldHVybiAkSlNPTi5zdHJpbmdpZnkuYXBwbHkoJEpTT04sIGFyZ3VtZW50cyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSAxMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///111\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(113);\nmodule.exports = __webpack_require__(0).Object.keys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qcz84YzU2Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Qua2V5cztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///112\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(33);\nvar $keys = __webpack_require__(19);\n\n__webpack_require__(50)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qcz8wOWRjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCBPYmplY3Qua2V5cyhPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2tleXMnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBrZXlzKGl0KSB7XG4gICAgcmV0dXJuICRrZXlzKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///113\n")},,,function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _getPrototypeOf = __webpack_require__(26);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _getOwnPropertyDescriptor = __webpack_require__(119);\n\nvar _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = (0, _getOwnPropertyDescriptor2.default)(object, property);\n\n if (desc === undefined) {\n var parent = (0, _getPrototypeOf2.default)(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9nZXQuanM/Yzg0YiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF9nZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoXCIuLi9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpO1xuXG52YXIgX2dldFByb3RvdHlwZU9mMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2dldFByb3RvdHlwZU9mKTtcblxudmFyIF9nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yXCIpO1xuXG52YXIgX2dldE93blByb3BlcnR5RGVzY3JpcHRvcjIgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF9nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG5leHBvcnRzLmRlZmF1bHQgPSBmdW5jdGlvbiBnZXQob2JqZWN0LCBwcm9wZXJ0eSwgcmVjZWl2ZXIpIHtcbiAgaWYgKG9iamVjdCA9PT0gbnVsbCk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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///116\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Operators = function () {\n function Operators() {\n (0, _classCallCheck3.default)(this, Operators);\n }\n\n (0, _createClass3.default)(Operators, [{\n key: 'and',\n value: function and(params) {\n return params[0] && params[1];\n }\n }, {\n key: 'between',\n value: function between(params) {\n var start = parseInt(params[0][0]);\n var end = parseInt(params[0][1]);\n var now = params[1];\n\n if (end < start) {\n now = now < start ? now += 2400 : now;\n end += 2400;\n }\n\n return now > start && now < end;\n }\n }, {\n key: 'equals',\n value: function equals(params) {\n return String(params[0]) === '*' || String(params[0]) === String(params[1]);\n }\n }, {\n key: 'greaterThan',\n value: function greaterThan(params) {\n return params[1] > params[0];\n }\n }, {\n key: 'in',\n value: function _in(params) {\n return params[0].indexOf(params[1]) > -1;\n }\n }, {\n key: 'lessThan',\n value: function lessThan(params) {\n return params[1] < params[0];\n }\n }, {\n key: 'not',\n value: function not(params) {\n return !params[0];\n }\n }, {\n key: 'or',\n value: function or(params) {\n return params[0] || params[1];\n }\n }]);\n return Operators;\n}();\n\nexports.default = Operators;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvT3B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F1bHQgT3BlcmF0b3JzO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvT3BlcmF0b3JzLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7Ozs7Ozs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///117\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(117);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a condition and evaluate its applicability.\n*/\nvar Condition = function () {\n\n /**\n * Creates a new Condition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function Condition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, Condition);\n\n this.attribute = attribute;\n this.operator = operator;\n this.params = params;\n this.operators = new _Operators2.default();\n }\n\n /**\n * Verifies if the condition is applicable to the message. First, the system value that corresponds to the attribute is retrieved; then, that value is compared with the parameter specified in the condition by executing the operator implementation. If the operator is 'in' and the name of a group is given, then the array holding the members of the group is retrieved before the comparison.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(Condition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n context[this.attribute] = { message: message };\n var value = context[this.attribute];\n var tempParam = void 0;\n\n if (this.operator === 'in') {\n if (!Array.isArray(this.params)) {\n tempParam = context.getGroup(this.params, message.to);\n return this.operators[this.operator]([tempParam, value]);\n }\n }\n\n return this.operators[this.operator]([this.params, value]);\n }\n }]);\n return Condition;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = Condition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9Db25kaXRpb24uanM/MmUzMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4q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BGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvY29uZGl0aW9ucy9Db25kaXRpb24uanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBdUJBO0FBQ0E7Ozs7O0FBQ0E7Ozs7QUFJQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBL0RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQW1FQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///118\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(120), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzJiYTEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2dldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gMTE5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///119\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(121);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n return $Object.getOwnPropertyDescriptor(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzcyNzkiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvcicpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSkge1xuICByZXR1cm4gJE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDEyMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///120\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(12);\nvar $getOwnPropertyDescriptor = __webpack_require__(51).f;\n\n__webpack_require__(50)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzg4ODkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjYgT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihPLCBQKVxudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciAkZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKS5mO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldE93blByb3BlcnR5RGVzY3JpcHRvcicsIGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcihpdCwga2V5KSB7XG4gICAgcmV0dXJuICRnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodG9JT2JqZWN0KGl0KSwga2V5KTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDEyMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///121\n")},,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(18);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(38);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ActionsService = __webpack_require__(141);\n\nvar _ActionsService2 = _interopRequireDefault(_ActionsService);\n\nvar _PDP = __webpack_require__(142);\n\nvar _PDP2 = _interopRequireDefault(_PDP);\n\nvar _Policy = __webpack_require__(143);\n\nvar _Policy2 = _interopRequireDefault(_Policy);\n\nvar _utils = __webpack_require__(36);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('PEP'); // Log System\n\nvar PEP = function () {\n\n /**\n * Creates a Policy Enforcement Point (PEP) instance\n * @param {Object} context\n */\n function PEP(context) {\n (0, _classCallCheck3.default)(this, PEP);\n\n var _this = this;\n\n _this.pdp = new _PDP2.default(context);\n _this.actionsService = new _ActionsService2.default(context);\n _this.context = context;\n context.pep = _this;\n\n //TODO should be added a trigger to verify when the loadConfigurations is successfully completed\n context.loadConfigurations();\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n\n (0, _createClass3.default)(PEP, [{\n key: 'addGUIListeners',\n value: function addGUIListeners() {\n var _this = this;\n\n _this.context.messageBus.addListener(_this.context.pepURL, function (msg) {\n var funcName = msg.body.method;\n\n var returnedValue = void 0;\n if (funcName === 'addToGroup') {\n var groupName = msg.body.params.groupName;\n var userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.addToGroup(groupName, userEmail);\n } else if (funcName === 'createGroup') {\n var _groupName = msg.body.params.groupName;\n returnedValue = _this.context.createGroup(_groupName);\n } else if (funcName === 'addPolicy') {\n var source = msg.body.params.source;\n var key = msg.body.params.key;\n var policy = msg.body.params.policy;\n var combiningAlgorithm = msg.body.params.combiningAlgorithm;\n returnedValue = _this.addPolicy(source, key, policy, combiningAlgorithm);\n } else if (funcName === 'deleteGroup') {\n var _groupName2 = msg.body.params.groupName;\n returnedValue = _this.context.deleteGroup(_groupName2);\n } else if (funcName === 'removePolicy') {\n var _source = msg.body.params.source;\n var _key = msg.body.params.key;\n returnedValue = _this.removePolicy(_source, _key);\n } else if (funcName === 'savePolicies') {\n var _source2 = msg.body.params.source;\n returnedValue = _this.context.savePolicies(_source2);\n } else if (funcName === 'userPolicies') {\n returnedValue = _this.context.userPolicies;\n } else if (funcName === 'activeUserPolicy') {\n var userPolicy = msg.body.params.userPolicy;\n if (userPolicy) {\n _this.context.activeUserPolicy = userPolicy;\n }\n returnedValue = _this.context.activeUserPolicy;\n } else if (funcName === 'userPolicy') {\n var _key2 = msg.body.params.key;\n returnedValue = _this.context.userPolicies[_key2];\n } else if (funcName === 'saveActivePolicy') {\n returnedValue = _this.context.saveActivePolicy();\n } else if (funcName === 'getMyEmails') {\n returnedValue = _this.context.getMyEmails();\n } else if (funcName === 'getMyHyperties') {\n returnedValue = _this.context.getMyHyperties();\n } else if (funcName === 'groups') {\n returnedValue = _this.context.groups;\n } else if (funcName === 'getGroupsNames') {\n returnedValue = _this.context.getGroupsNames();\n }if (funcName === 'removeFromGroup') {\n var _groupName3 = msg.body.params.groupName;\n var _userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.removeFromGroup(_groupName3, _userEmail);\n }\n\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n _this.context.messageBus.postMessage(replyMsg);\n });\n }\n\n /**\n * Adds a policy to the Policy Enforcement Point (PEP). The policy can be created by the service\n * provider or by the user.\n * @param {String} source\n * @param {String} key\n * @param {Object} policy\n */\n\n }, {\n key: 'addPolicy',\n value: function addPolicy(source, key, policy, combiningAlgorithm) {\n if (!source) throw new Error('source is not defined');\n if (!key) throw new Error('key is not defined');\n\n if (policy === undefined) {\n policy = new _Policy2.default(key, [], [], combiningAlgorithm);\n } else {\n if (!(policy instanceof _Policy2.default)) {\n policy = new _Policy2.default(policy.key, policy.rules, policy.actions, policy.combiningAlgorithm);\n }\n }\n\n switch (source) {\n case 'SERVICE_PROVIDER':\n this.context.savePolicies(source, policy, key);\n break;\n case 'USER':\n this.context.userPolicies[key] = policy;\n this.context.savePolicies(source);\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'authorise',\n value: function authorise(message, isIncoming) {\n var _this2 = this;\n\n // log.log('[Policy.PEP Authorise] ', message);\n // log.log(message);\n if (!message) throw new Error('message is not defined');\n if (!message.from) throw new Error('message.from is not defined');\n if (!message.to) throw new Error('message.to is not defined');\n if (!message.type) throw new Error('message.type is not defined');\n message.body = message.body || {};\n\n return new _promise2.default(function (resolve, reject) {\n\n message.body = message.body || {};\n var _this = _this2;\n\n var result = _this.pdp.evaluatePolicies(message, isIncoming);\n if (result === 'Not Applicable') {\n result = _this.context.defaultBehaviour;\n message.body.auth = false;\n }\n _this.actionsService.enforcePolicies(message, isIncoming).then(function (messages) {\n for (var i in messages) {\n message = messages[i];\n if (result) {\n message.body.auth = message.body.auth === undefined ? true : message.body.auth;\n resolve(message);\n } else {\n var errorMessage = { body: { code: 403, description: 'Blocked by policy' }, from: message.to, to: message.from, type: 'response' };\n reject(errorMessage);\n }\n }\n }, function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: 'authoriseSync',\n value: function authoriseSync(message) {\n var result = void 0;\n message.body = message.body || {};\n result = this.pdp.evaluatePolicies(message, true);\n if (result === 'Not Applicable') {\n result = this.context.defaultBehaviour;\n }\n return result;\n }\n }, {\n key: 'removePolicy',\n value: function removePolicy(source, key) {\n if (!source) throw new Error('source is not defined');\n if (source !== '*' && !key) throw new Error('key is not defined');\n\n switch (source) {\n case '*':\n this.context.serviceProviderPolicy = {};\n this.context.userPolicies = {};\n this.context.activeUserPolicy = undefined;\n this.context.savePolicies('USER');\n this.context.savePolicies('SERVICE_PROVIDER');\n this.context.saveActivePolicy();\n break;\n case 'SERVICE_PROVIDER':\n delete this.context.serviceProviderPolicy[key];\n this.context.savePolicies();\n break;\n case 'USER':\n delete this.context.userPolicies[key];\n if (key === this.context.activeUserPolicy) {\n this.context.activeUserPolicy = undefined;\n this.context.saveActivePolicy();\n }\n this.context.savePolicies('USER');\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this.context.messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this.context.messageBus = messageBus;\n _this.addGUIListeners();\n }\n }]);\n return PEP;\n}();\n\nexports.default = PEP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9w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mIChyZXN1bHQgPT09ICdOb3QgQXBwbGljYWJsZScpIHtcbiAgICAgIHJlc3VsdCA9IHRoaXMuY29udGV4dC5kZWZhdWx0QmVoYXZpb3VyO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0O1xuXG4gIH1cblxuICByZW1vdmVQb2xpY3koc291cmNlLCBrZXkpIHtcbiAgICBpZiAoIXNvdXJjZSkgdGhyb3cgbmV3IEVycm9yKCdzb3VyY2UgaXMgbm90IGRlZmluZWQnKTtcbiAgICBpZiAoc291cmNlICE9PSAnKicgJiYgIWtleSkgdGhyb3cgbmV3IEVycm9yKCdrZXkgaXMgbm90IGRlZmluZWQnKTtcblxuICAgIHN3aXRjaCAoc291cmNlKSB7XG4gICAgICBjYXNlICcqJzpcbiAgICAgICAgdGhpcy5jb250ZXh0LnNlcnZpY2VQcm92aWRlclBvbGljeSA9IHt9O1xuICAgICAgICB0aGlzLmNvbnRleHQudXNlclBvbGljaWVzID0ge307XG4gICAgICAgIHRoaXMuY29udGV4dC5hY3RpdmVVc2VyUG9saWN5ID0gdW5kZWZpbmVkO1xuICAgICAgICB0aGlzLmNvbnRleHQuc2F2ZVBvbGljaWVzKCdVU0VSJyk7XG4gICAgICAgIHRoaXMuY29udGV4dC5zYXZlUG9saWNpZXMoJ1NFUlZJQ0VfUFJPVklERVInKTtcbiAgICAgICAgdGhpcy5jb250ZXh0LnNhdmVBY3RpdmVQb2xpY3koKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdTRVJWSUNFX1BST1ZJREVSJzpcbiAgICAgICAgZGVsZXRlIHRoaXMuY29udGV4dC5zZXJ2aWNlUHJvdmlkZXJQb2xpY3lba2V5XTtcbiAgICAgICAgdGhpcy5jb250ZXh0LnNhdmVQb2xpY2llcygpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ1VTRVInOlxuICAgICAgICBkZWxldGUgdGhpcy5jb250ZXh0LnVzZXJQb2xpY2llc1trZXldO1xuICAgICAgICBpZi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\n//# sourceURL=webpack-internal:///140\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(18);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ActionsService = function () {\n function ActionsService(context) {\n (0, _classCallCheck3.default)(this, ActionsService);\n\n this.context = context;\n }\n\n (0, _createClass3.default)(ActionsService, [{\n key: 'enforcePolicies',\n value: function enforcePolicies(message, isIncomingMessage) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n var policies = _this.context.getPolicies(message, isIncomingMessage);\n\n if (policies !== undefined) {\n if (policies.serviceProviderPolicy !== undefined) {\n policies.serviceProviderPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n if (policies.userPolicy !== undefined) {\n policies.userPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n }\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'forwardToID',\n value: function forwardToID(message, email) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve, reject) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n _this.context.runtimeRegistry.discoverHypertyPerUser(email).then(function (result) {\n message.to = result.hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'forwardToHyperty',\n value: function forwardToHyperty(message, hypertyURL) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n message.to = hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'sendAutomaticMessage',\n value: function sendAutomaticMessage(message, text) {\n var _this = this;\n return new _promise2.default(function (resolve) {\n var automaticMessage = {\n from: message.to,\n to: message.from,\n body: {\n value: text\n },\n type: message.type\n };\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(automaticMessage);\n });\n }\n }]);\n return ActionsService;\n}();\n\nexports.default = ActionsService;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvQWN0aW9uc1NlcnZpY2UuanM/MjliZCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBBY3Rpb25zU2VydmljZSB7XG5cbiAgY29uc3RydWN0b3IoY29udGV4dCkge1xuICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gIH1cblxuICBlbmZvcmNlUG9saWNpZXMobWVzc2FnZSwgaXNJbmNvbWluZ01lc3NhZ2UpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgIGxldCBwb2xpY2llcyA9IF90aGlzLmNvbnRleHQuZ2V0UG9saWNpZXMobWVzc2FnZSwgaXNJbmNvbWluZ01lc3NhZ2UpO1xuXG4gICAgICBpZiAocG9saWNpZXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAocG9saWNpZXMuc2VydmljZVByb3ZpZGVyUG9saWN5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBwb2xpY2llcy5zZXJ2aWNlUHJvdmlkZXJQb2xpY3kuZW5mb3JjZUFjdGlvbnMoX3RoaXMuY29udGV4dCwgbWVzc2FnZSkudGhlbihtZXNzYWdlcyA9PiB7XG4gICAgICAgICAgICByZXNvbHZlKG1lc3NhZ2VzKTtcbiAgICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHBvbGljaWVzLnVzZXJQb2xpY3kgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICAgICAgcG9saWNpZXMudXNlclBvbGljeS5lbmZvcmNlQWN0aW9ucyhfdGhpcy5jb250ZXh0LCBtZXNzYWdlKS50aGVuKG1lc3NhZ2VzID0+IHtcbiAgICAgICAgICAgICAgcmVzb2x2ZShtZXNzYWdlcyk7XG4gICAgICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXNvbHZlKFttZXNzYWdlXSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXNvbHZlKFttZXNzYWdlXSk7XG4gICAgICB9XG4gICAgfSk7XG4gIH1cblxuICBmb3J3YXJkVG9JRChtZXNzYWdlLCBlbWFpbCkge1xuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgaWYgKCFfdGhpcy5jb250ZXh0LnJ1bnRpbWVSZWdpc3RyeSkgdGhyb3cgbmV3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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBR0E7QUFOQTtBQVFBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///141\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(117);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* The Policy Decision Point (PDP) decides if a message is to be authorised by checking a set of\n* policies. The resource to be verified is specified in the first word of the 'condition' field of\n* a Policy object. The implementation that verifies if the message is compliant with a policy is\n* specified in a hashtable to allow dynamic definition of the implementation, providing\n* extensibility to the Policy Engine functionalities.\n*/\nvar PDP = function () {\n function PDP(context) {\n (0, _classCallCheck3.default)(this, PDP);\n\n this.context = context;\n this.operators = new _Operators2.default();\n }\n\n (0, _createClass3.default)(PDP, [{\n key: 'evaluatePolicies',\n value: function evaluatePolicies(message, isIncomingMessage) {\n var policies = this.context.getPolicies(message, isIncomingMessage);\n var result = 'Not Applicable';\n if (policies !== undefined) {\n result = this.evaluatePolicy(message, policies.serviceProviderPolicy, isIncomingMessage);\n if (result || result === 'Not Applicable') {\n var userResult = this.evaluatePolicy(message, policies.userPolicy, isIncomingMessage);\n if (userResult !== 'Not Applicable') {\n result = userResult;\n }\n }\n }\n\n return result;\n }\n }, {\n key: 'evaluatePolicy',\n value: function evaluatePolicy(message, policy, isIncoming) {\n var result = 'Not Applicable';\n if (policy) {\n result = policy.evaluateRules(this.context, message, isIncoming);\n }\n\n return result;\n }\n }]);\n return PDP;\n}();\n\nexports.default = PDP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUERQLmpzP2U5YmEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuL09wZXJhdG9ycyc7XG5cbi8qKlxuKiBUaGUgUG9saWN5IERlY2lzaW9uIFBvaW50IChQRFApIGRlY2lkZXMgaWYgYSBtZXNzYWdlIGlzIHRvIGJlIGF1dGhvcmlzZWQgYnkgY2hlY2tpbmcgYSBzZXQgb2ZcbiogcG9saWNpZXMuIFRoZSByZXNvdXJjZSB0byBiZSB2ZXJpZmllZCBpcyBzcGVjaWZpZWQgaW4gdGhlIGZpcnN0IHdvcmQgb2YgdGhlICdjb25kaXRpb24nIGZpZWxkIG9mXG4qIGEgUG9saWN5IG9iamVjdC4gVGhlIGltcGxlbWVudGF0aW9uIHRoYXQgdmVyaWZpZXMgaWYgdGhlIG1lc3NhZ2UgaXMgY29tcGxpYW50IHdpdGggYSBwb2xpY3kgaXNcbiogc3BlY2lmaWVkIGluIGEgaGFzaHRhYmxlIHRvIGFsbG93IGR5bmFtaWMgZGVmaW5pdGlvbiBvZiB0aGUgaW1wbGVtZW50YXRpb24sIHByb3ZpZGluZ1xuKiBleHRlbnNpYmlsaXR5IHRvIHRoZSBQb2xpY3kgRW5naW5lIGZ1bmN0aW9uYWxpdGllcy5cbiovXG5jbGFzcyBQRFAge1xuXG4gIGNvbnN0cnVjdG9yKGNvbnRleHQpIHtcbiAgICB0aGlzLmNvbnRleHQgPSBjb250ZXh0O1xuICAgIHRoaXMub3BlcmF0b3JzID0gbmV3IE9wZXJhdG9ycygpO1xuICB9XG5cbiAgZXZhbHVhdGVQb2xpY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Yy9wb2xpY3kvUERQLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7Ozs7O0FBQ0E7Ozs7Ozs7QUFPQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///142\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(18);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AllowOverrides = __webpack_require__(144);\n\nvar _AllowOverrides2 = _interopRequireDefault(_AllowOverrides);\n\nvar _BlockOverrides = __webpack_require__(145);\n\nvar _BlockOverrides2 = _interopRequireDefault(_BlockOverrides);\n\nvar _FirstApplicable = __webpack_require__(146);\n\nvar _FirstApplicable2 = _interopRequireDefault(_FirstApplicable);\n\nvar _Rule = __webpack_require__(147);\n\nvar _Rule2 = _interopRequireDefault(_Rule);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Policy = function () {\n function Policy(key, rules, actions, combiningAlgorithm) {\n (0, _classCallCheck3.default)(this, Policy);\n\n if (!key) throw new Error('key is not defined');\n if (!actions) throw new Error('actions are not defined');\n\n this.actions = actions;\n this.key = key;\n this._setRules(rules);\n this._setCombiningAlgorithm(combiningAlgorithm);\n }\n\n (0, _createClass3.default)(Policy, [{\n key: 'addAction',\n value: function addAction(method, param) {\n this.actions.push({ method: method, param: param });\n }\n }, {\n key: 'createRule',\n value: function createRule(decision, condition, scope, target, priority) {\n if (priority === undefined) {\n priority = this.getLastPriority() + 1;\n }\n var rule = new _Rule2.default(decision, condition, scope, target, priority);\n this.rules.push(rule);\n }\n }, {\n key: 'deleteRule',\n value: function deleteRule(rule) {\n var indexToRemove = this.rules.indexOf(rule);\n this.rules.splice(indexToRemove, 1);\n }\n }, {\n key: 'enforceActions',\n value: function enforceActions(context, message) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var results = [];\n if (_this.actions.length !== 0) {\n for (var i in _this.actions) {\n var result = context.pep.actionsService[_this.actions[i].method](message, _this.actions[i].param);\n results.push(result);\n }\n _promise2.default.all(results).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'evaluateRules',\n value: function evaluateRules(context, message, isIncoming) {\n var results = [];\n for (var i in this.rules) {\n results.push(this.rules[i].evaluate(context, message, isIncoming));\n }\n\n return this.combiningAlgorithm.combine(results);\n }\n }, {\n key: 'getLastPriority',\n value: function getLastPriority() {\n var priorities = [];\n\n if (this.rules.length !== 0) {\n for (var i in this.rules) {\n priorities.push(this.rules[i].priority);\n }\n return Math.max.apply(Math, priorities);\n } else {\n return -1;\n }\n }\n }, {\n key: 'getRuleByPriority',\n value: function getRuleByPriority(priority) {\n for (var i in this.rules) {\n if (String(this.rules[i].priority) === String(priority)) {\n return this.rules[i];\n }\n }\n throw Error('Rule with priority ' + priority + ' does not exist!');\n }\n }, {\n key: '_setCombiningAlgorithm',\n value: function _setCombiningAlgorithm(combiningAlgorithm) {\n if (!combiningAlgorithm) {\n combiningAlgorithm = 'blockOverrides';\n }\n switch (combiningAlgorithm) {\n case 'blockOverrides':\n this.combiningAlgorithm = new _BlockOverrides2.default();\n break;\n case 'allowOverrides':\n this.combiningAlgorithm = new _AllowOverrides2.default();\n break;\n case 'firstApplicable':\n this.combiningAlgorithm = new _FirstApplicable2.default();\n break;\n default:\n throw Error('Unknown algorithm: ' + combiningAlgorithm);\n }\n }\n }, {\n key: '_setRules',\n value: function _setRules(rules) {\n this.rules = [];\n\n for (var i in rules) {\n var rule = rules[i];\n if (rule.priority === undefined) {\n rule.priority = this.getLastPriority() + 1;\n }\n if (!(rule instanceof _Rule2.default)) {\n rule = new _Rule2.default(rule.decision, rule.condition, rule.scope, rule.target, rule.priority);\n }\n this.rules.push(rule);\n }\n }\n }, {\n key: 'sortRules',\n value: function sortRules() {\n return this.rules.sort(function (a, b) {\n var x = a.priority;var y = b.priority;\n return x < y ? -1 : x > y ? 1 : 0;\n });\n }\n }]);\n return Policy;\n}();\n\nexports.default = Policy;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUG9saWN5LmpzPzk4NDMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEFsbG93T3ZlcnJpZGVzIGZyb20gJy4vY29tYmluaW5nQWxnb3JpdGhtcy9BbGxvd092ZXJyaWRlcyc7XG5pbXBvcnQgQmxvY2tPdmVycmlkZXMgZnJvbSAnLi9jb21iaW5pbmdBbGdvcml0aG1zL0Jsb2NrT3ZlcnJpZGVzJztcbmltcG9ydCBGaXJzdEFwcGxpY2FibGUgZnJvbSAnLi9jb21iaW5pbmdBbGdvcml0aG1zL0ZpcnN0QXBwbGljYWJsZSc7XG5pbXBvcnQgUnVsZSBmcm9tICcuL1J1bGUnO1xuXG5jbGFzcyBQb2xpY3kge1xuXG4gIGNvbnN0cnVjdG9yKGtleSwgcnVsZXMsIGFjdGlvbnMsIGNvbWJpbmluZ0FsZ29yaXRobSkge1xuICAgIGlmICgha2V5KSB0a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ar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar AllowOverrides = function () {\n function AllowOverrides() {\n (0, _classCallCheck3.default)(this, AllowOverrides);\n }\n\n (0, _createClass3.default)(AllowOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorization decisions, prioritizes a positive one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return AllowOverrides;\n}();\n\nexports.default = AllowOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ0LmpzIiwic291cmNlcyI6WyJ3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cztcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcG9saWN5L2NvbWJpbmluZ0FsZ29yaXRobXMvQWxsb3dPdmVycmlkZXMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///144\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar BlockOverrides = function () {\n function BlockOverrides() {\n (0, _classCallCheck3.default)(this, BlockOverrides);\n }\n\n (0, _createClass3.default)(BlockOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, prioritises a negative one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return BlockOverrides;\n}();\n\nexports.default = BlockOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9CbG9ja092ZXJyaWRlcy5qcz82MWM3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1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Y2lzaW9ucywgcHJpb3JpdGlzZXMgYSBuZWdhdGl2ZSBvbmUuXG4gICogQHBhcmFtICAgIHtib29sZWFuW119ICAgZGVjaXNpb25zXG4gICogQHJldHVybnMgIHtib29sZWFufVxuICAqL1xuICBjb21iaW5lKGRlY2lzaW9ucykge1xuICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZihmYWxzZSkgIT09IC0xKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZih0cnVlKSAhPT0gLTEpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gJ05vdCBBcHBsaWNhYmxlJztcbiAgICAgIH1cbiAgICB9XG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBCbG9ja092ZXJyaWRlcztcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcG9saWN5L2NvbWJpbmluZ0FsZ29yaXRobXMvQmxvY2tPdmVycmlkZXMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///145\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar FirstApplicable = function () {\n function FirstApplicable() {\n (0, _classCallCheck3.default)(this, FirstApplicable);\n }\n\n (0, _createClass3.default)(FirstApplicable, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, returns the first one different from 'Not Applicable', either positive or negative.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n for (var i in decisions) {\n if (decisions[i] !== 'Not Applicable') {\n return decisions[i];\n }\n }\n return 'Not Applicable';\n }\n }]);\n return FirstApplicable;\n}();\n\nexports.default = FirstApplicable;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9GaXJzdEFwcGxpY2FibGUuanM/MzNkZSJdLCJzb3VyY2VzQ29udG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GxpY2FibGUuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///146\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AdvancedCondition = __webpack_require__(148);\n\nvar _AdvancedCondition2 = _interopRequireDefault(_AdvancedCondition);\n\nvar _Condition = __webpack_require__(118);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _utils = __webpack_require__(36);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Rule = function () {\n function Rule(decision, condition, scope, target, priority) {\n (0, _classCallCheck3.default)(this, Rule);\n\n this.decision = decision;\n this.setCondition(condition);\n this.priority = priority;\n this.scope = scope;\n this.target = target;\n }\n\n (0, _createClass3.default)(Rule, [{\n key: 'setCondition',\n value: function setCondition(condition) {\n if (!(condition instanceof _Condition2.default || condition instanceof _AdvancedCondition2.default || condition instanceof _AdvancedCondition2.default)) {\n var attribute = condition.attribute;\n switch (attribute) {\n case 'subscription':\n this.condition = new _AdvancedCondition2.default(condition.attribute, condition.operator, condition.params);\n break;\n case undefined:\n this.condition = new _AdvancedCondition2.default(condition);\n break;\n default:\n this.condition = new _Condition2.default(condition.attribute, condition.operator, condition.params);\n }\n } else {\n this.condition = condition;\n }\n }\n }, {\n key: 'evaluate',\n value: function evaluate(context, message, isIncoming) {\n var field = isIncoming ? message.to : message.from;\n var hypertyName = void 0;\n switch (this.scope) {\n case 'global':\n break;\n\n case 'hyperty':\n if ((0, _utils.isDataObjectURL)(field)) {\n var reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n if (reporter !== undefined) {\n hypertyName = context.runtimeRegistry.getHypertyName(reporter);\n }\n } else {\n if (field.split('://')[0] === 'hyperty') {\n hypertyName = context.runtimeRegistry.getHypertyName((0, _utils.removePathFromURL)(field));\n }\n }\n if (hypertyName === this.target) {\n break;\n }\n\n return 'Not Applicable';\n\n case 'identity':\n var owner = void 0;\n\n if ((0, _utils.isDataObjectURL)(field)) {\n var _reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n owner = context.runtimeRegistry.getHypertyOwner(_reporter);\n } else {\n if (field.split('://')[0] === 'hyperty') {\n owner = context.runtimeRegistry.getHypertyOwner((0, _utils.removePathFromURL)(field));\n }\n }\n if (owner !== undefined) {\n owner = (0, _utils.getUserEmailFromURL)(owner);\n }\n if (owner === this.target) {\n break;\n }\n\n return 'Not Applicable';\n }\n\n if (this.condition.isApplicable(context, message, this.scope, this.target)) {\n return this.decision;\n } else {\n return 'Not Applicable';\n }\n }\n }]);\n return Rule;\n}();\n\nexports.default = Rule;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUnVsZS5qcz9jOWU4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBBZHZhbmNlZENvbmRpdGlvbiBmcm9tICcuL2NvbmRpdGlvbnMvQWR2YW5jZWRDb25kaXRpb24nO1xuaW1wb3J0IENvbmRpdGlvbiBmcm9tICcuL2NvbmRpdGlvbnMvQ29uZGl0aW9uJztcbmltcG9ydCB7Z2V0V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mFtZSA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldEh5cGVydHlOYW1lKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChoeXBlcnR5TmFtZSA9PT0gdGhpcy50YXJnZXQpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAnTm90IEFwcGxpY2FibGUnO1xuXG4gICAgICBjYXNlICdpZGVudGl0eSc6XG4gICAgICAgIGxldCBvd25lcjtcblxuICAgICAgICBpZiAoaXNEYXRhT2JqZWN0VVJMKGZpZWxkKSkge1xuICAgICAgICAgIGxldCByZXBvcnRlciA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldFJlcG9ydGVyVVJMU3luY2hvbm91cyhyZW1vdmVQYXRoRnJvbVVSTChmaWVsZCkpO1xuICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlcG9ydGVyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoZmllbGQuc3BsaXQoJzovLycpWzBdID09PSAnaHlwZXJ0eScpIHtcbiAgICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvd25lciAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgb3duZXIgPSBnZXRVc2VyRW1haWxGcm9tVVJMKG93bmVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3duZXIgPT09IHRoaXMudGFyZ2V0KSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gJ05vdCBBcHBsaWNhYmxlJztcbiAgICB9XG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ports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Condition = __webpack_require__(118);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _Operators = __webpack_require__(117);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nvar _SubscriptionCondition = __webpack_require__(149);\n\nvar _SubscriptionCondition2 = _interopRequireDefault(_SubscriptionCondition);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AdvancedCondition = function () {\n function AdvancedCondition(condition) {\n (0, _classCallCheck3.default)(this, AdvancedCondition);\n\n this.operators = new _Operators2.default();\n if (condition.operators !== undefined) {\n condition = condition.condition;\n }\n condition = this.buildCondition(condition);\n this.condition = condition;\n }\n\n (0, _createClass3.default)(AdvancedCondition, [{\n key: 'buildCondition',\n value: function buildCondition(condition) {\n if (Array.isArray(condition[1])) {\n condition[1] = this.buildCondition(condition[1]);\n } else {\n if (condition[1].attribute === 'subscription') {\n condition[1] = new _SubscriptionCondition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n } else {\n condition[1] = new _Condition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n }\n }\n\n if (condition[2] !== undefined) {\n if (Array.isArray(condition[2])) {\n condition[2] = this.buildCondition(condition[2]);\n } else {\n if (condition[2].attribute === 'subscription') {\n condition[2] = new _SubscriptionCondition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n } else {\n condition[2] = new _Condition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n }\n }\n }\n return condition;\n }\n }, {\n key: 'isApplicable',\n value: function isApplicable(context, message, scope, target, operator, left, right) {\n if (!operator) {\n operator = this.condition[0];\n left = this.condition[1];\n right = this.condition[2];\n }\n\n while (!(left instanceof _Condition2.default) & !(left instanceof _SubscriptionCondition2.default) & typeof left !== 'boolean') {\n left = this.isApplicable(context, message, scope, target, left[0], left[1], left[2]);\n }\n if (right !== undefined) {\n while (!(right instanceof _Condition2.default) & !(right instanceof _SubscriptionCondition2.default) & typeof right !== 'boolean') {\n right = this.isApplicable(context, message, scope, target, right[0], right[1], right[2]);\n }\n }\n\n var resultLeft = typeof left === 'boolean' ? left : left.isApplicable(context, message, scope, target);\n var resultRight = void 0;\n if (right !== undefined) {\n resultRight = typeof right === 'boolean' ? right : right.isApplicable(context, message, scope, target);\n }\n return this.operators[operator]([resultLeft, resultRight]);\n }\n }]);\n return AdvancedCondition;\n}();\n\nexports.default = AdvancedCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9BZHZhbmNlZENvbmRpdGlvbi5qcz9iZDBmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb25kaXRpb24gZnJvbSAnLi9Db25kaXRpb24nO1xuaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuLi9PcGVyYXRvcnMnO1xuaW1wb3J0IFN1YnNjcmlwdGlvbkNvbmRpdGlvbiBmcm9tICcuL1N1YnNjcmlwdGlvbkNvbmRpdGlvbic7XG5cbmNsYXNzIEFkdmFuY2VkQ29uZGl0aW9uIHtcblxuICBjb25zdHJ1Y3Rvcihjb25kaXRpb24pIHtcbiAgICB0aGlzLm9wZXJhdG9ycyA9IG5ldyBPcGVyYXRvcnMoKTtcbiAgICBpZiAoY29uZGl0aW9uLm9wZXJhdG9ycyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICBjb25kaXRpb24gPSBjb25kaXRpb24uY29uZGl0aW9uO1xuICAgIH1cbiAgICBjb25kaXRpb24gPSB0aGlzLm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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///148\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(26);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(34);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(116);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(35);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _Condition2 = __webpack_require__(118);\n\nvar _Condition3 = _interopRequireDefault(_Condition2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a subscription condition and evaluate its applicability.\n*/\nvar SubscriptionCondition = function (_Condition) {\n (0, _inherits3.default)(SubscriptionCondition, _Condition);\n\n /**\n * Creates a new SubscriptionCondition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function SubscriptionCondition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, SubscriptionCondition);\n return (0, _possibleConstructorReturn3.default)(this, (SubscriptionCondition.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition)).call(this, attribute, operator, params));\n }\n\n /**\n * Verifies if the subscription condition is applicable to the message. First, verifies if the message is of the subscription type; second, verifies if the message is from a remote runtime to guarantee that the subscription is being validated in the destination runtime; third, verifies if the subscription preference is met.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(SubscriptionCondition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n var isSubscription = message.type === 'subscribe';\n var isFromRemoteSM = context.isFromRemoteSM(message.from);\n if (isSubscription & isFromRemoteSM) {\n return (0, _get3.default)(SubscriptionCondition.prototype.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition.prototype), 'isApplicable', this).call(this, context, message);\n } else {\n return false;\n }\n }\n }]);\n return SubscriptionCondition;\n}(_Condition3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = SubscriptionCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3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s7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7QUFDQTs7Ozs7QUFDQTs7OztBQUlBOzs7QUFFQTs7Ozs7OztBQU9BO0FBQUE7QUFBQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQkE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBOEJBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///149\n")}])}); \ No newline at end of file +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("PEP",[],n):"object"==typeof exports?exports.PEP=n():e.PEP=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function c(t){if(n[t])return n[t].exports;var l=n[t]={i:t,l:!1,exports:{}};return e[t].call(l.exports,l,l.exports,c),l.l=!0,l.exports}return c.m=e,c.c=n,c.d=function(e,n,t){c.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},c.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(n,"a",n),n},c.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},c.p="",c(c.s=143)}([function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz8xNWUwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjUuNycgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZ2xvYmFsLmpzP2VjYWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzg2I2lzc3VlY29tbWVudC0xMTU3NTkwMjhcbnZhciBnbG9iYWwgPSBtb2R1bGUuZXhwb3J0cyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93Lk1hdGggPT0gTWF0aFxuICA/IHdpbmRvdyA6IHR5cGVvZiBzZWxmICE9ICd1bmRlZmluZWQnICYmIHNlbGYuTWF0aCA9PSBNYXRoID8gc2VsZlxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tbmV3LWZ1bmNcbiAgOiBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuaWYgKHR5cGVvZiBfX2cgPT0gJ251bWJlcicpIF9fZyA9IGdsb2JhbDsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(31)('wks');\nvar uid = __webpack_require__(22);\nvar Symbol = __webpack_require__(1).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLmpzPzc1MmMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHN0b3JlID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ3drcycpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xudmFyIFN5bWJvbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLlN5bWJvbDtcbnZhciBVU0VfU1lNQk9MID0gdHlwZW9mIFN5bWJvbCA9PSAnZnVuY3Rpb24nO1xuXG52YXIgJGV4cG9ydHMgPSBtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHJldHVybiBzdG9yZVtuYW1lXSB8fCAoc3RvcmVbbmFtZV0gPVxuICAgIFVTRV9TWU1CT0wgJiYgU3ltYm9sW25hbWVdIHx8IChVU0VfU1lNQk9MID8gU3ltYm9sIDogdWlkKSgnU3ltYm9sLicgKyBuYW1lKSk7XG59O1xuXG4kZXhwb3J0cy5zdG9yZSA9IHN0b3JlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy5qc1xuLy8gbW9kdWxlIGlkID0gMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///2\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY2xhc3NDYWxsQ2hlY2suanM/NjZiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(64);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYW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c3RhdGljUHJvcHMpIHtcbiAgICBpZiAocHJvdG9Qcm9wcykgZGVmaW5lUHJvcGVydGllcyhDb25zdHJ1Y3Rvci5wcm90b3R5cGUsIHByb3RvUHJvcHMpO1xuICAgIGlmIChzdGF0aWNQcm9wcykgZGVmaW5lUHJvcGVydGllcyhDb25zdHJ1Y3Rvciwgc3RhdGljUHJvcHMpO1xuICAgIHJldHVybiBDb25zdHJ1Y3RvcjtcbiAgfTtcbn0oKTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanNcbi8vIG1vZHVsZSBpZCA9IDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4\n')},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar ctx = __webpack_require__(17);\nvar hide = __webpack_require__(11);\nvar has = __webpack_require__(10);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzPzkwY2QiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgY3R4ID0gcmVxdWlyZ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bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYW4tb2JqZWN0LmpzP2VmYjMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoIWlzT2JqZWN0KGl0KSkgdGhyb3cgVHlwZUVycm9yKGl0ICsgJyBpcyBub3QgYW4gb2JqZWN0IScpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(13)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/Zjg0ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(6);\nvar IE8_DOM_DEFINE = __webpack_require__(43);\nvar toPrimitive = __webpack_require__(29);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwLmpzPzdhZjAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgSUU4X0RPTV9ERUZJTkUgPSByZXF1aXJlKCcuL19pZTgtZG9tLWRlZmluZScpO1xudmFyIHRvUHJpbWl0aXZlID0gcmVxdWlyZSgnLi9fdG8tcHJpbWl0aXZlJyk7XG52YXIgZFAgPSBPYmplY3QuZGVmaW5lUHJvcGVydHk7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydHkgOiBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGFuT2JqZWN0KEF0dHJpYnV0ZXMpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGRQKE8sIFAsIEF0dHJpYnV0ZXMpO1xuICB9IGNhdGNoIChlKSB7IC8qIGVtcHR5ICovIH1cbiAgaWYgKCdnZXQnIGluIEF0dHJpYnV0ZXMgfHwgJ3NldCcgaW4gQXR0cmlidXRlcykgdGhyb3cgVHlwZUVycm9yKCdBY2Nlc3NvcnMgbm90IHN1cHBvcnRlZCEnKTtcbiAgaWYgKCd2YWx1ZScgaW4gQXR0cmlidXRlcykgT1tQXSA9IEF0dHJpYnV0ZXMudmFsdWU7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///8\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzEyYTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz8wZjYyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(8);\nvar createDesc = __webpack_require__(21);\nmodule.exports = __webpack_require__(7) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ODQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(62);\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NGRjNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSAxM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///13\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(71), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3Byb21pc2UuanM/ZmZmMSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vcHJvbWlzZVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9wcm9taXNlLmpzXG4vLyBtb2R1bGUgaWQgPSAxNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n')},function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gMTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(20);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDE3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///17\n")},function(module,exports){eval("module.exports = {};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXJhdG9ycy5qcz9mZGI0Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0ge307XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlcmF0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSAxOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///18\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(44);\nvar enumBugKeys = __webpack_require__(32);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///21\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(8).f;\nvar has = __webpack_require__(10);\nvar TAG = __webpack_require__(2)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC10by1zdHJpbmctdGFnLmpzPzdiYTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRlZiA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgVEFHID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvU3RyaW5nVGFnJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCB0YWcsIHN0YXQpIHtcbiAgaWYgKGl0ICYmICFoYXMoaXQgPSBzdGF0ID8gaXQgOiBpdC5wcm90b3R5cGUsIFRBRykpIGRlZihpdCwgVEFHLCB7IGNvbmZpZ3VyYWJsZTogdHJ1ZSwgdmFsdWU6IHRhZyB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXRvLXN0cmluZy10YWcuanNcbi8vIG1vZHVsZSBpZCA9IDIzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///23\n")},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/NTJlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/ZTc2OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///25\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(103), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzY3MWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAyNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///26\n')},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/MzY5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSAyN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///27\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar document = __webpack_require__(1).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/MzhkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAyOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(9);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8zMjYzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIFRvUHJpbWl0aXZlKGlucHV0IFssIFByZWZlcnJlZFR5cGVdKVxudmFyIGlzT2JqZWN0ID0g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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(31)('keys');\nvar uid = __webpack_require__(22);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/NmIxZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAzMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///30\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(15) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qcz83YmMwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIFNIQVJFRCA9ICdfX2NvcmUtanNfc2hhcmVkX18nO1xudmFyIHN0b3JlID0gZ2xvYmFsW1NIQVJFRF0gfHwgKGdsb2JhbFtTSEFSRURdID0ge30pO1xuXG4obW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkge1xuICByZXR1cm4gc3RvcmVba2V5XSB8fCAoc3RvcmVba2V5XSA9IHZhbHVlICE9PSB1bmRlZmluZWQgPyB2YWx1ZSA6IHt9KTtcbn0pKCd2ZXJzaW9ucycsIFtdKS5wdXNoKHtcbiAgdmVyc2lvbjogY29yZS52ZXJzaW9uLFxuICBtb2RlOiByZXF1aXJlKCcuL19saWJyYXJ5JykgPyAncHVyZScgOiAnZ2xvYmFsJyxcbiAgY29weXJpZ2h0OiAnwqkgMjAxOCBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSdcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qc1xuLy8gbW9kdWxlIGlkID0gMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///31\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YzY3NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///32\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///33\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _typeof2 = __webpack_require__(60);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n\n return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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b3NzaWJsZUNvbnN0cnVjdG9yUmV0dXJuLmpzXG4vLyBtb2R1bGUgaWQgPSAzNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///34\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = __webpack_require__(105);\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = __webpack_require__(109);\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = __webpack_require__(60);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2luaGVyaXRzLmpzPzNkZmQiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmV4cG9ydHMuX19lc01vZH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RlMi5kZWZhdWx0KShzdXBlckNsYXNzICYmIHN1cGVyQ2xhc3MucHJvdG90eXBlLCB7XG4gICAgY29uc3RydWN0b3I6IHtcbiAgICAgIHZhbHVlOiBzdWJDbGFzcyxcbiAgICAgIGVudW1lcmFibGU6IGZhbHNlLFxuICAgICAgd3JpdGFibGU6IHRydWUsXG4gICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICB9XG4gIH0pO1xuICBpZiAoc3VwZXJDbGFzcykgX3NldFByb3RvdHlwZU9mMi5kZWZhdWx0ID8gKDAsIF9zZXRQcm90b3R5cGVPZjIuZGVmYXVsdCkoc3ViQ2xhc3MsIHN1cGVyQ2xhc3MpIDogc3ViQ2xhc3MuX19wcm90b19fID0gc3VwZXJDbGFzcztcbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2luaGVyaXRzLmpzXG4vLyBtb2R1bGUgaWQgPSAzNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///35\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(65);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _keys = __webpack_require__(48);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.divideURL = divideURL;\nexports.emptyObject = emptyObject;\nexports.secondsSinceEpoch = secondsSinceEpoch;\nexports.deepClone = deepClone;\nexports.removePathFromURL = removePathFromURL;\nexports.getUserURLFromEmail = getUserURLFromEmail;\nexports.getUserEmailFromURL = getUserEmailFromURL;\nexports.convertToUserURL = convertToUserURL;\nexports.isDataObjectURL = isDataObjectURL;\nexports.isLegacy = isLegacy;\nexports.isURL = isURL;\nexports.isUserURL = isUserURL;\nexports.isHypertyURL = isHypertyURL;\nexports.getConfigurationResources = getConfigurationResources;\nexports.buildURL = buildURL;\nexports.generateGUID = generateGUID;\nexports.getUserIdentityDomain = getUserIdentityDomain;\nexports.isBackendServiceURL = isBackendServiceURL;\nexports.divideEmail = divideEmail;\nexports.assign = assign;\nexports.splitObjectURL = splitObjectURL;\nexports.checkAttribute = checkAttribute;\nexports.parseAttributes = parseAttributes;\nexports.isEmpty = isEmpty;\nexports.chatkeysToStringCloner = chatkeysToStringCloner;\nexports.chatkeysToArrayCloner = chatkeysToArrayCloner;\nexports.parseMessageURL = parseMessageURL;\nexports.availableSpace = availableSpace;\nexports.encode = encode;\nexports.decode = decode;\nexports.decodeToUint8Array = decodeToUint8Array;\nexports.stringify = stringify;\nexports.parse = parse;\nexports.parseToUint8Array = parseToUint8Array;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * Support module with some functions will be useful\n * @module utils\n */\n\n/**\n * @typedef divideURL\n * @type Object\n * @property {string} type The type of URL\n * @property {string} domain The domain of URL\n * @property {string} identity The identity of URL\n */\n\n/**\n * Divide an url in type, domain and identity\n * @param {URL.URL} url - url address\n * @return {divideURL} the result of divideURL\n */\nfunction divideURL(url) {\n\n function recurse(value) {\n var regex = /([a-zA-Z-]*)(:\\/\\/(?:\\.)?|:)([-a-zA-Z0-9@:%._+~#=]{2,256})([-a-zA-Z0-9@:%._+~#=/]*)/gi;\n var subst = '$1,$3,$4';\n var parts = value.replace(regex, subst).split(',');\n return parts;\n }\n\n var parts = recurse(url);\n\n // If the url has no scheme\n if (parts[0] === url && !parts[0].includes('@')) {\n\n var _result = {\n type: '',\n domain: url,\n identity: ''\n };\n\n console.warn('[DivideURL] DivideURL don\\'t support url without scheme. Please review your url address', url);\n\n return _result;\n }\n\n // check if the url has the scheme and includes an @\n if (parts[0] === url && parts[0].includes('@')) {\n var scheme = parts[0] === url ? 'smtp' : parts[0];\n parts = recurse(scheme + '://' + parts[0]);\n }\n\n // if the domain includes an @, divide it to domain and identity respectively\n if (parts[1].includes('@')) {\n parts[2] = parts[0] + '://' + parts[1];\n parts[1] = parts[1].substr(parts[1].indexOf('@') + 1);\n } /*else if (parts[2].includes('/')) {\n parts[2] = parts[2].substr(parts[2].lastIndexOf('/')+1);\n }*/\n\n var result = {\n type: parts[0],\n domain: parts[1],\n identity: parts[2]\n };\n\n return result;\n}\n\n/**\n * Check if an Object is empty\n * @param {Object} object Object to be checked\n * @return {Boolean} status of Object, empty or not (true|false);\n */\nfunction emptyObject(object) {\n return (0, _keys2.default)(object).length > 0 ? false : true;\n}\n\nfunction secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n}\n\n/**\n * Make a COPY of the original data\n * @param {Object} obj - object to be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n //TODO: simple but inefficient JSON deep clone...\n if (obj) return JSON.parse((0, _stringify2.default)(obj));\n}\n\nfunction removePathFromURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n}\n\n/**\n * Obtains the user URL that corresponds to a given email\n * @param {string} userEmail The user email\n * @return {URL.URL} userURL The user URL\n */\nfunction getUserURLFromEmail(userEmail) {\n var indexOfAt = userEmail.indexOf('@');\n return 'user://' + userEmail.substring(indexOfAt + 1, userEmail.length) + '/' + userEmail.substring(0, indexOfAt);\n}\n\n/**\n * Obtains the user email that corresponds to a given URL\n * @param {URL.URL} userURL The user URL\n * @return {string} userEmail The user email\n */\nfunction getUserEmailFromURL(userURL) {\n var url = divideURL(userURL);\n return url.identity.replace('/', '') + '@' + url.domain; // identity field has '/exampleID' instead of 'exampleID'\n}\n\n/**\n * Check if the user identifier is already in the URL format, if not, convert to URL format\n * @param {string} identifier user identifier\n * @return {string} userURL the user URL\n */\nfunction convertToUserURL(identifier) {\n\n // check if the identifier is already in the url format\n if (identifier.substring(0, 7) === 'user://') {\n var dividedURL = divideURL(identifier);\n\n //check if the url is well formated\n if (dividedURL.domain && dividedURL.identity) {\n return identifier;\n } else {\n throw 'userURL with wrong format';\n }\n\n //if not, convert the user email to URL format\n } else {\n return getUserURLFromEmail(identifier);\n }\n}\n\nfunction isDataObjectURL(url) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain', 'hyperty'];\n var splitURL = url.split('://');\n var urlSchema = splitURL[0];\n\n return schemasToIgnore.indexOf(urlSchema) === -1;\n}\n\nfunction isLegacy(url) {\n if (url.split('@').length > 1) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction isURL(url) {\n return url.split('/').length >= 3;\n}\n\nfunction isUserURL(url) {\n return divideURL(url).type === 'user';\n}\n\nfunction isHypertyURL(url) {\n return divideURL(url).type === 'hyperty';\n}\n\n/**\n * get information relative each component configured on runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @return {object} return an object with all configurations;\n */\nfunction getConfigurationResources(configuration, component, resource) {\n var objectResource = configuration[component];\n var resourceType = objectResource[resource];\n\n return resourceType;\n}\n\n/**\n * Build a full url with the runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @param {string} type resource to get, like a hyperty name or protocolstub name;\n * @param {boolean} useFallback if true the function will check if have a fallback url;\n * @return {string} partial url to contact the resource;\n */\nfunction buildURL(configuration, component, resource, type) {\n var useFallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n var objectResource = configuration[component];\n var url = void 0;\n\n if (!objectResource.hasOwnProperty(resource)) {\n throw Error('The configuration ' + (0, _stringify2.default)(objectResource, '', 2) + ' don\\'t have the ' + resource + ' resource you are looking for');\n }\n\n var resourceType = objectResource[resource];\n\n if (type) {\n url = resourceType.prefix + configuration.domain + resourceType.suffix + type;\n if (resourceType.hasOwnProperty('fallback') && useFallback) {\n if (resourceType.fallback.indexOf('%domain%')) {\n url = resourceType.fallback.replace(/(%domain%)/g, configuration.domain) + type;\n } else {\n url = resourceType.fallback + type;\n }\n }\n } else {\n url = resourceType.prefix + configuration.domain + resourceType.suffix;\n }\n\n // console.log(url);\n\n return url;\n}\n\n/**\n * Generate a Global Unique ID\n *\n * @returns String;\n */\nfunction generateGUID() {\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\nfunction getUserIdentityDomain(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var splitedLength = splitedDomain.length;\n if (splitedLength == 1) {\n return splitedDomain[splitedLength - 1];\n }\n var domain = splitedDomain[splitedLength - 2] + '.' + splitedDomain[splitedLength - 1];\n return domain;\n}\n\n/**\n * Check if URL is from a backend service\n * @param {string} url URL to be processed\n * @return {boolean}\n */\n\nfunction isBackendServiceURL(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var backendSchemes = ['domain', 'global', 'domain-idp']; // should be defined in the runtime configuration\n var backendSubDomains = ['registry', 'msg-node']; // should be defined in the runtime configuration\n var subDomain = void 0;\n\n if (splitedDomain.length > 1) {\n subDomain = splitedDomain.filter(function (item) {\n return backendSubDomains.indexOf(item) !== -1;\n })[0];\n }\n\n if (subDomain && backendSubDomains.indexOf(subDomain) !== -1) {\n return true;\n }\n\n if (dividedURL.type) {\n return backendSchemes.indexOf(dividedURL.type) !== -1;\n }\n\n return false;\n}\n\nfunction divideEmail(email) {\n var indexOfAt = email.indexOf('@');\n\n var result = {\n username: email.substring(0, indexOfAt),\n domain: email.substring(indexOfAt + 1, email.length)\n };\n\n return result;\n}\n\nfunction assign(obj, keyPath, value) {\n\n if (!obj) obj = {};\n if (typeof keyPath === 'string') keyPath = parseAttributes(keyPath);\n\n var lastKeyIndex = keyPath.length - 1;\n\n for (var i = 0; i < lastKeyIndex; ++i) {\n var key = keyPath[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n obj[keyPath[lastKeyIndex]] = value;\n}\n\nfunction splitObjectURL(dataObjectURL) {\n console.info('[utils - splitObjectURL]: ', dataObjectURL);\n\n var splitedURL = dataObjectURL.split('/');\n var url = splitedURL[0] + '//' + splitedURL[2] + '/' + splitedURL[3];\n var resource = splitedURL[5];\n\n var result = {\n url: url,\n resource: resource\n };\n\n console.info('[utils - splitObjectURL]: ', result);\n\n return result;\n}\n\nfunction checkAttribute(path) {\n\n var regex = /((([a-zA-Z]+):\\/\\/([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\\/[a-zA-Z0-9.]+@[a-zA-Z0-9]+(-)?[a-zA-Z0-9]+(\\.)?[a-zA-Z0-9]{2,10}?\\.[a-zA-Z]{2,10})(.+(?=.identity))?/gm;\n\n var list = [];\n var final = [];\n var test = path.match(regex);\n\n if (test == null) {\n final = path.split('.');\n } else {\n var m = void 0;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach(function (match, groupIndex) {\n if (groupIndex === 0) {\n list.push(match);\n }\n });\n }\n var result = void 0;\n list.forEach(function (url) {\n\n result = path.replace(url, '*-*');\n final = result.split('.').map(function (item) {\n\n if (item === '*-*') {\n return url;\n }\n\n return item;\n });\n });\n }\n\n console.log('[RuntimeCore.Utils.checkAttribute]', final);\n return final;\n}\n\nfunction parseAttributes(path) {\n var regex = /([0-9a-zA-Z][-\\w]*):\\/\\//g;\n\n var string3 = 'identity';\n\n if (!path.includes('://')) {\n return path.split('.');\n } else {\n var string1 = path.split(regex)[0];\n\n var array1 = string1.split('.');\n\n var string2 = path.replace(string1, '');\n\n if (path.includes(string3)) {\n\n var array2 = string2.split(string3 + '.');\n\n console.log('array2 ' + array2);\n\n string2 = array2[0].slice('.', -1);\n\n array2 = array2[1].split('.');\n\n array1.push(string2, string3);\n\n array1 = array1.concat(array2);\n } else {\n array1.push(string2);\n }\n\n return array1.filter(Boolean);\n }\n}\n\nfunction isEmpty(obj) {\n for (var prop in obj) {\n\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return (0, _stringify2.default)(obj) === (0, _stringify2.default)({});\n}\n\nfunction chatkeysToStringCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n dataObjectSessionKeysClone[field].sessionKey = sessionKeys[field].sessionKey.toString();\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToStringCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction chatkeysToArrayCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n var arrayValues = JSON.parse('[' + sessionKeys[field].sessionKey + ']');\n dataObjectSessionKeysClone[field].sessionKey = new Uint8Array(arrayValues);\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToArrayCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction parseMessageURL(URL) {\n var splitedToURL = URL.split('/');\n if (splitedToURL.length <= 6) {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3];\n } else {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3] + '/' + splitedToURL[4];\n }\n}\n\nfunction availableSpace(usage, quota) {\n var available = (usage / quota).toFixed(2);\n return {\n quota: quota,\n usage: usage,\n percent: Number(available)\n };\n}\n\n/**\n* Encodes a JS object to base 64 encode\n* @param {Object} value byteArray value\n* @return {string} encoded value\n*/\nfunction encode(value) {\n try {\n var stringValue = stringify(value);\n return btoa(stringValue);\n } catch (err) {\n console.error('[Utils.encode:err] ' + err);\n throw err;\n }\n}\n\n/**\n * Decode a base64 string to object\n * @param {string_b64} value value encoded in base 64\n * @return {Object} decodedValue\n */\nfunction decode(value) {\n try {\n return JSON.parse(atob(value));\n } catch (err) {\n console.log('[Utils.decode:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Decode a base64 string to Uint8Array\n* @param {string_b64} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction decodeToUint8Array(value) {\n try {\n return new Uint8Array(decode(value));\n } catch (err) {\n console.error('[Utils.decodeToUint8Array:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a JS object to string\n* NOTE: Special conversion for Uint8Arrays\n* @param {Object} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction stringify(value) {\n try {\n var stringValue = void 0;\n if (value.constructor === Uint8Array) {\n stringValue = '[' + value.toString() + ']'; // the [] is for JSON.parse compatibility\n } else {\n stringValue = (0, _stringify2.default)(value);\n }\n return stringValue;\n } catch (err) {\n console.error('[Utils.stringify:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Object} encoded value\n*/\nfunction parse(value) {\n try {\n return JSON.parse(value);\n } catch (err) {\n console.error('[Utils.parse:err]' + err);\n console.trace();\n console.error('That that cause the error:', value);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction parseToUint8Array(value) {\n try {\n return new Uint8Array(parse(value));\n } catch (err) {\n console.error('[Utils.parseToUint8Array:err]' + err);\n throw err;\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL3V0aWxzL3V0aWxzLmpzP2JlNzMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBS0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = __webpack_require__(20);\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX25ldy1wcm9taXNlLWNhcGFiaWxpdHkuanM/YTgwNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyAyNS40LjEuNSBOZXdQcm9taXNlQ2FwYWJpbGl0eShDKVxudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcblxuZnVuY3Rpb24gUHJvbWlzZUNhcGFiaWxpdHkoQykge1xuICB2YXIgcmVzb2x2ZSwgcmVqZWN0O1xuICB0aGlzLnByb21pc2UgPSBuZXcgQyhmdW5jdGlvbiAoJCRyZXNvbHZlLCAkJHJlamVjdCkge1xuICAgIGlmIChyZXNvbHZlICE9PSB1bmRlZmluZWQgfHwgcmVqZWN0ICE9PSB1bmRlZmluZWQpIHRocm93IFR5cGVFcnJvcignQmFkIFByb21pc2UgY29uc3RydWN0b3InKTtcbiAgICByZXNvbHZlID0gJCRyZXNvbHZlO1xuICAgIHJlamVjdCA9ICQkcmVqZWN0O1xuICB9KTtcbiAgdGhpcy5yZXNvbHZlID0gYUZ1bmN0aW9uKHJlc29sdmUpO1xuICB0aGlzLnJlamVjdCA9IGFGdW5jdGlvbihyZWplY3QpO1xufVxuXG5tb2R1bGUuZXhwb3J0cy5mID0gZnVuY3Rpb24gKEMpIHtcbiAgcmV0dXJuIG5ldyBQcm9taXNlQ2FwYWJpbGl0eShDKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbmV3LXByb21pc2UtY2FwYWJpbGl0eS5qc1xuLy8gbW9kdWxlIGlkID0gMzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///37\n")},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n "use strict";\n if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof module === \'object\' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n "use strict";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = "undefined";\n\n var logMethods = [\n "trace",\n "debug",\n "info",\n "warn",\n "error"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === \'function\') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === \'debug\') {\n methodName = \'log\';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, \'log\');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn\'t present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n var storageKey = "loglevel";\n if (name) {\n storageKey += ":" + name;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || \'silent\').toUpperCase();\n\n if (typeof window === undefinedType) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + "=" + levelName + ";";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + "=");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,\n "ERROR": 4, "SILENT": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return "No console available for logging";\n }\n } else {\n throw "log.setLevel() called with invalid level: " + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? "WARN" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if (typeof name !== "string" || name === "") {\n throw new TypeError("You must supply a name when creating a logger.");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n return defaultLogger;\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvbG9nbGV2ZWwvbGliL2xvZ2xldmVsLmpzPzA2ZmMiXSwic291cmNlc0NvbnRlbnQiOlsiLypcbiogbG9nbGV2ZWwgLSBodHRwczovL2dpdGh1Yi5jb20vcGltdGVycnkvbG9nbGV2ZWxcbipcbiogQ29weXJpZ2h0IChjKSAyMDEzIFRpbSBQZXJyeVxuKiBMaWNlbnNlZCB1bmRlciB0aGUgTUlUIGxpY2Vuc2UuXG4qL1xuKGZ1bmN0aW9uIChyb290LCBkZWZpbml0aW9uKSB7XG4gICAgXCJ1c2Ugc3RyaWN0XCI7XG4gICAgaWYgKHR5cGVvZiBkZWZpbmUgPT09ICdmdW5jdGlvbicgJiYgZGVmaW5lLmFtZCkge1xuICAgICAgICBkZWZpbmUoZGVmaW5pdGlvbik7XG4gICAgfSBlbHNlIGlmICh0eXBlb2YgbW9kdWxlID09PSAnb2JqZWN0JyAmJiBtb2R1bGUuZXhwb3J0cykge1xuICAgICAgICBtb2R1bGUuZXhwb3J0cyA9IGRlZmluaXRpb24oKTt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iAodHlwZW9mIHN0b3JlZExldmVsID09PSB1bmRlZmluZWRUeXBlKSB7XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICB2YXIgY29va2llID0gd2luZG93LmRvY3VtZW50LmNvb2tpZTtcbiAgICAgICAgICAgICAgICAgIHZhciBsb2NhdGlvbiA9IGNvb2tpZS5pbmRleE9mKFxuICAgICAgICAgICAgICAgICAgICAgIGVuY29kZVVSSUNvbXBvbmVudChzdG9yYWdlS2V5KSArIFwiPVwiKTtcbiAgICAgICAgICAgICAgICAgIGlmIChsb2NhdGlvbiAhPT0gLTEpIHtcbiAgICAgICAgICAgICAgICAgICAgICBzdG9yZWRMZXZlbCA9IC9eKFteO10rKS8uZXhlYyhjb29raWUuc2xpY2UobG9jYXRpb24pKVsxXTtcbiAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBjYXRjaCAoaWdub3JlKSB7fVxuICAgICAgICAgIH1cblxuICAgICAgICAgIC8vIElmIHRoZSBzdG9yZWQgbGV2ZWwgaXMgbm90IHZhbGlkLCB0cmVhdCBpdCBhcyBpZiBub3RoaW5nIHdhcyBzdG9yZWQuXG4gICAgICAgICAgaWYgKHNlbGYubGV2ZWxzW3N0b3JlZExldmVsXSA9PT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgICAgIHN0b3JlZExldmVsID0gdW5kZWZpbmVkO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIHJldHVybiBzdG9yZWRMZXZlbDtcbiAgICAgIH1cblxuICAgICAgLypcbiAgICAgICAqXG4gICAgICAgKiBQdWJsaWMgbG9nZ2VyIEFQSSAtIHNlZSBodHRwczovL2dpdGh1Yi5jb20vcGltdGVycnkvbG9nbGV2ZWwgZm9yIGRldGFpbHNcbiAgICAgICAqXG4gICAgICAgKi9cblxuICAgICAgc2VsZi5uYW1lID0gbmFtZTtcblxuICAgICAgc2VsZi5sZXZlbHMgPSB7IFwiVFJBQ0VcIjogMCwgXCJERUJVR1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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///38\n')},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(2);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1leHQuanM/MmExZSJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSByZXF1aXJlKCcuL193a3MnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAzOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///39\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar LIBRARY = __webpack_require__(15);\nvar wksExt = __webpack_require__(39);\nvar defineProperty = __webpack_require__(8).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1kZWZpbmUuanM/NzJiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyIHdrc0V4dCA9IHJlcXVpcmUoJy4vX3drcy1leHQnKTtcbnZhciBkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChuYW1lKSB7XG4gIHZhciAkU3ltYm9sID0gY29yZS5TeW1ib2wgfHwgKGNvcmUuU3ltYm9sID0gTElCUkFSWSA/IHt9IDogZ2xvYmFsLlN5bWJvbCB8fCB7fSk7XG4gIGlmIChuYW1lLmNoYXJBdCgwKSAhPSAnXycgJiYgIShuYW1lIGluICRTeW1ib2wpKSBkZWZpbmVQcm9wZXJ0eSgkU3ltYm9sLCBuYW1lLCB7IHZhbHVlOiB3a3NFeHQuZihuYW1lKSB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///40\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(6);\nvar dPs = __webpack_require__(74);\nvar enumBugKeys = __webpack_require__(32);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(28)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(55).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1jcmVhdGUuanM/NjI4NiJdLCJzb3VyY2VzQ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W9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gNDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///41\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(72)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(53)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qcz9jZDA0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuLy8gMjEuMS4zLjI3IFN0cmluZy5wcm90b3R5cGVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faXRlci1kZWZpbmUnKShTdHJpbmcsICdTdHJpbmcnLCBmdW5jdGlvbiAoaXRlcmF0ZWQpIHtcbiAgdGhpcy5fdCA9IFN0cmluZyhpdGVyYXRlZCk7IC8vIHRhcmdldFxuICB0aGlzLl9pID0gMDsgICAgICAgICAgICAgICAgLy8gbmV4dCBpbmRleFxuLy8gMjEuMS41LjIuMSAlU3RyaW5nSXRlcmF0b3JQcm90b3R5cGUlLm5leHQoKVxufSwgZnVuY3Rpb24gKCkge1xuICB2YXIgTyA9IHRoaXMuX3Q7XG4gIHZhciBpbmRleCA9IHRoaXMuX2k7XG4gIHZhciBwb2ludDtcbiAgaWYgKGluZGV4ID49IE8ubGVuZ3RoKSByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIHBvaW50ID0gJGF0KE8sIGluZGV4KTtcbiAgdGhpcy5faSArPSBwb2ludC5sZW5ndGg7XG4gIHJldHVybiB7IHZhbHVlOiBwb2ludCwgZG9uZTogZmFsc2UgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNDJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///42\n")},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(7) && !__webpack_require__(13)(function () {\n return Object.defineProperty(__webpack_require__(28)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzPzQ5ZjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(10);\nvar toIObject = __webpack_require__(12);\nvar arrayIndexOf = __webpack_require__(66)(false);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzPzIxYjgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUluZGV4T2YgPSByZXF1aXJlKCcuL19hcnJheS1pbmNsdWRlcycpKGZhbHNlKTtcbnZhciBJRV9QUk9UTyA9IHJlcXVpcmUoJy4vX3NoYXJlZC1rZXknKSgnSUVfUFJPVE8nKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBuYW1lcykge1xuICB2YXIgTyA9IHRvSU9iamVjdChvYmplY3QpO1xuICB2YXIgaSA9IDA7XG4gIHZhciByZXN1bHQgPSBbXTtcbiAgdmFyIGtleTtcbiAgZm9yIChrZXkgaW4gTykgaWYgKGtleSAhPSBJRV9QUk9UTykgaGFzKE8sIGtleSkgJiYgcmVzdWx0LnB1c2goa2V5KTtcbiAgLy8gRG9uJ3QgZW51bSBidWcgJiBoaWRkZW4ga2V5c1xuICB3aGlsZSAobmFtZXMubGVuZ3RoID4gaSkgaWYgKGhhcyhPLCBrZXkgPSBuYW1lc1tpKytdKSkge1xuICAgIH5hcnJheUluZGV4T2YocmVzdWx0LCBrZXkpIHx8IHJlc3VsdC5wdXNoKGtleSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDQ0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(24);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz80MTExIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(75);\nvar global = __webpack_require__(1);\nvar hide = __webpack_require__(11);\nvar Iterators = __webpack_require__(18);\nvar TO_STRING_TAG = __webpack_require__(2)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZS5qcz9mYWQzIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJ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PSBnbG9iYWxbTkFNRV07XG4gIHZhciBwcm90byA9IENvbGxlY3Rpb24gJiYgQ29sbGVjdGlvbi5wcm90b3R5cGU7XG4gIGlmIChwcm90byAmJiAhcHJvdG9bVE9fU1RSSU5HX1RBR10pIGhpZGUocHJvdG8sIFRPX1NUUklOR19UQUcsIE5BTUUpO1xuICBJdGVyYXRvcnNbTkFNRV0gPSBJdGVyYXRvcnMuQXJyYXk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///46\n")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BzLmpzP2Q2NDQiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5U3ltYm9scztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qc1xuLy8gbW9kdWxlIGlkID0gNDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///47\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(113), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzPzdkOTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9rZXlzXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA0OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSA0IDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///48\n')},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(16);\nvar TAG = __webpack_require__(2)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NsYXNzb2YuanM/NDU4ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBnZXR0aW5nIHRhZyBmcm9tIDE5LjEuMy42IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcoKVxudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xudmFyIFRBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuLy8gRVMzIHdyb25nIGhlcmVcbnZhciBBUkcgPSBjb2YoZnVuY3Rpb24gKCkgeyByZXR1cm4gYXJndW1lbnRzOyB9KCkpID09ICdBcmd1bWVudHMnO1xuXG4vLyBmYWxsYmFjayBmb3IgSUUxMSBTY3JpcHQgQWNjZXNzIERlbmllZCBlcnJvclxudmFyIHRyeUdldCA9IGZ1bmN0aW9uIChpdCwga2V5KSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGl0W2tleV07XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxufTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgdmFyIE8sIFQsIEI7XG4gIHJldHVybiBpdCA9PT0gdW5kZWZpbmVkID8gJ1VuZGVmaW5lZCcgOiBpdCA9PT0gbnVsbCA/ICdOdWxsJ1xuICAgIC8vIEBAdG9TdHJpbmdUYWcgY2FzZVxuICAgIDogdHlwZW9mIChUID0gdHJ5R2V0KE8gPSBPYmplY3QoaXQpLCBUQUcpKSA9PSAnc3RyaW5nJyA/IFRcbiAgICAvLyBidWlsdGluVGFnIGNhc2VcbiAgICA6IEFSRyA/IGNvZihPKVxuICAgIC8vIEVTMyBhcmd1bWVudHMgZmFsbGJhY2tcbiAgICA6IChCID0gY29mKE8pKSA9PSAnT2JqZWN0JyAmJiB0eXBlb2YgTy5jYWxsZWUgPT0gJ2Z1bmN0aW9uJyA/ICdBcmd1bWVudHMnIDogQjtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY2xhc3NvZi5qc1xuLy8gbW9kdWxlIGlkID0gNDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///49\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar fails = __webpack_require__(13);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1zYXAuanM/YmFhNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBtb3N0IE9iamVjdCBtZXRob2RzIGJ5IEVTNiBzaG91bGQgYWNjZXB0IHByaW1pdGl2ZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVksIGV4ZWMpIHtcbiAgdmFyIGZuID0gKGNvcmUuT2JqZWN0IHx8IHt9KVtLRVldIHx8IE9iamVjdFtLRVldO1xuICB2YXIgZXhwID0ge307XG4gIGV4cFtLRVldID0gZXhlYyhmbik7XG4gICRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogZmFpbHMoZnVuY3Rpb24gKCkgeyBmbigxKTsgfSksICdPYmplY3QnLCBleHApO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzXG4vLyBtb2R1bGUgaWQgPSA1MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///50\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(27);\nvar createDesc = __webpack_require__(21);\nvar toIObject = __webpack_require__(12);\nvar toPrimitive = __webpack_require__(29);\nvar has = __webpack_require__(10);\nvar IE8_DOM_DEFINE = __webpack_require__(43);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BkLmpzPzJjYTYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHBJRSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIElFOF9ET01fREVGSU5FID0gcmVxdWlyZSgnLi9faWU4LWRvbS1kZWZpbmUnKTtcbnZhciBnT1BEID0gT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGdPUEQgOiBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoTywgUCkge1xuICBPID0gdG9JT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZ09QRChPLCBQKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIGlmIChoYXMoTywgUCkpIHJldHVybiBjcmVhdGVEZXNjKCFwSUUuZi5jYWxsKE8sIFApLCBPW1BdKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcGQuanNcbi8vIG1vZHVsZSBpZCA9IDUxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///51\n")},function(module,exports){eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///52\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(15);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(54);\nvar hide = __webpack_require__(11);\nvar Iterators = __webpack_require__(18);\nvar $iterCreate = __webpack_require__(73);\nvar setToStringTag = __webpack_require__(23);\nvar getPrototypeOf = __webpack_require__(63);\nvar ITERATOR = __webpack_require__(2)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJzb3V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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///53\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(11);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLmpzP2YzY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19oaWRlJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fcmVkZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///54\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(1).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanM/NDRmMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbm1vZHVsZS5leHBvcnRzID0gZG9jdW1lbnQgJiYgZG9jdW1lbnQuZG9jdW1lbnRFbGVtZW50O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2h0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDU1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///55\n")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(6);\nvar aFunction = __webpack_require__(20);\nvar SPECIES = __webpack_require__(2)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NwZWNpZXMtY29uc3RydWN0b3IuanM/YjdjYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjMuMjAgU3BlY2llc0NvbnN0cnVjdG9yKE8sIGRlZmF1bHRDb25zdHJ1Y3RvcilcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbnZhciBTUEVDSUVTID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKE8sIEQpIHtcbiAgdmFyIEMgPSBhbk9iamVjdChPKS5jb25zdHJ1Y3RvcjtcbiAgdmFyIFM7XG4gIHJldHVybiBDID09PSB1bmRlZmluZWQgfHwgKFMgPSBhbk9iamVjdChDKVtTUEVDSUVTXSkgPT0gdW5kZWZpbmVkID8gRCA6IGFGdW5jdGlvbihTKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc3BlY2llcy1jb25zdHJ1Y3Rvci5qc1xuLy8gbW9kdWxlIGlkID0gNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///56\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(17);\nvar invoke = __webpack_require__(83);\nvar html = __webpack_require__(55);\nvar cel = __webpack_require__(28);\nvar global = __webpack_require__(1);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(16)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Rhc2suanM/MmY4ZCJdLCJzb3VyY2V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ceURL=webpack-internal:///57\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3BlcmZvcm0uanM/NzRkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChleGVjKSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIHsgZTogZmFsc2UsIHY6IGV4ZWMoKSB9O1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHsgZTogdHJ1ZSwgdjogZSB9O1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3BlcmZvcm0uanNcbi8vIG1vZHVsZSBpZCA9IDU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///58\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(6);\nvar isObject = __webpack_require__(9);\nvar newPromiseCapability = __webpack_require__(37);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJm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n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(91);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(93);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {\n return typeof obj === "undefined" ? "undefined" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz9hNDU2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2l0ZXJhdG9yID0gcmVxdWlyZShcIi4uL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yXCIpO1xuXG52YXIgX2l0ZXJhdG9yMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2l0ZXJhdG9yKTtcblxudmFyIF9zeW1ib2wgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9zeW1ib2xcIik7XG5cbnZhciBfc3ltYm9sMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX3N5bWJvb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IG9iaiA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiBfdHlwZW9mKG9iaik7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90eXBlb2YuanNcbi8vIG1vZHVsZSBpZCA9IDYwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///60\n')},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(44);\nvar hiddenKeys = __webpack_require__(32).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLmpzPzlmNDQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjcgLyAxNS4yLjMuNCBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhPKVxudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMtaW50ZXJuYWwnKTtcbnZhciBoaWRkZW5LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpLmNvbmNhdCgnbGVuZ3RoJywgJ3Byb3RvdHlwZScpO1xuXG5leHBvcnRzLmYgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyB8fCBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKE8pIHtcbiAgcmV0dXJuICRrZXlzKE8sIGhpZGRlbktleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi5qc1xuLy8gbW9kdWxlIGlkID0gNjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///61\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(16);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/MzE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///62\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(10);\nvar toObject = __webpack_require__(33);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1ncG8uanM/M2YzYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuOSAvIDE1LjIuMy4yIE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgT2JqZWN0UHJvdG8gPSBPYmplY3QucHJvdG90eXBlO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5nZXRQcm90b3R5cGVPZiB8fCBmdW5jdGlvbiAoTykge1xuICBPID0gdG9PYmplY3QoTyk7XG4gIGlmIChoYXMoTywgSUVfUFJPVE8pKSByZXR1cm4gT1tJRV9QUk9UT107XG4gIGlmICh0eXBlb2YgTy5jb25zdHJ1Y3RvciA9PSAnZnVuY3Rpb24nICYmIE8gaW5zdGFuY2VvZiBPLmNvbnN0cnVjdG9yKSB7XG4gICAgcmV0dXJuIE8uY29uc3RydWN0b3IucHJvdG90eXBlO1xuICB9IHJldHVybiBPIGluc3RhbmNlb2YgT2JqZWN0ID8gT2JqZWN0UHJvdG8gOiBudWxsO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ3BvLmpzXG4vLyBtb2R1bGUgaWQgPSA2M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///63\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(68), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/MGI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA2NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///64\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(112), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzPzlhZjEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5XCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSA2NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///65\n')},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(12);\nvar toLength = __webpack_require__(45);\nvar toAbsoluteIndex = __webpack_require__(67);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzP2JjNTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXNcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtc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vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYXJyYXktaW5jbHVkZXMuanNcbi8vIG1vZHVsZSBpZCA9IDY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(24);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzPzdlNDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDY3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///67\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(69);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/ZjViMCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5Jyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpIHtcbiAgcmV0dXJuICRPYmplY3QuZGVmaW5lUHJvcGVydHkoaXQsIGtleSwgZGVzYyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///68\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(8).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanM/OTgyOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjQgLyAxNS4yLjMuNiBPYmplY3QuZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnR5OiByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///69\n")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(49);\nvar ITERATOR = __webpack_require__(2)('iterator');\nvar Iterators = __webpack_require__(18);\nmodule.exports = __webpack_require__(0).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kLmpzP2RkZmIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgSVRFUkFUT1IgPSByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fY29yZScpLmdldEl0ZXJhdG9yTWV0aG9kID0gZnVuY3Rpb24gKGl0KSB7XG4gIGlmIChpdCAhPSB1bmRlZmluZWQpIHJldHVybiBpdFtJVEVSQVRPUl1cbiAgICB8fCBpdFsnQEBpdGVyYXRvciddXG4gICAgfHwgSXRlcmF0b3JzW2NsYXNzb2YoaXQpXTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QuanNcbi8vIG1vZHVsZSBpZCA9IDcwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///70\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(52);\n__webpack_require__(42);\n__webpack_require__(46);\n__webpack_require__(78);\n__webpack_require__(89);\n__webpack_require__(90);\nmodule.exports = __webpack_require__(0).Promise;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3Byb21pc2UuanM/NTM5OCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi9tb2R1bGVzL2VzNi5vYmplY3QudG8tc3RyaW5nJyk7XG5yZXF1aXJlKCcuLi9tb2R1bGVzL2VzNi5zdHJpbmcuaXRlcmF0b3InKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczYucHJvbWlzZScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczcucHJvbWlzZS5maW5hbGx5Jyk7XG5yZXF1aXJlKCcuLi9tb2R1bGVzL2VzNy5wcm9taXNlLnRyeScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi9tb2R1bGVzL19jb3JlJykuUHJvbWlzZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9wcm9taXNlLmpzXG4vLyBtb2R1bGUgaWQgPSA3MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///71\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(24);\nvar defined = __webpack_require__(25);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3N0cmluZy1hdC5qcz84N2FlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbi8vIHRydWUgIC0+IFN0cmluZyNhdFxuLy8gZmFsc2UgLT4gU3RyaW5nI2NvZGVQb2ludEF0XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChUT19TVFJJTkcpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uICh0aGF0LCBwb3MpIHtcbiAgICB2YXIgcyA9IFN0cmluZyhkZWZpbmVkKHRoYXQpKTtcbiAgICB2YXIgaSA9IHRvSW50ZWdlcihwb3MpO1xuICAgIHZhciBsID0gcy5sZW5ndGg7XG4gICAgdmFyIGEsIGI7XG4gICAgaWYgKGkgPCAwIHx8IGkgPj0gbCkgcmV0dXJuIFRPX1NUUklORyA/ICcnIDogdW5kZWZpbmVkO1xuICAgIGEgPSBzLmNoYXJDb2RlQXQoaSk7XG4gICAgcmV0dXJuIGEgPCAweGQ4MDAgfHwgYSA+IDB4ZGJmZiB8fCBpICsgMSA9PT0gbCB8fCAoYiA9IHMuY2hhckNvZGVBdChpICsgMSkpIDwgMHhkYzAwIHx8IGIgPiAweGRmZmZcbiAgICAgID8gVE9fU1RSSU5HID8gcy5jaGFyQXQoaSkgOiBhXG4gICAgICA6IFRPX1NUUklORyA/IHMuc2xpY2UoaSwgaSArIDIpIDogKGEgLSAweGQ4MDAgPDwgMTApICsgKGIgLSAweGRjMDApICsgMHgxMDAwMDtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc3RyaW5nLWF0LmpzXG4vLyBtb2R1bGUgaWQgPSA3MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///72\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(41);\nvar descriptor = __webpack_require__(21);\nvar setToStringTag = __webpack_require__(23);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(11)(IteratorPrototype, __webpack_require__(2)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY3JlYXRlLmpzP2Y3ODUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciBkZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciBJdGVyYXRvclByb3RvdHlwZSA9IHt9O1xuXG4vLyAyNS4xLjIuMS4xICVJdGVyYXRvclByb3RvdHlwZSVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faGlkZScpKEl0ZXJhdG9yUHJvdG90eXBlLCByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKSwgZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpczsgfSk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKENvbnN0cnVjdG9yLCBOQU1FLCBuZXh0KSB7XG4gIENvbnN0cnVjdG9yLnByb3RvdHlwZSA9IGNyZWF0ZShJdGVyYXRvclByb3RvdHlwZSwgeyBuZXh0OiBkZXNjcmlwdG9yKDEsIG5leHQpIH0pO1xuICBzZXRUb1N0cmluZ1RhZyhDb25zdHJ1Y3RvciwgTkFNRSArICcgSXRlcmF0b3InKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlci1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDczXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///73\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(8);\nvar anObject = __webpack_require__(6);\nvar getKeys = __webpack_require__(19);\n\nmodule.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcHMuanM/YWEyYSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydGllcyA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcykge1xuICBhbk9iamVjdChPKTtcbiAgdmFyIGtleXMgPSBnZXRLZXlzKFByb3BlcnRpZXMpO1xuICB2YXIgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG4gIHZhciBpID0gMDtcbiAgdmFyIFA7XG4gIHdoaWxlIChsZW5ndGggPiBpKSBkUC5mKE8sIFAgPSBrZXlzW2krK10sIFByb3BlcnRpZXNbUF0pO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gNzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///74\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(76);\nvar step = __webpack_require__(77);\nvar Iterators = __webpack_require__(18);\nvar toIObject = __webpack_require__(12);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(53)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LmFycmF5Lml0ZXJhdG9yLmpzP2M0NjkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGFkZFRvVW5zY29wYWJsZXMgPSByZXF1aXJlKCcuL19hZGQtdG8tdW5zY29wYWJsZXMnKTtcbnZhciBzdGVwID0gcmVxdWlyZSgnLi9faXRlci1zdGVwJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xuXG4vLyAyMi4xLjMuNCBBcnJheS5wcm90b3R5cGUuZW50cmllcygpXG4vLyAyMi4xLjMuMTMgQXJyYXkucHJvdG90eXBlLmtleXMoKVxuLy8gMjIuMS4zLjI5IEFycmF5LnByb3RvdHlwZS52YWx1ZXMoKVxuLy8gMjIuMS4zLjMwIEFycmF5LnByb3RvdHlwZVtAQGl0ZXJhdG9yXSgpXG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2l0ZXItZGVmaW5lJykoQXJyYXksICdBcnJheScsIGZ1bmN0aW9uIChpdGVyYXRlZCwga2luZCkge1xuICB0aGlzLl90ID0gdG9JT2JqZWN0KGl0ZXJhdGVkKTsgLy8gdGFyZ2V0XG4gIHRoaXMuX2kgPSAwOyAgICAgICAgICAgICAgICAgICAvLyBuZXh0IGluZGV4XG4gIHRoaXMuX2sgPSBraW5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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///75\n")},function(module,exports){eval("module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qcz9lMjY3Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FkZC10by11bnNjb3BhYmxlcy5qc1xuLy8gbW9kdWxlIGlkID0gNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///76\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qcz8xMDY2Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGRvbmUsIHZhbHVlKSB7XG4gIHJldHVybiB7IHZhbHVlOiB2YWx1ZSwgZG9uZTogISFkb25lIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItc3RlcC5qc1xuLy8gbW9kdWxlIGlkID0gNzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///77\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(15);\nvar global = __webpack_require__(1);\nvar ctx = __webpack_require__(17);\nvar classof = __webpack_require__(49);\nvar $export = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar aFunction = __webpack_require__(20);\nvar anInstance = __webpack_require__(79);\nvar forOf = __webpack_require__(80);\nvar speciesConstructor = __webpack_require__(56);\nvar task = __webpack_require__(57).set;\nvar microtask = __webpack_require__(84)();\nvar newPromiseCapabilityModule = __webpack_require__(37);\nvar perform = __webpack_require__(58);\nvar userAgent = __webpack_require__(85);\nvar promiseResolve = __webpack_require__(59);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(2)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(86)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(23)($Promise, PROMISE);\n__webpack_require__(87)(PROMISE);\nWrapper = __webpack_require__(0)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(88)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnByb21pc2UuanM/MDk3YyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgTElCUkFSWSA9IHJlcXVpcmUoJy4vX2xpYnJhcnknKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBjbGFzc29mID0gcmVxdWlyZSgnLi9fY2xhc3NvZicpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbnZhciBhbkluc3RhbmNlID0gcmVxdWlyZSgnLi9fYW4taW5zdGFuY2UnKTtcbnZhciBmb3JPZiA9IHJlcXVpcmUoJy4vX2Zvci1vZicpO1xudmF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AgICAgICAgIGVsc2Uge1xuICAgICAgICAgICAgaWYgKGRvbWFpbikgZG9tYWluLmVudGVyKCk7XG4gICAgICAgICAgICByZXN1bHQgPSBoYW5kbGVyKHZhbHVlKTsgLy8gbWF5IHRocm93XG4gICAgICAgICAgICBpZiAoZG9tYWluKSB7XG4gICAgICAgICAgICAgIGRvbWFpbi5leGl0KCk7XG4gICAgICAgICAgICAgIGV4aXRlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChyZXN1bHQgPT09IHJlYWN0aW9uLnByb21pc2UpIHtcbiAgICAgICAgICAgIHJlamVjdChUeXBlRXJyb3IoJ1Byb21pc2UtY2hhaW4gY3ljbGUnKSk7XG4gICAgICAgICAgfSBlbHNlIGlmICh0aGVuID0gaXNUaGVuYWJsZShyZXN1bHQpKSB7XG4gICAgICAgICAgICB0aGVuLmNhbGwocmVzdWx0LCByZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgIH0gZWxzZSByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgIH0gZWxzZSByZWplY3QodmFsdWUpO1xuICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICBpZiAoZG9tYWluICYmICFleGl0ZWQpIGRvbWFpbi5leGl0KCk7XG4gICAgICAgIHJlamVjdChlKTtcbiAgICAgIH1cbiAgICB9O1xuICAgIHdoaWxlIChjaGFpbi5sZW5ndGggPiBpKSBydW4oY2hhaW5baSsrXSk7IC8vIHZhcmlhYmxlIGxlbmd0aCAtIGNhbid0IHVzZSBmb3JFYWNoXG4gICAgcHJvbWlzZS5fYyA9IFtdO1xuICAgIHByb21pc2UuX24gPSBmYWxzZTtcbiAgICBpZiAoaXNSZWplY3QgJiYgIXByb21pc2UuX2gpIG9uVW5oYW5kbGVkKHByb21pc2UpO1xuICB9KTtcbn07XG52YXIgb25VbmhhbmRsZWQgPSBmdW5jdGlvbiAocHJvbWlzZSkge1xuICB0YXNrLmNhbGwoZ2xvYm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L=webpack-internal:///78\n")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLWluc3RhbmNlLmpzP2Q4YWMiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIENvbnN0cnVjdG9yLCBuYW1lLCBmb3JiaWRkZW5GaWVsZCkge1xuICBpZiAoIShpdCBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSB8fCAoZm9yYmlkZGVuRmllbGQgIT09IHVuZGVmaW5lZCAmJiBmb3JiaWRkZW5GaWVsZCBpbiBpdCkpIHtcbiAgICB0aHJvdyBUeXBlRXJyb3IobmFtZSArICc6IGluY29ycmVjdCBpbnZvY2F0aW9uIScpO1xuICB9IHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYW4taW5zdGFuY2UuanNcbi8vIG1vZHVsZSBpZCA9IDc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///79\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(17);\nvar call = __webpack_require__(81);\nvar isArrayIter = __webpack_require__(82);\nvar anObject = __webpack_require__(6);\nvar toLength = __webpack_require__(45);\nvar getIterFn = __webpack_require__(70);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2Zvci1vZi5qcz8zNTZiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBjYWxsID0gcmVxdWlyZSgnLi9faXRlci1jYWxsJyk7XG52YXIgaXNBcnJheUl0ZXIgPSByZXF1aXJlKCcuL19pcy1hcnJheS1pdGVyJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xudmFyIGdldEl0ZXJGbiA9IHJlcXVpcmUoJy4vY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kJyk7XG52YXIgQlJFQUsgPSB7fTtcbnZhciBSRVRVUk4gPSB7fTtcbnZhciBleHBvcnRzID0gbW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Hx8IHJlc3VsdCA9PT0gUkVUVVJOKSByZXR1cm4gcmVzdWx0O1xuICB9XG59O1xuZXhwb3J0cy5CUkVBSyA9IEJSRUFLO1xuZXhwb3J0cy5SRVRVUk4gPSBSRVRVUk47XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZm9yLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSA4MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///80\n")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(6);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY2FsbC5qcz85YWM1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGNhbGwgc29tZXRoaW5nIG9uIGl0ZXJhdG9yIHN0ZXAgd2l0aCBzYWZlIGNsb3Npbmcgb24gZXJyb3JcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXRlcmF0b3IsIGZuLCB2YWx1ZSwgZW50cmllcykge1xuICB0cnkge1xuICAgIHJldHVybiBlbnRyaWVzID8gZm4oYW5PYmplY3QodmFsdWUpWzBdLCB2YWx1ZVsxXSkgOiBmbih2YWx1ZSk7XG4gIC8vIDcuNC42IEl0ZXJhdG9yQ2xvc2UoaXRlcmF0b3IsIGNvbXBsZXRpb24pXG4gIH0gY2F0Y2ggKGUpIHtcbiAgICB2YXIgcmV0ID0gaXRlcmF0b3JbJ3JldHVybiddO1xuICAgIGlmIChyZXQgIT09IHVuZGVmaW5lZCkgYW5PYmplY3QocmV0LmNhbGwoaXRlcmF0b3IpKTtcbiAgICB0aHJvdyBlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY2FsbC5qc1xuLy8gbW9kdWxlIGlkID0gODFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///81\n")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(18);\nvar ITERATOR = __webpack_require__(2)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LWl0ZXIuanM/MzIxYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBjaGVjayBvbiBkZWZhdWx0IEFycmF5IGl0ZXJhdG9yXG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgSVRFUkFUT1IgPSByZXF1aXJlKCcuL193a3MnKSgnaXRlcmF0b3InKTtcbnZhciBBcnJheVByb3RvID0gQXJyYXkucHJvdG90eXBlO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXQgIT09IHVuZGVmaW5lZCAmJiAoSXRlcmF0b3JzLkFycmF5ID09PSBpdCB8fCBBcnJheVByb3RvW0lURVJBVE9SXSA9PT0gaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1hcnJheS1pdGVyLmpzXG4vLyBtb2R1bGUgaWQgPSA4MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///82\n")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ludm9rZS5qcz85MjdiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhc3QgYXBwbHksIGh0dHA6Ly9qc3BlcmYubG5raXQuY29tL2Zhc3QtYXBwbHkvNVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZm4sIGFyZ3MsIHRoYXQpIHtcbiAgdmFyIHVuID0gdGhhdCA9PT0gdW5kZWZpbmVkO1xuICBzd2l0Y2ggKGFyZ3MubGVuZ3RoKSB7XG4gICAgY2FzZSAwOiByZXR1cm4gdW4gPyBmbigpXG4gICAgICAgICAgICAgICAgICAgICAgOiBmbi5jYWxsKHRoYXQpO1xuICAgIGNhc2UgMTogcmV0dXJuIHVuID8gZm4oYXJnc1swXSlcbiAgICAgICAgICAgICAgICAgICAgICA6IGZuLmNhbGwodGhhdCwgYXJnc1swXSk7XG4gICAgY2FzZSAyOiByZXR1cm4gdW4gPyBmbihhcmdzWzBdLCBhcmdzWzFdKVxuICAgICAgICAgICAgICAgICAgICAgIDogZm4uY2FsbCh0aGF0LCBhcmdzWzBdLCBhcmdzWzFdKTtcbiAgICBjYXNlIDM6IHJldHVybiB1biA/IGZuKGFyZ3NbMF0sIGFyZ3NbMV0sIGFyZ3NbMl0pXG4gICAgICAgICAgICAgICAgICAgICAgOiBmbi5jYWxsKHRoYXQsIGFyZ3NbMF0sIGFyZ3NbMV0sIGFyZ3NbMl0pO1xuICAgIGNhc2UgNDogcmV0dXJuIHVuID8gZm4oYXJnc1swXSwgYXJnc1sxXSwgYXJnc1syXSwgYXJnc1szXSlcbiAgICAgICAgICAgICAgICAgICAgICA6IGZuLmNhbGwodGhhdCwgYXJnc1swXSwgYXJnc1sxXSwgYXJnc1syXSwgYXJnc1szXSk7XG4gIH0gcmV0dXJuIGZuLmFwcGx5KHRoYXQsIGFyZ3MpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pbnZva2UuanNcbi8vIG1vZHVsZSBpZCA9IDgzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///83\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar macrotask = __webpack_require__(57).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(16)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21pY3JvdGFzay5qcz9mMzYzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBtYWNyb3Rhc2sgPSByZXF1aXJlKCcuL190YXNrJykuc2V0O1xudmFyIE9ic2VydmVyID0gZ2xvYmFsLk11dGF0aW9uT2JzZXJ2ZXIgfHwgZ2xvYmFsLldlYktpdE11dGF0aW9uT2JzZXJ2ZXI7XG52YXIgcHJvY2VzcyA9IGdsb2JhbC5wcm9jZXNzO1xudmFyIFByb21pc2UgPSBnbG9iYWwuUHJvbWlzZTtcbnZhciBpc05vZGUgPSByZXF1aXJlKCcuL19jb2YnKShwcm9jZXNzKSA9PSAncHJvY2Vzcyc7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkge1xuICB2YXIgaGVhZCwgbGFzdCwgbm90aWZ5O1xuXG4gIHZhciBmbHVzaCA9IGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgcGFyZW50LCBmbjtcbiAgICBpZiAoaXNOb2RlICYmIChwYXJlb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dCA9IHRhc2s7XG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21pY3JvdGFzay5qc1xuLy8gbW9kdWxlIGlkID0gODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///84\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VzZXItYWdlbnQuanM/ODk0NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgbmF2aWdhdG9yID0gZ2xvYmFsLm5hdmlnYXRvcjtcblxubW9kdWxlLmV4cG9ydHMgPSBuYXZpZ2F0b3IgJiYgbmF2aWdhdG9yLnVzZXJBZ2VudCB8fCAnJztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL191c2VyLWFnZW50LmpzXG4vLyBtb2R1bGUgaWQgPSA4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///85\n")},function(module,exports,__webpack_require__){eval("var hide = __webpack_require__(11);\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLWFsbC5qcz9jNDdmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGFyZ2V0LCBzcmMsIHNhZmUpIHtcbiAgZm9yICh2YXIga2V5IGluIHNyYykge1xuICAgIGlmIChzYWZlICYmIHRhcmdldFtrZXldKSB0YXJnZXRba2V5XSA9IHNyY1trZXldO1xuICAgIGVsc2UgaGlkZSh0YXJnZXQsIGtleSwgc3JjW2tleV0pO1xuICB9IHJldHVybiB0YXJnZXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLWFsbC5qc1xuLy8gbW9kdWxlIGlkID0gODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///86\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar dP = __webpack_require__(8);\nvar DESCRIPTORS = __webpack_require__(7);\nvar SPECIES = __webpack_require__(2)('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC1zcGVjaWVzLmpzPzZkMWEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgU1BFQ0lFUyA9IHJlcXVpcmUoJy4vX3drcycpKCdzcGVjaWVzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKEtFWSkge1xuICB2YXIgQyA9IHR5cGVvZiBjb3JlW0tFWV0gPT0gJ2Z1bmN0aW9uJyA/IGNvcmVbS0VZXSA6IGdsb2JhbFtLRVldO1xuICBpZiAoREVTQ1JJUFRPUlMgJiYgQyAmJiAhQ1tTUEVDSUVTXSkgZFAuZihDLCBTUEVDSUVTLCB7XG4gICAgY29uZmlndXJhYmxlOiB0cnVlLFxuICAgIGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gdGhpczsgfVxuICB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDg3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///87\n")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(2)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItZGV0ZWN0LmpzPzc1OGQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgU0FGRV9DTE9TSU5HID0gZmFsc2U7XG5cbnRyeSB7XG4gIHZhciByaXRlciA9IFs3XVtJVEVSQVRPUl0oKTtcbiAgcml0ZXJbJ3JldHVybiddID0gZnVuY3Rpb24gKCkgeyBTQUZFX0NMT1NJTkcgPSB0cnVlOyB9O1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdGhyb3ctbGl0ZXJhbFxuICBBcnJheS5mcm9tKHJpdGVyLCBmdW5jdGlvbiAoKSB7IHRocm93IDI7IH0pO1xufSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGV4ZWMsIHNraXBDbG9zaW5nKSB7XG4gIGlmICghc2tpcENsb3NpbmcgJiYgIVNBRkVfQ0xPU0lORykgcmV0dXJuIGZhbHNlO1xuICB2YXIgc2FmZSA9IGZhbHNlO1xuICB0cnkge1xuICAgIHZhciBhcnIgPSBbN107XG4gICAgdmFyIGl0ZXIgPSBhcnJbSVRFUkFUT1JdKCk7XG4gICAgaXRlci5uZXh0ID0gZnVuY3Rpb24gKCkgeyByZXR1cm4geyBkb25lOiBzYWZlID0gdHJ1ZSB9OyB9O1xuICAgIGFycltJVEVSQVRPUl0gPSBmdW5jdGlvbiAoKSB7IHJldHVybiBpdGVyOyB9O1xuICAgIGV4ZWMoYXJyKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIHJldHVybiBzYWZlO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWRldGVjdC5qc1xuLy8gbW9kdWxlIGlkID0gODhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///88\n")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar speciesConstructor = __webpack_require__(56);\nvar promiseResolve = __webpack_require__(59);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnByb21pc2UuZmluYWxseS5qcz8xMmEwIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0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yBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLmZpbmFsbHkuanNcbi8vIG1vZHVsZSBpZCA9IDg5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///89\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(5);\nvar newPromiseCapability = __webpack_require__(37);\nvar perform = __webpack_require__(58);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnByb21pc2UudHJ5LmpzPzhjYTUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtcHJvbWlzZS10cnlcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgbmV3UHJvbWlzZUNhcGFiaWxpdHkgPSByZXF1aXJlKCcuL19uZXctcHJvbWlzZS1jYXBhYmlsaXR5Jyk7XG52YXIgcGVyZm9ybSA9IHJlcXVpcmUoJy4vX3BlcmZvcm0nKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdQcm9taXNlJywgeyAndHJ5JzogZnVuY3Rpb24gKGNhbGxiYWNrZm4pIHtcbiAgdmFyIHByb21pc2VDYXBhYmlsaXR5ID0gbmV3UHJvbWlzZUNhcGFiaWxpdHkuZih0aGlzKTtcbiAgdmFyIHJlc3VsdCA9IHBlcmZvcm0oY2FsbGJhY2tmbik7XG4gIChyZXN1bHQuZSA/IHByb21pc2VDYXBhYmlsaXR5LnJlamVjdCA6IHByb21pc2VDYXBhYmlsaXR5LnJlc29sdmUpKHJlc3VsdC52KTtcbiAgcmV0dXJuIHByb21pc2VDYXBhYmlsaXR5LnByb21pc2U7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnByb21pc2UudHJ5LmpzXG4vLyBtb2R1bGUgaWQgPSA5MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///90\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(92), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC9pdGVyYXRvci5qcz82NzM4Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///91\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(42);\n__webpack_require__(46);\nmodule.exports = __webpack_require__(39).f('iterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qcz9mZTdlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvcicpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX3drcy1leHQnKS5mKCdpdGVyYXRvcicpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gOTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///92\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(94), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC5qcz9lNTA1Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9zeW1ib2xcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvc3ltYm9sLmpzXG4vLyBtb2R1bGUgaWQgPSA5M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///93\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(95);\n__webpack_require__(52);\n__webpack_require__(100);\n__webpack_require__(101);\nmodule.exports = __webpack_require__(0).Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qcz8wNzA3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2LnN5bWJvbCcpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZycpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcuc3ltYm9sLmFzeW5jLWl0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuU3ltYm9sO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL3N5bWJvbC9pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gOTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///94\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(1);\nvar has = __webpack_require__(10);\nvar DESCRIPTORS = __webpack_require__(7);\nvar $export = __webpack_require__(5);\nvar redefine = __webpack_require__(54);\nvar META = __webpack_require__(96).KEY;\nvar $fails = __webpack_require__(13);\nvar shared = __webpack_require__(31);\nvar setToStringTag = __webpack_require__(23);\nvar uid = __webpack_require__(22);\nvar wks = __webpack_require__(2);\nvar wksExt = __webpack_require__(39);\nvar wksDefine = __webpack_require__(40);\nvar enumKeys = __webpack_require__(97);\nvar isArray = __webpack_require__(98);\nvar anObject = __webpack_require__(6);\nvar isObject = __webpack_require__(9);\nvar toIObject = __webpack_require__(12);\nvar toPrimitive = __webpack_require__(29);\nvar createDesc = __webpack_require__(21);\nvar _create = __webpack_require__(41);\nvar gOPNExt = __webpack_require__(99);\nvar $GOPD = __webpack_require__(51);\nvar $DP = __webpack_require__(8);\nvar $keys = __webpack_require__(19);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(61).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(27).f = $propertyIsEnumerable;\n __webpack_require__(47).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(15)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(11)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN5bWJvbC5qcz83ZDY3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEVDTUFTY3JpcHQgNiBzeW1ib2xzIHNoaW1cbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHJlZGVmaW5lID0gcmVxdWlyZSgnLi9fcmVkZWZpbmUnKTtcbnZhciBNRVRBID0gcmVxdWlyZSgnLi9fbWV0YScpLktFWTtcbnZhciAkZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIHNoYXJlZCA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbnZhciB3a3MgPSByZXF1aXJlKCcuL193a3MnKTtcbnZhciB3a3NFeHQgPSByZXF1aXJlKCcuL193a3MtZXh0Jyk7XG52YXIgd2tzRGVmaW5lID0gcmVxdWlyZSgnLi9fd2tzLWRlZmluZScpO1xudmFyIGVudW1LZXlzID0gcmVxdWlyZSgnLi9fZW51bS1rZXlzJyk7XG52YXIgaXNBcnJheSA9IHJlcXVpcmUoJy4vX2lzLWFycmF5Jyk7XG52YXIgYW5PY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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///95\n")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(22)('meta');\nvar isObject = __webpack_require__(9);\nvar has = __webpack_require__(10);\nvar setDesc = __webpack_require__(8).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(13)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset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Dtcbn07XG52YXIgbWV0YSA9IG1vZHVsZS5leHBvcnRzID0ge1xuICBLRVk6IE1FVEEsXG4gIE5FRUQ6IGZhbHNlLFxuICBmYXN0S2V5OiBmYXN0S2V5LFxuICBnZXRXZWFrOiBnZXRXZWFrLFxuICBvbkZyZWV6ZTogb25GcmVlemVcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbWV0YS5qc1xuLy8gbW9kdWxlIGlkID0gOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///96\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(19);\nvar gOPS = __webpack_require__(47);\nvar pIE = __webpack_require__(27);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return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NCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///97\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(16);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LmpzP2VkNDMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjIgSXNBcnJheShhcmd1bWVudClcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbm1vZHVsZS5leHBvcnRzID0gQXJyYXkuaXNBcnJheSB8fCBmdW5jdGlvbiBpc0FycmF5KGFyZykge1xuICByZXR1cm4gY29mKGFyZykgPT0gJ0FycmF5Jztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDk4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///98\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(12);\nvar gOPN = __webpack_require__(61).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qcz80NmI3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbGxiYWNrIGZvciBJRTExIGJ1Z2d5IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzIHdpdGggaWZyYW1lIGFuZCB3aW5kb3dcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgZ09QTiA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BuJykuZjtcbnZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG52YXIgd2luZG93TmFtZXMgPSB0eXBlb2Ygd2luZG93ID09ICdvYmplY3QnICYmIHdpbmRvdyAmJiBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lc1xuICA/IE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzKHdpbmRvdykgOiBbXTtcblxudmFyIGdldFdpbmRvd05hbWVzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGdPUE4oaXQpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgcmV0dXJuIHdpbmRvd05hbWVzLnNsaWNlKCk7XG4gIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzLmYgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eU5hbWVzKGl0KSB7XG4gIHJldHVybiB3aW5kb3dOYW1lcyAmJiB0b1N0cmluZy5jYWxsKGl0KSA9PSAnW29iamVjdCBXaW5kb3ddJyA/IGdldFdpbmRvd05hbWVzKGl0KSA6IGdPUE4odG9JT2JqZWN0KGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gOTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///99\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(40)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanM/Mzk4OSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL193a3MtZGVmaW5lJykoJ2FzeW5jSXRlcmF0b3InKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDEwMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///100\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(40)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZS5qcz80MTY3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKSgnb2JzZXJ2YWJsZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5vYnNlcnZhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///101\n")},,function(module,exports,__webpack_require__){eval("__webpack_require__(104);\nmodule.exports = __webpack_require__(0).Object.getPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LXByb3RvdHlwZS1vZi5qcz83ZDJlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3QuZ2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2dldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDEwM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///103\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(33);\nvar $getPrototypeOf = __webpack_require__(63);\n\n__webpack_require__(50)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qcz8yYTFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi45IE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdwbycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldFByb3RvdHlwZU9mJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gZnVuY3Rpb24gZ2V0UHJvdG90eXBlT2YoaXQpIHtcbiAgICByZXR1cm4gJGdldFByb3RvdHlwZU9mKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gMTA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///104\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(106), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz85MjIwIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZlwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gMTA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///105\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(107);\nmodule.exports = __webpack_require__(0).Object.setPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz84YmYwIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5zZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Quc2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L3NldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDEwNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///106\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(5);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(108).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qcz83YjE4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMy4xOSBPYmplY3Quc2V0UHJvdG90eXBlT2YoTywgcHJvdG8pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IHNldFByb3RvdHlwZU9mOiByZXF1aXJlKCcuL19zZXQtcHJvdG8nKS5zZXQgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDEwN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///107\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(9);\nvar anObject = __webpack_require__(6);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(17)(Function.call, __webpack_require__(51).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtcHJvdG8uanM/NjVhNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBXb3JrcyB3aXRoIF9fcHJvdG9fXyBvbmx5LiBPbGQgdjggY2FuJ3Qgd29yayB3aXRoIG51bGwgcHJvdG8gb2JqZWN0cy5cbi8qIGVzbGludC1kaXNhYmxlIG5vLXByb3RvICovXG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGNoZWNrID0gZnVuY3Rpb24gKE8sIHByb3RvKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBpZiAoIWlzT2JqZWN0KHByb3RvKSAmJiBwcm90byAhPT0gbnVsbCkgdGhyb3cgVHlwZUVycm9yKHByb3RvICsgXCI6IGNhbid0IHNldCBhcyBwcm90b3R5cGUhXCIpO1xufTtcbm1vZHVsZS5leHBvcnRzID0ge1xuICBzZXQ6IE9iamVjdC5zZXRQcm90b3R5cGVPZiB8fCAoJ19fcHJvdG9fXycgaW4ge30gPyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lXG4gICAgZnVuY3Rpb24gKHRlc3QsIGJ1Z2d5LCBzZXQpIHtcbiAgICAgIHRyeSB7XG4gICAgICAgIHNldCA9IHJlcXVpcmUoJy4vX2N0eCcpKEZ1bmN0aW9uLmNhbGwsIHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJykuZihPYmplY3QucHJvdG90eXBlLCAnX19wcm90b19fJykuc2V0LCAyKTtcbiAgICAgICAgc2V0KHRlc3QsIFtdKTtcbiAgICAgICAgYnVnZ3kgPSAhKHRlc3QgaW5zdGFuY2VvZiBBcnJheSk7XG4gICAgICB9IGNhdGNoIChlKSB7IGJ1Z2d5ID0gdHJ1ZTsgfVxuICAgICAgcmV0dXJuIGZ1bmN0aW9uIHNldFByb3RvdHlwZU9mKE8sIHByb3RvKSB7XG4gICAgICAgIGNoZWNrKE8sIHByb3RvKTtcbiAgICAgICAgaWYgKGJ1Z2d5KSBPLl9fcHJvdG9fXyA9IHByb3RvO1xuICAgICAgICBlbHNlIHNldChPLCBwcm90byk7XG4gICAgICAgIHJldHVybiBPO1xuICAgICAgfTtcbiAgICB9KHt9LCBmYWxzZSkgOiB1bmRlZmluZWQpLFxuICBjaGVjazogY2hlY2tcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXByb3RvLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///108\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(110), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvY3JlYXRlLmpzPzNhZjQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGVcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2NyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///109\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(111);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvY3JlYXRlLmpzP2EwY2UiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZScpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBjcmVhdGUoUCwgRCkge1xuICByZXR1cm4gJE9iamVjdC5jcmVhdGUoUCwgRCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDExMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///110\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(41) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuY3JlYXRlLmpzP2IwNWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4yIC8gMTUuMi4zLjUgT2JqZWN0LmNyZWF0ZShPIFssIFByb3BlcnRpZXNdKVxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IGNyZWF0ZTogcmVxdWlyZSgnLi9fb2JqZWN0LWNyZWF0ZScpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDExMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///111\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9qc29uL3N0cmluZ2lmeS5qcz9hYTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpO1xudmFyICRKU09OID0gY29yZS5KU09OIHx8IChjb3JlLkpTT04gPSB7IHN0cmluZ2lmeTogSlNPTi5zdHJpbmdpZnkgfSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHN0cmluZ2lmeShpdCkgeyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gIHJldHVybiAkSlNPTi5zdHJpbmdpZnkuYXBwbHkoJEpTT04sIGFyZ3VtZW50cyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSAxMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///112\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(114);\nmodule.exports = __webpack_require__(0).Object.keys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qcz84YzU2Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Qua2V5cztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///113\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(33);\nvar $keys = __webpack_require__(19);\n\n__webpack_require__(50)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qcz8wOWRjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCBPYmplY3Qua2V5cyhPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2tleXMnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBrZXlzKGl0KSB7XG4gICAgcmV0dXJuICRrZXlzKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///114\n")},,function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _getPrototypeOf = __webpack_require__(26);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _getOwnPropertyDescriptor = __webpack_require__(119);\n\nvar _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = (0, _getOwnPropertyDescriptor2.default)(object, property);\n\n if (desc === undefined) {\n var parent = (0, _getPrototypeOf2.default)(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9nZXQuanM/Yzg0YiJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF9nZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoXCIuLi9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpO1xuXG52YXIgX2dldFByb3RvdHlwZU9mMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2dldFByb3RvdHlwZU9mKTtcblxudmFyIF9nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IgPSByZXF1aXJlKFwiLi4vY29yZS1qcy9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yXCIpO1xuXG52YXIgX2dldE93blByb3BlcnR5RGVzY3JpcHRvcjIgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF9nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG5leHBvcnRzLmRlZmF1bHQgPSBmdW5jdGlvbiBnZXQob2JqZWN0LCBwcm9wZXJ0eSwgcmVjZWl2ZXIpIHtcbiAgaWYgKG9iamVjdCA9PT0gbnVsbCkgb2JqZWN0ID0gRnVuY3Rpb24ucHJvdG90eXBlO1xuICB2YXIgZGVzYyA9ICgwLCBfZ2V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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///116\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Operators = function () {\n function Operators() {\n (0, _classCallCheck3.default)(this, Operators);\n }\n\n (0, _createClass3.default)(Operators, [{\n key: 'and',\n value: function and(params) {\n return params[0] && params[1];\n }\n }, {\n key: 'between',\n value: function between(params) {\n var start = parseInt(params[0][0]);\n var end = parseInt(params[0][1]);\n var now = params[1];\n\n if (end < start) {\n now = now < start ? now += 2400 : now;\n end += 2400;\n }\n\n return now > start && now < end;\n }\n }, {\n key: 'equals',\n value: function equals(params) {\n return String(params[0]) === '*' || String(params[0]) === String(params[1]);\n }\n }, {\n key: 'greaterThan',\n value: function greaterThan(params) {\n return params[1] > params[0];\n }\n }, {\n key: 'in',\n value: function _in(params) {\n return params[0].indexOf(params[1]) > -1;\n }\n }, {\n key: 'lessThan',\n value: function lessThan(params) {\n return params[1] < params[0];\n }\n }, {\n key: 'not',\n value: function not(params) {\n return !params[0];\n }\n }, {\n key: 'or',\n value: function or(params) {\n return params[0] || params[1];\n }\n }]);\n return Operators;\n}();\n\nexports.default = Operators;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvT3BlcmF0b3JzLmpzPzFjNDIiXSwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgT3BlcmF0b3JzI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b2xpY3kvT3BlcmF0b3JzLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7Ozs7Ozs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///117\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(117);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a condition and evaluate its applicability.\n*/\nvar Condition = function () {\n\n /**\n * Creates a new Condition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function Condition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, Condition);\n\n this.attribute = attribute;\n this.operator = operator;\n this.params = params;\n this.operators = new _Operators2.default();\n }\n\n /**\n * Verifies if the condition is applicable to the message. First, the system value that corresponds to the attribute is retrieved; then, that value is compared with the parameter specified in the condition by executing the operator implementation. If the operator is 'in' and the name of a group is given, then the array holding the members of the group is retrieved before the comparison.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(Condition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n context[this.attribute] = { message: message };\n var value = context[this.attribute];\n var tempParam = void 0;\n\n if (this.operator === 'in') {\n if (!Array.isArray(this.params)) {\n tempParam = context.getGroup(this.params, message.to);\n return this.operators[this.operator]([tempParam, value]);\n }\n }\n\n return this.operators[this.operator]([this.params, value]);\n }\n }]);\n return Condition;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = Condition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9Db25kaXRpb24uanM/MmUzMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNi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cGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBdUJBO0FBQ0E7Ozs7O0FBQ0E7Ozs7QUFJQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBL0RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQW1FQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///118\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(120), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzJiYTEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2dldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gMTE5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///119\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(121);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n return $Object.getOwnPropertyDescriptor(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzcyNzkiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvcicpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSkge1xuICByZXR1cm4gJE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDEyMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///120\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(12);\nvar $getOwnPropertyDescriptor = __webpack_require__(51).f;\n\n__webpack_require__(50)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzg4ODkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjYgT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihPLCBQKVxudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciAkZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKS5mO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldE93blByb3BlcnR5RGVzY3JpcHRvcicsIGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcihpdCwga2V5KSB7XG4gICAgcmV0dXJuICRnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodG9JT2JqZWN0KGl0KSwga2V5KTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDEyMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///121\n")},,,,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(14);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(38);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ActionsService = __webpack_require__(144);\n\nvar _ActionsService2 = _interopRequireDefault(_ActionsService);\n\nvar _PDP = __webpack_require__(145);\n\nvar _PDP2 = _interopRequireDefault(_PDP);\n\nvar _Policy = __webpack_require__(146);\n\nvar _Policy2 = _interopRequireDefault(_Policy);\n\nvar _utils = __webpack_require__(36);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('PEP'); // Log System\n\nvar PEP = function () {\n\n /**\n * Creates a Policy Enforcement Point (PEP) instance\n * @param {Object} context\n */\n function PEP(context) {\n (0, _classCallCheck3.default)(this, PEP);\n\n var _this = this;\n\n _this.pdp = new _PDP2.default(context);\n _this.actionsService = new _ActionsService2.default(context);\n _this.context = context;\n context.pep = _this;\n\n //TODO should be added a trigger to verify when the loadConfigurations is successfully completed\n context.loadConfigurations();\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n\n (0, _createClass3.default)(PEP, [{\n key: 'addGUIListeners',\n value: function addGUIListeners() {\n var _this = this;\n\n _this.context.messageBus.addListener(_this.context.pepURL, function (msg) {\n var funcName = msg.body.method;\n\n var returnedValue = void 0;\n if (funcName === 'addToGroup') {\n var groupName = msg.body.params.groupName;\n var userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.addToGroup(groupName, userEmail);\n } else if (funcName === 'createGroup') {\n var _groupName = msg.body.params.groupName;\n returnedValue = _this.context.createGroup(_groupName);\n } else if (funcName === 'addPolicy') {\n var source = msg.body.params.source;\n var key = msg.body.params.key;\n var policy = msg.body.params.policy;\n var combiningAlgorithm = msg.body.params.combiningAlgorithm;\n returnedValue = _this.addPolicy(source, key, policy, combiningAlgorithm);\n } else if (funcName === 'deleteGroup') {\n var _groupName2 = msg.body.params.groupName;\n returnedValue = _this.context.deleteGroup(_groupName2);\n } else if (funcName === 'removePolicy') {\n var _source = msg.body.params.source;\n var _key = msg.body.params.key;\n returnedValue = _this.removePolicy(_source, _key);\n } else if (funcName === 'savePolicies') {\n var _source2 = msg.body.params.source;\n returnedValue = _this.context.savePolicies(_source2);\n } else if (funcName === 'userPolicies') {\n returnedValue = _this.context.userPolicies;\n } else if (funcName === 'activeUserPolicy') {\n var userPolicy = msg.body.params.userPolicy;\n if (userPolicy) {\n _this.context.activeUserPolicy = userPolicy;\n }\n returnedValue = _this.context.activeUserPolicy;\n } else if (funcName === 'userPolicy') {\n var _key2 = msg.body.params.key;\n returnedValue = _this.context.userPolicies[_key2];\n } else if (funcName === 'saveActivePolicy') {\n returnedValue = _this.context.saveActivePolicy();\n } else if (funcName === 'getMyEmails') {\n returnedValue = _this.context.getMyEmails();\n } else if (funcName === 'getMyHyperties') {\n returnedValue = _this.context.getMyHyperties();\n } else if (funcName === 'groups') {\n returnedValue = _this.context.groups;\n } else if (funcName === 'getGroupsNames') {\n returnedValue = _this.context.getGroupsNames();\n }if (funcName === 'removeFromGroup') {\n var _groupName3 = msg.body.params.groupName;\n var _userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.removeFromGroup(_groupName3, _userEmail);\n }\n\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n _this.context.messageBus.postMessage(replyMsg);\n });\n }\n\n /**\n * Adds a policy to the Policy Enforcement Point (PEP). The policy can be created by the service\n * provider or by the user.\n * @param {String} source\n * @param {String} key\n * @param {Object} policy\n */\n\n }, {\n key: 'addPolicy',\n value: function addPolicy(source, key, policy, combiningAlgorithm) {\n if (!source) throw new Error('source is not defined');\n if (!key) throw new Error('key is not defined');\n\n if (policy === undefined) {\n policy = new _Policy2.default(key, [], [], combiningAlgorithm);\n } else {\n if (!(policy instanceof _Policy2.default)) {\n policy = new _Policy2.default(policy.key, policy.rules, policy.actions, policy.combiningAlgorithm);\n }\n }\n\n switch (source) {\n case 'SERVICE_PROVIDER':\n this.context.savePolicies(source, policy, key);\n break;\n case 'USER':\n this.context.userPolicies[key] = policy;\n this.context.savePolicies(source);\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'authorise',\n value: function authorise(message, isIncoming) {\n var _this2 = this;\n\n // log.log('[Policy.PEP Authorise] ', message);\n // log.log(message);\n if (!message) throw new Error('message is not defined');\n if (!message.from) throw new Error('message.from is not defined');\n if (!message.to) throw new Error('message.to is not defined');\n if (!message.type) throw new Error('message.type is not defined');\n message.body = message.body || {};\n\n return new _promise2.default(function (resolve, reject) {\n\n message.body = message.body || {};\n var _this = _this2;\n\n var result = _this.pdp.evaluatePolicies(message, isIncoming);\n if (result === 'Not Applicable') {\n result = _this.context.defaultBehaviour;\n message.body.auth = false;\n }\n _this.actionsService.enforcePolicies(message, isIncoming).then(function (messages) {\n for (var i in messages) {\n message = messages[i];\n if (result) {\n message.body.auth = message.body.auth === undefined ? true : message.body.auth;\n resolve(message);\n } else {\n var errorMessage = { body: { code: 403, description: 'Blocked by policy' }, from: message.to, to: message.from, type: 'response' };\n reject(errorMessage);\n }\n }\n }, function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: 'authoriseSync',\n value: function authoriseSync(message) {\n var result = void 0;\n message.body = message.body || {};\n result = this.pdp.evaluatePolicies(message, true);\n if (result === 'Not Applicable') {\n result = this.context.defaultBehaviour;\n }\n return result;\n }\n }, {\n key: 'removePolicy',\n value: function removePolicy(source, key) {\n if (!source) throw new Error('source is not defined');\n if (source !== '*' && !key) throw new Error('key is not defined');\n\n switch (source) {\n case '*':\n this.context.serviceProviderPolicy = {};\n this.context.userPolicies = {};\n this.context.activeUserPolicy = undefined;\n this.context.savePolicies('USER');\n this.context.savePolicies('SERVICE_PROVIDER');\n this.context.saveActivePolicy();\n break;\n case 'SERVICE_PROVIDER':\n delete this.context.serviceProviderPolicy[key];\n this.context.savePolicies();\n break;\n case 'USER':\n delete this.context.userPolicies[key];\n if (key === this.context.activeUserPolicy) {\n this.context.activeUserPolicy = undefined;\n this.context.saveActivePolicy();\n }\n this.context.savePolicies('USER');\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this.context.messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this.context.messageBus = messageBus;\n _this.addGUIListeners();\n }\n }]);\n return PEP;\n}();\n\nexports.default = PEP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUEVQLmpzPzQ3ZjIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c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aXMuY29udGV4dC5kZWZhdWx0QmVoYXZpb3VyO1xuICAgIH1cbiAgICByZXR1cm4gcmVzdWx0O1xuXG4gIH1cblxuICByZW1vdmVQb2xpY3koc291cmNlLCBrZXkpIHtcbiAgICBpZiAoIXNvdXJjZSkgdGhyb3cgbmV3IEVycm9yKCdzb3VyY2UgaXMgbm90IGRlZmluZWQnKTtcbiAgICBpZiAoc291cmNlICE9PSAnKicgJiYgIWtleSkgdGhyb3cgbmV3IEVycm9yKCdrZXkgaXMgbm90IGRlZmluZWQnKTtcblxuICAgIHN3aXRjaCAoc291cmNlKSB7XG4gICAgICBjYXNlICcqJzpcbiAgICAgICAgdGhpcy5jb250ZXh0LnNlcnZpY2VQcm92aWRlclBvbGljeSA9IHt9O1xuICAgICAgICB0aGlzLmNvbnRleHQudXNlclBvbGljaWVzID0ge307XG4gICAgICAgIHRoaXMuY29udGV4dC5hY3RpdmVVc2VyUG9saWN5ID0gdW5kZWZpbmVkO1xuICAgICAgICB0aGlzLmNvbnRleHQuc2F2ZVBvbGljaWVzKCdVU0VSJyk7XG4gICAgICAgIHRoaXMuY29udGV4dC5zYXZlUG9saWNpZXMoJ1NFUlZJQ0VfUFJPVklERVInKTtcbiAgICAgICAgdGhpcy5jb250ZXh0LnNhdmVBY3RpdmVQb2xpY3koKTtcbiAgICAgICAgYnJlYWs7XG4gICAgICBjYXNlICdTRVJWSUNFX1BST1ZJREVSJzpcbiAgICAgICAgZGVsZXRlIHRoaXMuY29udGV4dC5zZXJ2aWNlUHJvdmlkZXJQb2xpY3lba2V5XTtcbiAgICAgICAgdGhpcy5jb250ZXh0LnNhdmVQb2xpY2llcygpO1xuICAgICAgICBicmVhaztcbiAgICAgIGNhc2UgJ1VTRVInOlxuICAgICAgICBkZWxldGUgdGhpcy5jb250ZXh0LnVzZXJQb2xpY2llc1trZXldO1xuICAgICAgICBpZiAoa2V5ID09PSB0aGlzLmNvbnRleHQuYWN0aXZlVXNlclBvbGljeSkge1xuICAgICAgICAgIH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__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(14);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ActionsService = function () {\n function ActionsService(context) {\n (0, _classCallCheck3.default)(this, ActionsService);\n\n this.context = context;\n }\n\n (0, _createClass3.default)(ActionsService, [{\n key: 'enforcePolicies',\n value: function enforcePolicies(message, isIncomingMessage) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n var policies = _this.context.getPolicies(message, isIncomingMessage);\n\n if (policies !== undefined) {\n if (policies.serviceProviderPolicy !== undefined) {\n policies.serviceProviderPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n if (policies.userPolicy !== undefined) {\n policies.userPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n }\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'forwardToID',\n value: function forwardToID(message, email) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve, reject) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n _this.context.runtimeRegistry.discoverHypertyPerUser(email).then(function (result) {\n message.to = result.hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'forwardToHyperty',\n value: function forwardToHyperty(message, hypertyURL) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n message.to = hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'sendAutomaticMessage',\n value: function sendAutomaticMessage(message, text) {\n var _this = this;\n return new _promise2.default(function (resolve) {\n var automaticMessage = {\n from: message.to,\n to: message.from,\n body: {\n value: text\n },\n type: message.type\n };\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(automaticMessage);\n });\n }\n }]);\n return ActionsService;\n}();\n\nexports.default = ActionsService;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvQWN0aW9uc1NlcnZpY2UuanM/MjliZCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBBY3Rpb25zU2VydmljZSB7XG5cbiAgY29uc3RydWN0b3IoY29udGV4dCkge1xuICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gIH1cblxuICBlbmZvcmNlUG9saWNpZXMobWVzc2FnZSwgaXNJbmNvbWluZ01lc3NhZ2UpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgIGxldCBwb2xpY2llcyA9IF90aGlzLmNvbnRleHQuZ2V0UG9saWNpZXMobWVzc2FnZSwgaXNJbmNvbWluZ01lc3NhZ2UpO1xuXG4gICAgICBpZiAocG9saWNpZXMgIT09IHVuZG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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBR0E7QUFOQTtBQVFBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///144\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(117);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* The Policy Decision Point (PDP) decides if a message is to be authorised by checking a set of\n* policies. The resource to be verified is specified in the first word of the 'condition' field of\n* a Policy object. The implementation that verifies if the message is compliant with a policy is\n* specified in a hashtable to allow dynamic definition of the implementation, providing\n* extensibility to the Policy Engine functionalities.\n*/\nvar PDP = function () {\n function PDP(context) {\n (0, _classCallCheck3.default)(this, PDP);\n\n this.context = context;\n this.operators = new _Operators2.default();\n }\n\n (0, _createClass3.default)(PDP, [{\n key: 'evaluatePolicies',\n value: function evaluatePolicies(message, isIncomingMessage) {\n var policies = this.context.getPolicies(message, isIncomingMessage);\n var result = 'Not Applicable';\n if (policies !== undefined) {\n result = this.evaluatePolicy(message, policies.serviceProviderPolicy, isIncomingMessage);\n if (result || result === 'Not Applicable') {\n var userResult = this.evaluatePolicy(message, policies.userPolicy, isIncomingMessage);\n if (userResult !== 'Not Applicable') {\n result = userResult;\n }\n }\n }\n\n return result;\n }\n }, {\n key: 'evaluatePolicy',\n value: function evaluatePolicy(message, policy, isIncoming) {\n var result = 'Not Applicable';\n if (policy) {\n result = policy.evaluateRules(this.context, message, isIncoming);\n }\n\n return result;\n }\n }]);\n return PDP;\n}();\n\nexports.default = PDP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUERQLmpzP2U5YmEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuL09wZXJhdG9ycyc7XG5cbi8qKlxuKiBUaGUgUG9saWN5IERlY2lzaW9uIFBvaW50IChQRFApIGRlY2lkZXMgaWYgYSBtZXNzYWdlIGlzIHRvIGJlIGF1dGhvcmlzZWQgYnkgY2hlY2tpbmcgYSBzZXQgb2ZcbiogcG9saWNpZXMuIFRoZSByZXNvdXJjZSB0byBiZSB2ZXJpZmllZCBpcyBzcGVjaWZpZWQgaW4gdGhlIGZpcnN0IHdvcmQgb2YgdGhlICdjb25kaXRpb24nIGZpZWxkIG9mXG4qIGEgUG9saWN5IG9iamVjdC4gVGhlIGltcGxlbWVudGF0aW9uIHRoYXQgdmVyaWZpZXMgaWYgdGhlIG1lc3NhZ2UgaXMgY29tcGxpYW50IHdpdGggYSBwb2xpY3kgaXNcbiogc3BlY2lmaWVkIGluIGEgaGFzaHRhYmxlIHRvIGFsbG93IGR5bmFtaWMgZGVmaW5pdGlvbiBvZiB0aGUgaW1wbGVtZW50YXRpb24sIHByb3ZpZGluZ1xuKiBleHRlbnNpYmlsaXR5IHRvIHRoZSBQb2xpY3kgRW5naW5lIGZ1bmN0aW9uYWxpdGllcy5cbiovXG5jbGFzcyBQRFAge1xuXG4gIGNvbnN0cnVjdG9yKGNvbnRleHQpIHtcbiAgICB0aGlzLmNvbnRleHQgPSBjb250ZXh0O1xuICAgIHRoaXMub3BlcmF0b3JzID0gbmV3IE9wZXJhdG9ycygpO1xuICB9XG5cbiAgZXZhbHVhdGVQb2xpY2llcyhtZXNzYWdlLCBpc0luY29taW5nTWVzc2FnZSkge1xuICAgIGxldCBwb2xpY2llcyA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UFBO0FBQ0E7Ozs7O0FBQ0E7Ozs7Ozs7QUFPQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///145\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(14);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AllowOverrides = __webpack_require__(147);\n\nvar _AllowOverrides2 = _interopRequireDefault(_AllowOverrides);\n\nvar _BlockOverrides = __webpack_require__(148);\n\nvar _BlockOverrides2 = _interopRequireDefault(_BlockOverrides);\n\nvar _FirstApplicable = __webpack_require__(149);\n\nvar _FirstApplicable2 = _interopRequireDefault(_FirstApplicable);\n\nvar _Rule = __webpack_require__(150);\n\nvar _Rule2 = _interopRequireDefault(_Rule);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Policy = function () {\n function Policy(key, rules, actions, combiningAlgorithm) {\n (0, _classCallCheck3.default)(this, Policy);\n\n if (!key) throw new Error('key is not defined');\n if (!actions) throw new Error('actions are not defined');\n\n this.actions = actions;\n this.key = key;\n this._setRules(rules);\n this._setCombiningAlgorithm(combiningAlgorithm);\n }\n\n (0, _createClass3.default)(Policy, [{\n key: 'addAction',\n value: function addAction(method, param) {\n this.actions.push({ method: method, param: param });\n }\n }, {\n key: 'createRule',\n value: function createRule(decision, condition, scope, target, priority) {\n if (priority === undefined) {\n priority = this.getLastPriority() + 1;\n }\n var rule = new _Rule2.default(decision, condition, scope, target, priority);\n this.rules.push(rule);\n }\n }, {\n key: 'deleteRule',\n value: function deleteRule(rule) {\n var indexToRemove = this.rules.indexOf(rule);\n this.rules.splice(indexToRemove, 1);\n }\n }, {\n key: 'enforceActions',\n value: function enforceActions(context, message) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var results = [];\n if (_this.actions.length !== 0) {\n for (var i in _this.actions) {\n var result = context.pep.actionsService[_this.actions[i].method](message, _this.actions[i].param);\n results.push(result);\n }\n _promise2.default.all(results).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'evaluateRules',\n value: function evaluateRules(context, message, isIncoming) {\n var results = [];\n for (var i in this.rules) {\n results.push(this.rules[i].evaluate(context, message, isIncoming));\n }\n\n return this.combiningAlgorithm.combine(results);\n }\n }, {\n key: 'getLastPriority',\n value: function getLastPriority() {\n var priorities = [];\n\n if (this.rules.length !== 0) {\n for (var i in this.rules) {\n priorities.push(this.rules[i].priority);\n }\n return Math.max.apply(Math, priorities);\n } else {\n return -1;\n }\n }\n }, {\n key: 'getRuleByPriority',\n value: function getRuleByPriority(priority) {\n for (var i in this.rules) {\n if (String(this.rules[i].priority) === String(priority)) {\n return this.rules[i];\n }\n }\n throw Error('Rule with priority ' + priority + ' does not exist!');\n }\n }, {\n key: '_setCombiningAlgorithm',\n value: function _setCombiningAlgorithm(combiningAlgorithm) {\n if (!combiningAlgorithm) {\n combiningAlgorithm = 'blockOverrides';\n }\n switch (combiningAlgorithm) {\n case 'blockOverrides':\n this.combiningAlgorithm = new _BlockOverrides2.default();\n break;\n case 'allowOverrides':\n this.combiningAlgorithm = new _AllowOverrides2.default();\n break;\n case 'firstApplicable':\n this.combiningAlgorithm = new _FirstApplicable2.default();\n break;\n default:\n throw Error('Unknown algorithm: ' + combiningAlgorithm);\n }\n }\n }, {\n key: '_setRules',\n value: function _setRules(rules) {\n this.rules = [];\n\n for (var i in rules) {\n var rule = rules[i];\n if (rule.priority === undefined) {\n rule.priority = this.getLastPriority() + 1;\n }\n if (!(rule instanceof _Rule2.default)) {\n rule = new _Rule2.default(rule.decision, rule.condition, rule.scope, rule.target, rule.priority);\n }\n this.rules.push(rule);\n }\n }\n }, {\n key: 'sortRules',\n value: function sortRules() {\n return this.rules.sort(function (a, b) {\n var x = a.priority;var y = b.priority;\n return x < y ? -1 : x > y ? 1 : 0;\n });\n }\n }]);\n return Policy;\n}();\n\nexports.default = Policy;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUG9saWN5LmpzPzk4NDMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEFsbG93T3ZlcnJpZGVzIGZyb20gJy4vY29tYmluaW5nQWxnb3JpdGhtcy9BbGxvd092ZXJyaWRlcyc7XG5pbXBvcnQgQmxvY2tPdmVycmlkZXMgZnJvbSAnLi9jb21iaW5pbmdBbGdvcml0aG1zL0Jsb2NrT3ZlcnJpZGVzJztcbmltcG9ydCBGaXJzdEFwcGxpY2FibGUgZnJvbSAnLi9jb21iaW5pbmdBbGdvcml0aG1zL0ZpcnN0QXBwbGljYWJsZSc7XG5pbXBvcnQgUnVsZSBmcm9tICcuL1J1bGUnO1xuXG5jbGFzcyBQb2xpY3kge1xuXG4gIGNvbnN0cnVjdG9yKGtleSwgcnVsZXMsIGFjdGlvbnMsIGNvbWJpbmluZ0FsZ29yaXRobSkge1xuICAgIGlmICgha2V5KSB0aHJvdyBuZXcgRXJyb3IoJ2tleSBpcyBub3QgZGVmaW5lZCcpO1xuICAgIGlmICghYW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QUNBOzs7OztBQUNBO0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVhBO0FBYUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///146\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar AllowOverrides = function () {\n function AllowOverrides() {\n (0, _classCallCheck3.default)(this, AllowOverrides);\n }\n\n (0, _createClass3.default)(AllowOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorization decisions, prioritizes a positive one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return AllowOverrides;\n}();\n\nexports.default = AllowOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9BbGxvd092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vbWJpbmluZ0FsZ29yaXRobXMvQWxsb3dPdmVycmlkZXMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///147\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar BlockOverrides = function () {\n function BlockOverrides() {\n (0, _classCallCheck3.default)(this, BlockOverrides);\n }\n\n (0, _createClass3.default)(BlockOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, prioritises a negative one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return BlockOverrides;\n}();\n\nexports.default = BlockOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9CbG9ja092ZXJyaWRlcy5qcz82MWM3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNl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tICAgIHtib29sZWFuW119ICAgZGVjaXNpb25zXG4gICogQHJldHVybnMgIHtib29sZWFufVxuICAqL1xuICBjb21iaW5lKGRlY2lzaW9ucykge1xuICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZihmYWxzZSkgIT09IC0xKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZih0cnVlKSAhPT0gLTEpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gJ05vdCBBcHBsaWNhYmxlJztcbiAgICAgIH1cbiAgICB9XG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBCbG9ja092ZXJyaWRlcztcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcG9saWN5L2NvbWJpbmluZ0FsZ29yaXRobXMvQmxvY2tPdmVycmlkZXMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///148\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar FirstApplicable = function () {\n function FirstApplicable() {\n (0, _classCallCheck3.default)(this, FirstApplicable);\n }\n\n (0, _createClass3.default)(FirstApplicable, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, returns the first one different from 'Not Applicable', either positive or negative.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n for (var i in decisions) {\n if (decisions[i] !== 'Not Applicable') {\n return decisions[i];\n }\n }\n return 'Not Applicable';\n }\n }]);\n return FirstApplicable;\n}();\n\nexports.default = FirstApplicable;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9GaXJzdEFwcGxpY2FibGUuanM/MzNkZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3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QTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///149\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AdvancedCondition = __webpack_require__(151);\n\nvar _AdvancedCondition2 = _interopRequireDefault(_AdvancedCondition);\n\nvar _Condition = __webpack_require__(118);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _utils = __webpack_require__(36);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Rule = function () {\n function Rule(decision, condition, scope, target, priority) {\n (0, _classCallCheck3.default)(this, Rule);\n\n this.decision = decision;\n this.setCondition(condition);\n this.priority = priority;\n this.scope = scope;\n this.target = target;\n }\n\n (0, _createClass3.default)(Rule, [{\n key: 'setCondition',\n value: function setCondition(condition) {\n if (!(condition instanceof _Condition2.default || condition instanceof _AdvancedCondition2.default || condition instanceof _AdvancedCondition2.default)) {\n var attribute = condition.attribute;\n switch (attribute) {\n case 'subscription':\n this.condition = new _AdvancedCondition2.default(condition.attribute, condition.operator, condition.params);\n break;\n case undefined:\n this.condition = new _AdvancedCondition2.default(condition);\n break;\n default:\n this.condition = new _Condition2.default(condition.attribute, condition.operator, condition.params);\n }\n } else {\n this.condition = condition;\n }\n }\n }, {\n key: 'evaluate',\n value: function evaluate(context, message, isIncoming) {\n var field = isIncoming ? message.to : message.from;\n var hypertyName = void 0;\n switch (this.scope) {\n case 'global':\n break;\n\n case 'hyperty':\n if ((0, _utils.isDataObjectURL)(field)) {\n var reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n if (reporter !== undefined) {\n hypertyName = context.runtimeRegistry.getHypertyName(reporter);\n }\n } else {\n if (field.split('://')[0] === 'hyperty') {\n hypertyName = context.runtimeRegistry.getHypertyName((0, _utils.removePathFromURL)(field));\n }\n }\n if (hypertyName === this.target) {\n break;\n }\n\n return 'Not Applicable';\n\n case 'identity':\n var owner = void 0;\n\n if ((0, _utils.isDataObjectURL)(field)) {\n var _reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n owner = context.runtimeRegistry.getHypertyOwner(_reporter);\n } else {\n if (field.split('://')[0] === 'hyperty') {\n owner = context.runtimeRegistry.getHypertyOwner((0, _utils.removePathFromURL)(field));\n }\n }\n if (owner !== undefined) {\n owner = (0, _utils.getUserEmailFromURL)(owner);\n }\n if (owner === this.target) {\n break;\n }\n\n return 'Not Applicable';\n }\n\n if (this.condition.isApplicable(context, message, this.scope, this.target)) {\n return this.decision;\n } else {\n return 'Not Applicable';\n }\n }\n }]);\n return Rule;\n}();\n\nexports.default = Rule;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUnVsZS5qcz9jOWU4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBBZHZhbmNlZENvbmRpdGlvbiBmcm9tICcuL2NvbmRpdGlvbnMvQWR2YW5jZWRDb25kaXRpb24nO1xuaW1wb3J0IENvbmRpdGlvbiBmcm9tICcuL2NvbmRpdGlvbnMvQ29uZGl0aW9uJztcbmltcG9ydCB7Z2V0VXNlckVtYWlsRnJvbVVSTCwgaXNEYXRhT2JqZWN0VVJMLCByZW1vdmVQYXRoRnJvb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ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChoeXBlcnR5TmFtZSA9PT0gdGhpcy50YXJnZXQpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAnTm90IEFwcGxpY2FibGUnO1xuXG4gICAgICBjYXNlICdpZGVudGl0eSc6XG4gICAgICAgIGxldCBvd25lcjtcblxuICAgICAgICBpZiAoaXNEYXRhT2JqZWN0VVJMKGZpZWxkKSkge1xuICAgICAgICAgIGxldCByZXBvcnRlciA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldFJlcG9ydGVyVVJMU3luY2hvbm91cyhyZW1vdmVQYXRoRnJvbVVSTChmaWVsZCkpO1xuICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlcG9ydGVyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoZmllbGQuc3BsaXQoJzovLycpWzBdID09PSAnaHlwZXJ0eScpIHtcbiAgICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvd25lciAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgb3duZXIgPSBnZXRVc2VyRW1haWxGcm9tVVJMKG93bmVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3duZXIgPT09IHRoaXMudGFyZ2V0KSB7XG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gJ05vdCBBcHBsaWNhYmxlJztcbiAgICB9XG5cbiAgICBpZiAodGhpcy5jb25kaXRpb24uaXNBcHBsaWNhYmxlKGNvbnRleHQsIG1lc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heck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Condition = __webpack_require__(118);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _Operators = __webpack_require__(117);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nvar _SubscriptionCondition = __webpack_require__(152);\n\nvar _SubscriptionCondition2 = _interopRequireDefault(_SubscriptionCondition);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AdvancedCondition = function () {\n function AdvancedCondition(condition) {\n (0, _classCallCheck3.default)(this, AdvancedCondition);\n\n this.operators = new _Operators2.default();\n if (condition.operators !== undefined) {\n condition = condition.condition;\n }\n condition = this.buildCondition(condition);\n this.condition = condition;\n }\n\n (0, _createClass3.default)(AdvancedCondition, [{\n key: 'buildCondition',\n value: function buildCondition(condition) {\n if (Array.isArray(condition[1])) {\n condition[1] = this.buildCondition(condition[1]);\n } else {\n if (condition[1].attribute === 'subscription') {\n condition[1] = new _SubscriptionCondition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n } else {\n condition[1] = new _Condition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n }\n }\n\n if (condition[2] !== undefined) {\n if (Array.isArray(condition[2])) {\n condition[2] = this.buildCondition(condition[2]);\n } else {\n if (condition[2].attribute === 'subscription') {\n condition[2] = new _SubscriptionCondition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n } else {\n condition[2] = new _Condition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n }\n }\n }\n return condition;\n }\n }, {\n key: 'isApplicable',\n value: function isApplicable(context, message, scope, target, operator, left, right) {\n if (!operator) {\n operator = this.condition[0];\n left = this.condition[1];\n right = this.condition[2];\n }\n\n while (!(left instanceof _Condition2.default) & !(left instanceof _SubscriptionCondition2.default) & typeof left !== 'boolean') {\n left = this.isApplicable(context, message, scope, target, left[0], left[1], left[2]);\n }\n if (right !== undefined) {\n while (!(right instanceof _Condition2.default) & !(right instanceof _SubscriptionCondition2.default) & typeof right !== 'boolean') {\n right = this.isApplicable(context, message, scope, target, right[0], right[1], right[2]);\n }\n }\n\n var resultLeft = typeof left === 'boolean' ? left : left.isApplicable(context, message, scope, target);\n var resultRight = void 0;\n if (right !== undefined) {\n resultRight = typeof right === 'boolean' ? right : right.isApplicable(context, message, scope, target);\n }\n return this.operators[operator]([resultLeft, resultRight]);\n }\n }]);\n return AdvancedCondition;\n}();\n\nexports.default = AdvancedCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9BZHZhbmNlZENvbmRpdGlvbi5qcz9iZDBmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb25kaXRpb24gZnJvbSAnLi9Db25kaXRpb24nO1xuaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuLi9PcGVyYXRvcnMnO1xuaW1wb3J0IFN1YnNjcmlwdGlvbkNvbmRpdGlvbiBmcm9tICcuL1N1YnNjcmlwdGlvbkNvbmRpdGlvbic7XG5cbmNsYXNzIEFkdmFuY2VkQ29uZGl0aW9uIHtcblxuICBjb25zdHJ1Y3Rvcihjb25kaXRpb24pIHtcbiAgICB0aGlzLm9wZXJhdG9ycyA9IG5ldyBPcGVyYXRvcnMoKTtcbiAgICBpZiAoY29uZGl0aW9uLm9wZXJhdG9ycyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICBjb25kaXRpb24gPSBjb25kaXRpb24uY29uZGl0aW9uO1xuICAgIH1cbiAgICBjb25kaXRpb24gPSB0aGlzLmJ1aWxkQ29uZGl0aW9uKGNvbmRpdGlvbik7XG4gICAgdGhpcy5jb25kaXRpb24gPSBj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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///151\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(26);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(34);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(116);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(35);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _Condition2 = __webpack_require__(118);\n\nvar _Condition3 = _interopRequireDefault(_Condition2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a subscription condition and evaluate its applicability.\n*/\nvar SubscriptionCondition = function (_Condition) {\n (0, _inherits3.default)(SubscriptionCondition, _Condition);\n\n /**\n * Creates a new SubscriptionCondition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function SubscriptionCondition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, SubscriptionCondition);\n return (0, _possibleConstructorReturn3.default)(this, (SubscriptionCondition.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition)).call(this, attribute, operator, params));\n }\n\n /**\n * Verifies if the subscription condition is applicable to the message. First, verifies if the message is of the subscription type; second, verifies if the message is from a remote runtime to guarantee that the subscription is being validated in the destination runtime; third, verifies if the subscription preference is met.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(SubscriptionCondition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n var isSubscription = message.type === 'subscribe';\n var isFromRemoteSM = context.isFromRemoteSM(message.from);\n if (isSubscription & isFromRemoteSM) {\n return (0, _get3.default)(SubscriptionCondition.prototype.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition.prototype), 'isApplicable', this).call(this, context, message);\n } else {\n return false;\n }\n }\n }]);\n return SubscriptionCondition;\n}(_Condition3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = SubscriptionCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9TdWJzY3JpcHRpb25Db25kaXRpb24uanM/YTkwMyJdLCJzb3VyY2V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QUlBOzs7QUFFQTs7Ozs7OztBQU9BO0FBQUE7QUFBQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQkE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBOEJBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///152\n")}])}); \ No newline at end of file diff --git a/dist/ReThinkCtx.js b/dist/ReThinkCtx.js index a22a392d..9e0cee1c 100644 --- a/dist/ReThinkCtx.js +++ b/dist/ReThinkCtx.js @@ -1,5 +1,5 @@ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -25,8 +25,8 @@ **/ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -52,4 +52,4 @@ **/ -!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("ReThinkCtx",[],e):"object"==typeof exports?exports.ReThinkCtx=e():n.ReThinkCtx=e()}("undefined"!=typeof self?self:this,function(){return function(n){var e={};function c(t){if(e[t])return e[t].exports;var l=e[t]={i:t,l:!1,exports:{}};return n[t].call(l.exports,l,l.exports,c),l.l=!0,l.exports}return c.m=n,c.c=e,c.d=function(n,e,t){c.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},c.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return c.d(e,"a",e),e},c.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},c.p="",c(c.s=150)}([function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz8xNWUwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjUuNycgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZ2xvYmFsLmpzP2VjYWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzg2I2lzc3VlY29tbWVudC0xMTU3NTkwMjhcbnZhciBnbG9iYWwgPSBtb2R1bGUuZXhwb3J0cyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93Lk1hdGggPT0gTWF0aFxuICA/IHdpbmRvdyA6IHR5cGVvZiBzZWxmICE9ICd1bmRlZmluZWQnICYmIHNlbGYuTWF0aCA9PSBNYXRoID8gc2VsZlxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tbmV3LWZ1bmNcbiAgOiBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuaWYgKHR5cGVvZiBfX2cgPT0gJ251bWJlcicpIF9fZyA9IGdsb2JhbDsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},,function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY2xhc3NDYWxsQ2hlY2suanM/NjZiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(64);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanM/YzMxMCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF9kZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoXCIuLi9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHlcIik7XG5cbnZhciBfZGVmaW5lUHJvcGVydHkyID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfZGVmaW5lUHJvcGVydHkpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG5leHBvcnRzLmRlZmF1bHQgPSBmdW5jdGlvbiAoKSB7XG4gIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXModGFyZ2V0LCBwcm9wcykge1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcHJvcHMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBkZXNjcmlwdG9yID0gcHJvcHNbaV07XG4gICAgICBkZXNjcmlwdG9yLmVudW1lcmFibGUgPSBkZXNjcmlwdG9yLmVudW1lcmFibGUgfHwgZmFsc2U7XG4gICAgICBkZXNjcmlwdG9yLmNvbmZpZ3VyYWJsZSA9IHRydWU7XG4gICAgICBpZiAoXCJ2YWx1ZVwiIGluIGRlc2NyaXB0b3IpIGRlc2NyaXB0b3Iud3JpdGFibGUgPSB0cnVlO1xuICAgICAgKDAsIF9kZWZpbmVQcm9wZXJ0eTIuZGVmYXVsdCkodGFyZ2V0LCBkZXNjcmlwdG9yLmtleSwgZGVzY3JpcHRvcik7XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIGZ1bmN0aW9uIChDb25zdHJ1Y3RvciwgcHJvdG9Qcm9wcywgc3RhdGljUHJvcHMpIHtcbiAgICBpZiAocHJvdG9Qcm9wcykgZGVmaW5lUHJvcGVydGllcyhDb25zdHJ1Y3Rvci5wcm90b3R5cGUsIHByb3RvUHJvcHMpO1xuICAgIGlmIChzdGF0aWNQcm9wcykgZGVmaW5lUHJvcGVydGllcyhDb25zdHJ1Y3Rvciwgc3RhdGljUHJvcHMpO1xuICAgIHJldHVybiBDb25zdHJ1Y3RvcjtcbiAgfTtcbn0oKTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanNcbi8vIG1vZHVsZSBpZCA9IDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///4\n')},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar ctx = __webpack_require__(16);\nvar hide = __webpack_require__(11);\nvar has = __webpack_require__(10);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL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7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzXG4vLyBtb2R1bGUgaWQgPSA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYW4tb2JqZWN0LmpzP2VmYjMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoIWlzT2JqZWN0KGl0KSkgdGhyb3cgVHlwZUVycm9yKGl0ICsgJyBpcyBub3QgYW4gb2JqZWN0IScpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(13)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/Zjg0ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(6);\nvar IE8_DOM_DEFINE = __webpack_require__(43);\nvar toPrimitive = __webpack_require__(29);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwLmpzPzdhZjAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgSUU4X0RPTV9ERUZJTkUgPSByZXF1aXJlKCcuL19pZTgtZG9tLWRlZmluZScpO1xudmFyIHRvUHJpbWl0aXZlID0gcmVxdWlyZSgnLi9fdG8tcHJpbWl0aXZlJyk7XG52YXIgZFAgPSBPYmplY3QuZGVmaW5lUHJvcGVydHk7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBPYmplY3QuZGVmaW5lUHJvcGVydHkgOiBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBQID0gdG9QcmltaXRpdmUoUCwgdHJ1ZSk7XG4gIGFuT2JqZWN0KEF0dHJpYnV0ZXMpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGRQKE8sIFAsIEF0dHJpYnV0ZXMpO1xuICB9IGNhdGNoIChlKSB7IC8qIGVtcHR5ICovIH1cbiAgaWYgKCdnZXQnIGluIEF0dHJpYnV0ZXMgfHwgJ3NldCcgaW4gQXR0cmlidXRlcykgdGhyb3cgVHlwZUVycm9yKCdBY2Nlc3NvcnMgbm90IHN1cHBvcnRlZCEnKTtcbiAgaWYgKCd2YWx1ZScgaW4gQXR0cmlidXRlcykgT1tQXSA9IEF0dHJpYnV0ZXMudmFsdWU7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///8\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzEyYTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz8wZjYyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(8);\nvar createDesc = __webpack_require__(21);\nmodule.exports = __webpack_require__(7) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ODQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(62);\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NGRjNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSAxM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///13\n")},function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gMTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///14\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(20);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n")},,,function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(44);\nvar enumBugKeys = __webpack_require__(32);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///21\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},,function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/NTJlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/ZTc2OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///25\n')},,,function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar document = __webpack_require__(1).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/MzhkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAyOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(9);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8zMjYzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIFRvUHJpbWl0aXZlKGlucHV0IFssIFByZWZlcnJlZFR5cGVdKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG4vLyBpbnN0ZWFkIG9mIHRoZSBFUzYgc3BlYyB2ZXJzaW9uLCB3ZSBkaWRuJ3QgaW1wbGVtZW50IEBAdG9QcmltaXRpdmUgY2FzZVxuLy8gYW5kIHRoZSBzZWNvbmQgYXJndW1lbnQgLSBmbGFnIC0gcHJlZmVycmVkIHR5cGUgaXMgYSBzdHJpbmdcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBTKSB7XG4gIGlmICghaXNPYmplY3QoaXQpKSByZXR1cm4gaXQ7XG4gIHZhciBmbiwgdmFsO1xuICBpZiAoUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgaWYgKHR5cGVvZiAoZm4gPSBpdC52YWx1ZU9mKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIGlmICghUyAmJiB0eXBlb2YgKGZuID0gaXQudG9TdHJpbmcpID09ICdmdW5jdGlvbicgJiYgIWlzT2JqZWN0KHZhbCA9IGZuLmNhbGwoaXQpKSkgcmV0dXJuIHZhbDtcbiAgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY29udmVydCBvYmplY3QgdG8gcHJpbWl0aXZlIHZhbHVlXCIpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1wcmltaXRpdmUuanNcbi8vIG1vZHVsZSBpZCA9IDI5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(31)('keys');\nvar uid = __webpack_require__(22);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/NmIxZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAzMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///30\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(14) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9u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ifQ==\n//# sourceURL=webpack-internal:///31\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YzY3NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///32\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///33\n")},,,function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(69);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _keys = __webpack_require__(48);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.divideURL = divideURL;\nexports.emptyObject = emptyObject;\nexports.secondsSinceEpoch = secondsSinceEpoch;\nexports.deepClone = deepClone;\nexports.removePathFromURL = removePathFromURL;\nexports.getUserURLFromEmail = getUserURLFromEmail;\nexports.getUserEmailFromURL = getUserEmailFromURL;\nexports.convertToUserURL = convertToUserURL;\nexports.isDataObjectURL = isDataObjectURL;\nexports.isLegacy = isLegacy;\nexports.isURL = isURL;\nexports.isUserURL = isUserURL;\nexports.isHypertyURL = isHypertyURL;\nexports.getConfigurationResources = getConfigurationResources;\nexports.buildURL = buildURL;\nexports.generateGUID = generateGUID;\nexports.getUserIdentityDomain = getUserIdentityDomain;\nexports.isBackendServiceURL = isBackendServiceURL;\nexports.divideEmail = divideEmail;\nexports.assign = assign;\nexports.splitObjectURL = splitObjectURL;\nexports.checkAttribute = checkAttribute;\nexports.parseAttributes = parseAttributes;\nexports.isEmpty = isEmpty;\nexports.chatkeysToStringCloner = chatkeysToStringCloner;\nexports.chatkeysToArrayCloner = chatkeysToArrayCloner;\nexports.parseMessageURL = parseMessageURL;\nexports.availableSpace = availableSpace;\nexports.encode = encode;\nexports.decode = decode;\nexports.decodeToUint8Array = decodeToUint8Array;\nexports.stringify = stringify;\nexports.parse = parse;\nexports.parseToUint8Array = parseToUint8Array;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * Support module with some functions will be useful\n * @module utils\n */\n\n/**\n * @typedef divideURL\n * @type Object\n * @property {string} type The type of URL\n * @property {string} domain The domain of URL\n * @property {string} identity The identity of URL\n */\n\n/**\n * Divide an url in type, domain and identity\n * @param {URL.URL} url - url address\n * @return {divideURL} the result of divideURL\n */\nfunction divideURL(url) {\n\n function recurse(value) {\n var regex = /([a-zA-Z-]*)(:\\/\\/(?:\\.)?|:)([-a-zA-Z0-9@:%._+~#=]{2,256})([-a-zA-Z0-9@:%._+~#=/]*)/gi;\n var subst = '$1,$3,$4';\n var parts = value.replace(regex, subst).split(',');\n return parts;\n }\n\n var parts = recurse(url);\n\n // If the url has no scheme\n if (parts[0] === url && !parts[0].includes('@')) {\n\n var _result = {\n type: '',\n domain: url,\n identity: ''\n };\n\n console.warn('[DivideURL] DivideURL don\\'t support url without scheme. Please review your url address', url);\n\n return _result;\n }\n\n // check if the url has the scheme and includes an @\n if (parts[0] === url && parts[0].includes('@')) {\n var scheme = parts[0] === url ? 'smtp' : parts[0];\n parts = recurse(scheme + '://' + parts[0]);\n }\n\n // if the domain includes an @, divide it to domain and identity respectively\n if (parts[1].includes('@')) {\n parts[2] = parts[0] + '://' + parts[1];\n parts[1] = parts[1].substr(parts[1].indexOf('@') + 1);\n } /*else if (parts[2].includes('/')) {\n parts[2] = parts[2].substr(parts[2].lastIndexOf('/')+1);\n }*/\n\n var result = {\n type: parts[0],\n domain: parts[1],\n identity: parts[2]\n };\n\n return result;\n}\n\n/**\n * Check if an Object is empty\n * @param {Object} object Object to be checked\n * @return {Boolean} status of Object, empty or not (true|false);\n */\nfunction emptyObject(object) {\n return (0, _keys2.default)(object).length > 0 ? false : true;\n}\n\nfunction secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n}\n\n/**\n * Make a COPY of the original data\n * @param {Object} obj - object to be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n //TODO: simple but inefficient JSON deep clone...\n if (obj) return JSON.parse((0, _stringify2.default)(obj));\n}\n\nfunction removePathFromURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n}\n\n/**\n * Obtains the user URL that corresponds to a given email\n * @param {string} userEmail The user email\n * @return {URL.URL} userURL The user URL\n */\nfunction getUserURLFromEmail(userEmail) {\n var indexOfAt = userEmail.indexOf('@');\n return 'user://' + userEmail.substring(indexOfAt + 1, userEmail.length) + '/' + userEmail.substring(0, indexOfAt);\n}\n\n/**\n * Obtains the user email that corresponds to a given URL\n * @param {URL.URL} userURL The user URL\n * @return {string} userEmail The user email\n */\nfunction getUserEmailFromURL(userURL) {\n var url = divideURL(userURL);\n return url.identity.replace('/', '') + '@' + url.domain; // identity field has '/exampleID' instead of 'exampleID'\n}\n\n/**\n * Check if the user identifier is already in the URL format, if not, convert to URL format\n * @param {string} identifier user identifier\n * @return {string} userURL the user URL\n */\nfunction convertToUserURL(identifier) {\n\n // check if the identifier is already in the url format\n if (identifier.substring(0, 7) === 'user://') {\n var dividedURL = divideURL(identifier);\n\n //check if the url is well formated\n if (dividedURL.domain && dividedURL.identity) {\n return identifier;\n } else {\n throw 'userURL with wrong format';\n }\n\n //if not, convert the user email to URL format\n } else {\n return getUserURLFromEmail(identifier);\n }\n}\n\nfunction isDataObjectURL(url) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain', 'hyperty'];\n var splitURL = url.split('://');\n var urlSchema = splitURL[0];\n\n return schemasToIgnore.indexOf(urlSchema) === -1;\n}\n\nfunction isLegacy(url) {\n if (url.split('@').length > 1) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction isURL(url) {\n return url.split('/').length >= 3;\n}\n\nfunction isUserURL(url) {\n return divideURL(url).type === 'user';\n}\n\nfunction isHypertyURL(url) {\n return divideURL(url).type === 'hyperty';\n}\n\n/**\n * get information relative each component configured on runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @return {object} return an object with all configurations;\n */\nfunction getConfigurationResources(configuration, component, resource) {\n var objectResource = configuration[component];\n var resourceType = objectResource[resource];\n\n return resourceType;\n}\n\n/**\n * Build a full url with the runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @param {string} type resource to get, like a hyperty name or protocolstub name;\n * @param {boolean} useFallback if true the function will check if have a fallback url;\n * @return {string} partial url to contact the resource;\n */\nfunction buildURL(configuration, component, resource, type) {\n var useFallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n var objectResource = configuration[component];\n var url = void 0;\n\n if (!objectResource.hasOwnProperty(resource)) {\n throw Error('The configuration ' + (0, _stringify2.default)(objectResource, '', 2) + ' don\\'t have the ' + resource + ' resource you are looking for');\n }\n\n var resourceType = objectResource[resource];\n\n if (type) {\n url = resourceType.prefix + configuration.domain + resourceType.suffix + type;\n if (resourceType.hasOwnProperty('fallback') && useFallback) {\n if (resourceType.fallback.indexOf('%domain%')) {\n url = resourceType.fallback.replace(/(%domain%)/g, configuration.domain) + type;\n } else {\n url = resourceType.fallback + type;\n }\n }\n } else {\n url = resourceType.prefix + configuration.domain + resourceType.suffix;\n }\n\n // console.log(url);\n\n return url;\n}\n\n/**\n * Generate a Global Unique ID\n *\n * @returns String;\n */\nfunction generateGUID() {\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\nfunction getUserIdentityDomain(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var splitedLength = splitedDomain.length;\n if (splitedLength == 1) {\n return splitedDomain[splitedLength - 1];\n }\n var domain = splitedDomain[splitedLength - 2] + '.' + splitedDomain[splitedLength - 1];\n return domain;\n}\n\n/**\n * Check if URL is from a backend service\n * @param {string} url URL to be processed\n * @return {boolean}\n */\n\nfunction isBackendServiceURL(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var backendSchemes = ['domain', 'global', 'domain-idp']; // should be defined in the runtime configuration\n var backendSubDomains = ['registry', 'msg-node']; // should be defined in the runtime configuration\n var subDomain = void 0;\n\n if (splitedDomain.length > 1) {\n subDomain = splitedDomain.filter(function (item) {\n return backendSubDomains.indexOf(item) !== -1;\n })[0];\n }\n\n if (subDomain && backendSubDomains.indexOf(subDomain) !== -1) {\n return true;\n }\n\n if (dividedURL.type) {\n return backendSchemes.indexOf(dividedURL.type) !== -1;\n }\n\n return false;\n}\n\nfunction divideEmail(email) {\n var indexOfAt = email.indexOf('@');\n\n var result = {\n username: email.substring(0, indexOfAt),\n domain: email.substring(indexOfAt + 1, email.length)\n };\n\n return result;\n}\n\nfunction assign(obj, keyPath, value) {\n\n if (!obj) obj = {};\n if (typeof keyPath === 'string') keyPath = parseAttributes(keyPath);\n\n var lastKeyIndex = keyPath.length - 1;\n\n for (var i = 0; i < lastKeyIndex; ++i) {\n var key = keyPath[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n obj[keyPath[lastKeyIndex]] = value;\n}\n\nfunction splitObjectURL(dataObjectURL) {\n console.info('[utils - splitObjectURL]: ', dataObjectURL);\n\n var splitedURL = dataObjectURL.split('/');\n var url = splitedURL[0] + '//' + splitedURL[2] + '/' + splitedURL[3];\n var resource = splitedURL[5];\n\n var result = {\n url: url,\n resource: resource\n };\n\n console.info('[utils - splitObjectURL]: ', result);\n\n return result;\n}\n\nfunction checkAttribute(path) {\n\n var regex = /((([a-zA-Z]+):\\/\\/([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\\/[a-zA-Z0-9.]+@[a-zA-Z0-9]+(-)?[a-zA-Z0-9]+(\\.)?[a-zA-Z0-9]{2,10}?\\.[a-zA-Z]{2,10})(.+(?=.identity))?/gm;\n\n var list = [];\n var final = [];\n var test = path.match(regex);\n\n if (test == null) {\n final = path.split('.');\n } else {\n var m = void 0;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach(function (match, groupIndex) {\n if (groupIndex === 0) {\n list.push(match);\n }\n });\n }\n var result = void 0;\n list.forEach(function (url) {\n\n result = path.replace(url, '*-*');\n final = result.split('.').map(function (item) {\n\n if (item === '*-*') {\n return url;\n }\n\n return item;\n });\n });\n }\n\n console.log('[RuntimeCore.Utils.checkAttribute]', final);\n return final;\n}\n\nfunction parseAttributes(path) {\n var regex = /([0-9a-zA-Z][-\\w]*):\\/\\//g;\n\n var string3 = 'identity';\n\n if (!path.includes('://')) {\n return path.split('.');\n } else {\n var string1 = path.split(regex)[0];\n\n var array1 = string1.split('.');\n\n var string2 = path.replace(string1, '');\n\n if (path.includes(string3)) {\n\n var array2 = string2.split(string3 + '.');\n\n console.log('array2 ' + array2);\n\n string2 = array2[0].slice('.', -1);\n\n array2 = array2[1].split('.');\n\n array1.push(string2, string3);\n\n array1 = array1.concat(array2);\n } else {\n array1.push(string2);\n }\n\n return array1.filter(Boolean);\n }\n}\n\nfunction isEmpty(obj) {\n for (var prop in obj) {\n\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return (0, _stringify2.default)(obj) === (0, _stringify2.default)({});\n}\n\nfunction chatkeysToStringCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n dataObjectSessionKeysClone[field].sessionKey = sessionKeys[field].sessionKey.toString();\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToStringCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction chatkeysToArrayCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n var arrayValues = JSON.parse('[' + sessionKeys[field].sessionKey + ']');\n dataObjectSessionKeysClone[field].sessionKey = new Uint8Array(arrayValues);\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToArrayCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction parseMessageURL(URL) {\n var splitedToURL = URL.split('/');\n if (splitedToURL.length <= 6) {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3];\n } else {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3] + '/' + splitedToURL[4];\n }\n}\n\nfunction availableSpace(usage, quota) {\n var available = (usage / quota).toFixed(2);\n return {\n quota: quota,\n usage: usage,\n percent: Number(available)\n };\n}\n\n/**\n* Encodes a JS object to base 64 encode\n* @param {Object} value byteArray value\n* @return {string} encoded value\n*/\nfunction encode(value) {\n try {\n var stringValue = stringify(value);\n return btoa(stringValue);\n } catch (err) {\n console.error('[Utils.encode:err] ' + err);\n throw err;\n }\n}\n\n/**\n * Decode a base64 string to object\n * @param {string_b64} value value encoded in base 64\n * @return {Object} decodedValue\n */\nfunction decode(value) {\n try {\n return JSON.parse(atob(value));\n } catch (err) {\n console.log('[Utils.decode:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Decode a base64 string to Uint8Array\n* @param {string_b64} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction decodeToUint8Array(value) {\n try {\n return new Uint8Array(decode(value));\n } catch (err) {\n console.error('[Utils.decodeToUint8Array:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a JS object to string\n* NOTE: Special conversion for Uint8Arrays\n* @param {Object} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction stringify(value) {\n try {\n var stringValue = void 0;\n if (value.constructor === Uint8Array) {\n stringValue = '[' + value.toString() + ']'; // the [] is for JSON.parse compatibility\n } else {\n stringValue = (0, _stringify2.default)(value);\n }\n return stringValue;\n } catch (err) {\n console.error('[Utils.stringify:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Object} encoded value\n*/\nfunction parse(value) {\n try {\n return JSON.parse(value);\n } catch (err) {\n console.error('[Utils.parse:err]' + err);\n console.trace();\n console.error('That that cause the error:', value);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction parseToUint8Array(value) {\n try {\n return new Uint8Array(parse(value));\n } catch (err) {\n console.error('[Utils.parseToUint8Array:err]' + err);\n throw err;\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL3V0aWxzL3V0aWxzLmpzP2JlNzMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgV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FDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n")},,,,,,,function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(7) && !__webpack_require__(13)(function () {\n return Object.defineProperty(__webpack_require__(28)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzPzQ5ZjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(10);\nvar toIObject = __webpack_require__(12);\nvar arrayIndexOf = __webpack_require__(65)(false);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzPzIxYjgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUluZGV4T2YgPSByZXF1aXJlKCcuL19hcnJheS1pbmNsdWRlcycpKGZhbHNlKTtcbnZhciBJRV9QUk9UTyA9IHJlcXVpcmUoJy4vX3NoYXJlZC1rZXknKSgnSUVfUFJPVE8nKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBuYW1lcykge1xuICB2YXIgTyA9IHRvSU9iamVjdChvYmplY3QpO1xuICB2YXIgaSA9IDA7XG4gIHZhciByZXN1bHQgPSBbXTtcbiAgdmFyIGtleTtcbiAgZm9yIChrZXkgaW4gTykgaWYgKGtleSAhPSBJRV9QUk9UTykgaGFzKE8sIGtleSkgJiYgcmVzdWx0LnB1c2goa2V5KTtcbiAgLy8gRG9uJ3QgZW51bSBidWcgJiBoaWRkZW4ga2V5c1xuICB3aGlsZSAobmFtZXMubGVuZ3RoID4gaSkgaWYgKGhhcyhPLCBrZXkgPSBuYW1lc1tpKytdKSkge1xuICAgIH5hcnJheUluZGV4T2YocmVzdWx0LCBrZXkpIHx8IHJlc3VsdC5wdXNoKGtleSk7XG4gIH1cbiAgcmV0dXJuIHJlc3VsdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDQ0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(24);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz80MTExIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n")},,,function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(112), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzPzdkOTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9rZXlzXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA0OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSA0IDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///48\n')},,function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar fails = __webpack_require__(13);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1zYXAuanM/YmFhNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBtb3N0IE9iamVjdCBtZXRob2RzIGJ5IEVTNiBzaG91bGQgYWNjZXB0IHByaW1pdGl2ZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVksIGV4ZWMpIHtcbiAgdmFyIGZuID0gKGNvcmUuT2JqZWN0IHx8IHt9KVtLRVldIHx8IE9iamVjdFtLRVldO1xuICB2YXIgZXhwID0ge307XG4gIGV4cFtLRVldID0gZXhlYyhmbik7XG4gICRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogZmFpbHMoZnVuY3Rpb24gKCkgeyBmbigxKTsgfSksICdPYmplY3QnLCBleHApO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzXG4vLyBtb2R1bGUgaWQgPSA1MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///50\n")},,,,,,,,,,,,function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(15);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/MzE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///62\n")},,function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(67), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/MGI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA2NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///64\n')},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(12);\nvar toLength = __webpack_require__(45);\nvar toAbsoluteIndex = __webpack_require__(66);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzP2JjNTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXN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ybiBJU19JTkNMVURFUyB8fCBpbmRleCB8fCAwO1xuICAgIH0gcmV0dXJuICFJU19JTkNMVURFUyAmJiAtMTtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYXJyYXktaW5jbHVkZXMuanNcbi8vIG1vZHVsZSBpZCA9IDY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///65\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(24);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzPzdlNDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(68);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/ZjViMCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5Jyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpIHtcbiAgcmV0dXJuICRPYmplY3QuZGVmaW5lUHJvcGVydHkoaXQsIGtleSwgZGVzYyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///67\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(8).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanM/OTgyOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjQgLyAxNS4yLjMuNiBPYmplY3QuZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnR5OiByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///68\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(111), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzPzlhZjEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5XCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSA2OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///69\n')},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9qc29uL3N0cmluZ2lmeS5qcz9hYTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpO1xudmFyICRKU09OID0gY29yZS5KU09OIHx8IChjb3JlLkpTT04gPSB7IHN0cmluZ2lmeTogSlNPTi5zdHJpbmdpZnkgfSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHN0cmluZ2lmeShpdCkgeyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gIHJldHVybiAkSlNPTi5zdHJpbmdpZnkuYXBwbHkoJEpTT04sIGFyZ3VtZW50cyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSAxMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///111\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(113);\nmodule.exports = __webpack_require__(0).Object.keys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qcz84YzU2Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Qua2V5cztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///112\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(33);\nvar $keys = __webpack_require__(19);\n\n__webpack_require__(50)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qcz8wOWRjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCBPYmplY3Qua2V5cyhPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2tleXMnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBrZXlzKGl0KSB7XG4gICAgcmV0dXJuICRrZXlzKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///113\n")},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(36);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ReThinkCtx = function () {\n function ReThinkCtx() {\n (0, _classCallCheck3.default)(this, ReThinkCtx);\n\n this.defaultBehaviour = true;\n this.groups = {};\n }\n\n (0, _createClass3.default)(ReThinkCtx, [{\n key: 'scheme',\n get: function get() {\n return this._scheme;\n },\n set: function set(params) {\n var from = params.message.from;\n if ((0, _utils.isDataObjectURL)(from)) {\n this._scheme = (0, _utils.divideURL)(from).type;\n } else {\n this._scheme = undefined;\n }\n }\n }, {\n key: 'date',\n get: function get() {\n return this._date;\n },\n set: function set(now) {\n var date = new Date();\n var day = String(date.getDate());\n if (day.length === 1) {\n day = '0' + day;\n }\n var month = String(date.getMonth() + 1);\n if (month.length === 1) {\n month = '0' + month;\n }\n this._date = day + '/' + month + '/' + date.getFullYear();\n }\n }, {\n key: 'domain',\n get: function get() {\n return this._domain;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._domain = (0, _utils.divideEmail)(params.message.body.identity.userProfile.username).domain;\n }\n }\n }, {\n key: 'type',\n get: function get() {\n return this._type;\n },\n set: function set(params) {\n var message = params.message;\n if (message.body.value !== undefined) {\n this._type = message.body.value.resourceType;\n }\n }\n }, {\n key: 'source',\n get: function get() {\n return this._source;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._source = params.message.body.identity.userProfile.username;\n }\n }\n }, {\n key: 'time',\n get: function get() {\n return this._time;\n },\n set: function set(now) {\n now = new Date();\n var minutes = String(now.getMinutes());\n if (minutes.length === 1) {\n minutes = '0' + minutes;\n }\n this._time = parseInt(String(now.getHours()) + minutes);\n }\n }, {\n key: 'weekday',\n get: function get() {\n return this._weekday;\n },\n set: function set(now) {\n this._weekday = String(new Date().getDay());\n }\n }]);\n return ReThinkCtx;\n}();\n\nexports.default = ReThinkCtx;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUmVUaGlua0N0eC5qcz82ZmRhIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZGl2aWRlRW1haWwsIGRpdmlkZVVSTCwgaXNEYXRhT2JqZWN0VVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNsYXNzIFJlVGhpbmtDdHgge1xuXG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuZGVmYXVsdEJlaGF2aW91ciA9IHRydWU7XG4gICAgdGhpcy5ncm91cHMgPSB7fTtcbiAgfVxuXG4gIGdldCBzY2hlbWUoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3NjaGVt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gfVxuXG59XG5cbmV4cG9ydCBkZWZhdWx0IFJlVGhpbmtDdHg7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3BvbGljeS9SZVRoaW5rQ3R4LmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7OztBQUNBO0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQTBCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUEvQkE7QUFDQTtBQUNBO0FBK0JBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBeENBO0FBQ0E7QUFDQTtBQXdDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQ0E7QUFDQTtBQUNBO0FBMENBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBN0NBO0FBQ0E7QUFDQTtBQTZDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUEvQ0E7QUFDQTtBQUNBO0FBK0NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXBEQTtBQUNBO0FBQ0E7QUFvREE7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///150\n")}])}); \ No newline at end of file +!function(n,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("ReThinkCtx",[],e):"object"==typeof exports?exports.ReThinkCtx=e():n.ReThinkCtx=e()}("undefined"!=typeof self?self:this,function(){return function(n){var e={};function c(t){if(e[t])return e[t].exports;var l=e[t]={i:t,l:!1,exports:{}};return n[t].call(l.exports,l,l.exports,c),l.l=!0,l.exports}return c.m=n,c.c=e,c.d=function(n,e,t){c.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},c.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return c.d(e,"a",e),e},c.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},c.p="",c(c.s=153)}([function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qcz8xNWUwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gbW9kdWxlLmV4cG9ydHMgPSB7IHZlcnNpb246ICcyLjUuNycgfTtcbmlmICh0eXBlb2YgX19lID09ICdudW1iZXInKSBfX2UgPSBjb3JlOyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVuZGVmXG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///0\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZ2xvYmFsLmpzP2VjYWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzg2I2lzc3VlY29tbWVudC0xMTU3NTkwMjhcbnZhciBnbG9iYWwgPSBtb2R1bGUuZXhwb3J0cyA9IHR5cGVvZiB3aW5kb3cgIT0gJ3VuZGVmaW5lZCcgJiYgd2luZG93Lk1hdGggPT0gTWF0aFxuICA/IHdpbmRvdyA6IHR5cGVvZiBzZWxmICE9ICd1bmRlZmluZWQnICYmIHNlbGYuTWF0aCA9PSBNYXRoID8gc2VsZlxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tbmV3LWZ1bmNcbiAgOiBGdW5jdGlvbigncmV0dXJuIHRoaXMnKSgpO1xuaWYgKHR5cGVvZiBfX2cgPT0gJ251bWJlcicpIF9fZyA9IGdsb2JhbDsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n")},,function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY2xhc3NDYWxsQ2hlY2suanM/NjZiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(64);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanM/YzMxMCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF9kZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoXCIuLi9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHlcIik7XG5cbnZhciBfZGVmaW5lUHJvcGVydHkyID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfZGVmaW5lUHJvcGVydHkpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG5leHBvcnRzLmRlZmF1bHQgPSBmdW5jdGlvbiAoKSB7XG4gIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXModGFyZ2V0LCBwcm9wcykge1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcHJvcHMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBkZXNjcmlwdG9yID0gcHJvcHNbaV07XG4gICAgICBkZXNjcmlwdG9yLmVudW1lcmFibGUgPSBkZXNjcmlwdG9yL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,exports,__webpack_require__){eval("var global = __webpack_require__(1);\nvar core = __webpack_require__(0);\nvar ctx = __webpack_require__(17);\nvar hide = __webpack_require__(11);\nvar has = __webpack_require__(10);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzPzkwY2QiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBQUk9UT1RZUEUgPSAncHJvdG90eXBlJztcblxudmFyICRleHBvcnQgPSBmdW5jdGlvbiAodHlwZSwgbmFtZSwgc291cmNlKSB7XG4gIHZhciBJU19GT1JDRUQgPSB0eXBlICYgJGV4cG9ydC5GO1xuICB2YXIgSVNfR0xPQkFMID0gdHlwZSAmICRleHBvcnQuRztcbiAgdmFyIElTX1NUQVRJQyA9IHR5cGUgJiAkZXhwb3J0LlM7XG4gIHZhciBJU19QUk9UTyA9IHR5cGUgJiAkZXhwb3J0LlA7XG4gIHZhciBJU19CSU5EID0gdHlwZSAmICRleHBvcnQuQjtcbiAgdmFyIElTX1dSQVAgPSB0eXBlICYgJGV4cG9ydC5XO1xuICB2YXIgZXhwb3J0cyA9IElTX0dMT0JBTCA/IGNvcmUgOiBjb3JlW25hbWVdIHx8IChjb3JlW25hbWVdID0ge30pO1xuICB2YXIgZXhwUHJvdG8gPSBleHBvcnRzW1BST1RPVFlQRV07XG4gIHZhciB0YXJnZXQgPSBJU19HTE9CQUwgPyBnbG9iYWwgOiBJU19TVEFUSUMgPyBnbG9iYWxbbmFtZV0gOiAoZ2xvYmFsW25hbWV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gPSAzMjsgIC8vIHdyYXBcbiRleHBvcnQuVSA9IDY0OyAgLy8gc2FmZVxuJGV4cG9ydC5SID0gMTI4OyAvLyByZWFsIHByb3RvIG1ldGhvZCBmb3IgYGxpYnJhcnlgXG5tb2R1bGUuZXhwb3J0cyA9ICRleHBvcnQ7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZXhwb3J0LmpzXG4vLyBtb2R1bGUgaWQgPSA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYW4tb2JqZWN0LmpzP2VmYjMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoIWlzT2JqZWN0KGl0KSkgdGhyb3cgVHlwZUVycm9yKGl0ICsgJyBpcyBub3QgYW4gb2JqZWN0IScpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///6\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(13)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanM/Zjg0ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBUaGFuaydzIElFOCBmb3IgaGlzIGZ1bm55IGRlZmluZVByb3BlcnR5XG5tb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eSh7fSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///7\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(6);\nvar IE8_DOM_DEFINE = __webpack_require__(43);\nvar toPrimitive = __webpack_require__(29);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwLmpzPzdhZjAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgSUU4X0RPTV9ERUZJTkUgPS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TtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///8\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzPzEyYTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHR5cGVvZiBpdCA9PT0gJ29iamVjdCcgPyBpdCAhPT0gbnVsbCA6IHR5cGVvZiBpdCA9PT0gJ2Z1bmN0aW9uJztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///9\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz8wZjYyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///10\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(8);\nvar createDesc = __webpack_require__(21);\nmodule.exports = __webpack_require__(7) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ODQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gMTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(62);\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NGRjNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSAxM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///13\n")},,function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gMTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(20);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDE3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///17\n")},,function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(44);\nvar enumBugKeys = __webpack_require__(32);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///21\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},,function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWludGVnZXIuanM/NTJlMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuNCBUb0ludGVnZXJcbnZhciBjZWlsID0gTWF0aC5jZWlsO1xudmFyIGZsb29yID0gTWF0aC5mbG9vcjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpc05hTihpdCA9ICtpdCkgPyAwIDogKGl0ID4gMCA/IGZsb29yIDogY2VpbCkoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanM/ZTc2OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuMSBSZXF1aXJlT2JqZWN0Q29lcmNpYmxlKGFyZ3VtZW50KVxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ID09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKFwiQ2FuJ3QgY2FsbCBtZXRob2Qgb24gIFwiICsgaXQpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RlZmluZWQuanNcbi8vIG1vZHVsZSBpZCA9IDI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///25\n')},,,function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar document = __webpack_require__(1).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2RvbS1jcmVhdGUuanM/MzhkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xuLy8gdHlwZW9mIGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQgaXMgJ29iamVjdCcgaW4gb2xkIElFXG52YXIgaXMgPSBpc09iamVjdChkb2N1bWVudCkgJiYgaXNPYmplY3QoZG9jdW1lbnQuY3JlYXRlRWxlbWVudCk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXMgPyBkb2N1bWVudC5jcmVhdGVFbGVtZW50KGl0KSA6IHt9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAyOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(9);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLXByaW1pdGl2ZS5qcz8zMjYzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xIFRvUHJpbWl0aXZlKGlucHV0IFssIFByZWZlcnJlZFR5cGVdKVxudmFyIGlzT2JqZ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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(31)('keys');\nvar uid = __webpack_require__(22);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC1rZXkuanM/NmIxZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ2tleXMnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gc2hhcmVkW2tleV0gfHwgKHNoYXJlZFtrZXldID0gdWlkKGtleSkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAzMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///30\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar global = __webpack_require__(1);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(15) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qcz83YmMwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIFNIQVJFRCA9ICdfX2NvcmUtanNfc2hhcmVkX18nO1xudmFyIHN0b3JlID0gZ2xvYmFsW1NIQVJFRF0gfHwgKGdsb2JhbFtTSEFSRURdID0ge30pO1xuXG4obW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5LCB2YWx1ZSkge1xuICByZXR1cm4gc3RvcmVba2V5XSB8fCAoc3RvcmVba2V5XSA9IHZhbHVlICE9PSB1bmRlZmluZWQgPyB2YWx1ZSA6IHt9KTtcbn0pKCd2ZXJzaW9ucycsIFtdKS5wdXNoKHtcbiAgdmVyc2lvbjogY29yZS52ZXJzaW9uLFxuICBtb2RlOiByZXF1aXJlKCcuL19saWJyYXJ5JykgPyAncHVyZScgOiAnZ2xvYmFsJyxcbiAgY29weXJpZ2h0OiAnwqkgMjAxOCBEZW5pcyBQdXNoa2FyZXYgKHpsb2lyb2NrLnJ1KSdcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NoYXJlZC5qc1xuLy8gbW9kdWxlIGlkID0gMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///31\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0tYnVnLWtleXMuanM/YzY3NyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBJRSA4LSBkb24ndCBlbnVtIGJ1ZyBrZXlzXG5tb2R1bGUuZXhwb3J0cyA9IChcbiAgJ2NvbnN0cnVjdG9yLGhhc093blByb3BlcnR5LGlzUHJvdG90eXBlT2YscHJvcGVydHlJc0VudW1lcmFibGUsdG9Mb2NhbGVTdHJpbmcsdG9TdHJpbmcsdmFsdWVPZidcbikuc3BsaXQoJywnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///32\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(25);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///33\n")},,,function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(65);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _keys = __webpack_require__(48);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.divideURL = divideURL;\nexports.emptyObject = emptyObject;\nexports.secondsSinceEpoch = secondsSinceEpoch;\nexports.deepClone = deepClone;\nexports.removePathFromURL = removePathFromURL;\nexports.getUserURLFromEmail = getUserURLFromEmail;\nexports.getUserEmailFromURL = getUserEmailFromURL;\nexports.convertToUserURL = convertToUserURL;\nexports.isDataObjectURL = isDataObjectURL;\nexports.isLegacy = isLegacy;\nexports.isURL = isURL;\nexports.isUserURL = isUserURL;\nexports.isHypertyURL = isHypertyURL;\nexports.getConfigurationResources = getConfigurationResources;\nexports.buildURL = buildURL;\nexports.generateGUID = generateGUID;\nexports.getUserIdentityDomain = getUserIdentityDomain;\nexports.isBackendServiceURL = isBackendServiceURL;\nexports.divideEmail = divideEmail;\nexports.assign = assign;\nexports.splitObjectURL = splitObjectURL;\nexports.checkAttribute = checkAttribute;\nexports.parseAttributes = parseAttributes;\nexports.isEmpty = isEmpty;\nexports.chatkeysToStringCloner = chatkeysToStringCloner;\nexports.chatkeysToArrayCloner = chatkeysToArrayCloner;\nexports.parseMessageURL = parseMessageURL;\nexports.availableSpace = availableSpace;\nexports.encode = encode;\nexports.decode = decode;\nexports.decodeToUint8Array = decodeToUint8Array;\nexports.stringify = stringify;\nexports.parse = parse;\nexports.parseToUint8Array = parseToUint8Array;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * Support module with some functions will be useful\n * @module utils\n */\n\n/**\n * @typedef divideURL\n * @type Object\n * @property {string} type The type of URL\n * @property {string} domain The domain of URL\n * @property {string} identity The identity of URL\n */\n\n/**\n * Divide an url in type, domain and identity\n * @param {URL.URL} url - url address\n * @return {divideURL} the result of divideURL\n */\nfunction divideURL(url) {\n\n function recurse(value) {\n var regex = /([a-zA-Z-]*)(:\\/\\/(?:\\.)?|:)([-a-zA-Z0-9@:%._+~#=]{2,256})([-a-zA-Z0-9@:%._+~#=/]*)/gi;\n var subst = '$1,$3,$4';\n var parts = value.replace(regex, subst).split(',');\n return parts;\n }\n\n var parts = recurse(url);\n\n // If the url has no scheme\n if (parts[0] === url && !parts[0].includes('@')) {\n\n var _result = {\n type: '',\n domain: url,\n identity: ''\n };\n\n console.warn('[DivideURL] DivideURL don\\'t support url without scheme. Please review your url address', url);\n\n return _result;\n }\n\n // check if the url has the scheme and includes an @\n if (parts[0] === url && parts[0].includes('@')) {\n var scheme = parts[0] === url ? 'smtp' : parts[0];\n parts = recurse(scheme + '://' + parts[0]);\n }\n\n // if the domain includes an @, divide it to domain and identity respectively\n if (parts[1].includes('@')) {\n parts[2] = parts[0] + '://' + parts[1];\n parts[1] = parts[1].substr(parts[1].indexOf('@') + 1);\n } /*else if (parts[2].includes('/')) {\n parts[2] = parts[2].substr(parts[2].lastIndexOf('/')+1);\n }*/\n\n var result = {\n type: parts[0],\n domain: parts[1],\n identity: parts[2]\n };\n\n return result;\n}\n\n/**\n * Check if an Object is empty\n * @param {Object} object Object to be checked\n * @return {Boolean} status of Object, empty or not (true|false);\n */\nfunction emptyObject(object) {\n return (0, _keys2.default)(object).length > 0 ? false : true;\n}\n\nfunction secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n}\n\n/**\n * Make a COPY of the original data\n * @param {Object} obj - object to be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n //TODO: simple but inefficient JSON deep clone...\n if (obj) return JSON.parse((0, _stringify2.default)(obj));\n}\n\nfunction removePathFromURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n}\n\n/**\n * Obtains the user URL that corresponds to a given email\n * @param {string} userEmail The user email\n * @return {URL.URL} userURL The user URL\n */\nfunction getUserURLFromEmail(userEmail) {\n var indexOfAt = userEmail.indexOf('@');\n return 'user://' + userEmail.substring(indexOfAt + 1, userEmail.length) + '/' + userEmail.substring(0, indexOfAt);\n}\n\n/**\n * Obtains the user email that corresponds to a given URL\n * @param {URL.URL} userURL The user URL\n * @return {string} userEmail The user email\n */\nfunction getUserEmailFromURL(userURL) {\n var url = divideURL(userURL);\n return url.identity.replace('/', '') + '@' + url.domain; // identity field has '/exampleID' instead of 'exampleID'\n}\n\n/**\n * Check if the user identifier is already in the URL format, if not, convert to URL format\n * @param {string} identifier user identifier\n * @return {string} userURL the user URL\n */\nfunction convertToUserURL(identifier) {\n\n // check if the identifier is already in the url format\n if (identifier.substring(0, 7) === 'user://') {\n var dividedURL = divideURL(identifier);\n\n //check if the url is well formated\n if (dividedURL.domain && dividedURL.identity) {\n return identifier;\n } else {\n throw 'userURL with wrong format';\n }\n\n //if not, convert the user email to URL format\n } else {\n return getUserURLFromEmail(identifier);\n }\n}\n\nfunction isDataObjectURL(url) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain', 'hyperty'];\n var splitURL = url.split('://');\n var urlSchema = splitURL[0];\n\n return schemasToIgnore.indexOf(urlSchema) === -1;\n}\n\nfunction isLegacy(url) {\n if (url.split('@').length > 1) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction isURL(url) {\n return url.split('/').length >= 3;\n}\n\nfunction isUserURL(url) {\n return divideURL(url).type === 'user';\n}\n\nfunction isHypertyURL(url) {\n return divideURL(url).type === 'hyperty';\n}\n\n/**\n * get information relative each component configured on runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @return {object} return an object with all configurations;\n */\nfunction getConfigurationResources(configuration, component, resource) {\n var objectResource = configuration[component];\n var resourceType = objectResource[resource];\n\n return resourceType;\n}\n\n/**\n * Build a full url with the runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @param {string} type resource to get, like a hyperty name or protocolstub name;\n * @param {boolean} useFallback if true the function will check if have a fallback url;\n * @return {string} partial url to contact the resource;\n */\nfunction buildURL(configuration, component, resource, type) {\n var useFallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n var objectResource = configuration[component];\n var url = void 0;\n\n if (!objectResource.hasOwnProperty(resource)) {\n throw Error('The configuration ' + (0, _stringify2.default)(objectResource, '', 2) + ' don\\'t have the ' + resource + ' resource you are looking for');\n }\n\n var resourceType = objectResource[resource];\n\n if (type) {\n url = resourceType.prefix + configuration.domain + resourceType.suffix + type;\n if (resourceType.hasOwnProperty('fallback') && useFallback) {\n if (resourceType.fallback.indexOf('%domain%')) {\n url = resourceType.fallback.replace(/(%domain%)/g, configuration.domain) + type;\n } else {\n url = resourceType.fallback + type;\n }\n }\n } else {\n url = resourceType.prefix + configuration.domain + resourceType.suffix;\n }\n\n // console.log(url);\n\n return url;\n}\n\n/**\n * Generate a Global Unique ID\n *\n * @returns String;\n */\nfunction generateGUID() {\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\nfunction getUserIdentityDomain(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var splitedLength = splitedDomain.length;\n if (splitedLength == 1) {\n return splitedDomain[splitedLength - 1];\n }\n var domain = splitedDomain[splitedLength - 2] + '.' + splitedDomain[splitedLength - 1];\n return domain;\n}\n\n/**\n * Check if URL is from a backend service\n * @param {string} url URL to be processed\n * @return {boolean}\n */\n\nfunction isBackendServiceURL(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var backendSchemes = ['domain', 'global', 'domain-idp']; // should be defined in the runtime configuration\n var backendSubDomains = ['registry', 'msg-node']; // should be defined in the runtime configuration\n var subDomain = void 0;\n\n if (splitedDomain.length > 1) {\n subDomain = splitedDomain.filter(function (item) {\n return backendSubDomains.indexOf(item) !== -1;\n })[0];\n }\n\n if (subDomain && backendSubDomains.indexOf(subDomain) !== -1) {\n return true;\n }\n\n if (dividedURL.type) {\n return backendSchemes.indexOf(dividedURL.type) !== -1;\n }\n\n return false;\n}\n\nfunction divideEmail(email) {\n var indexOfAt = email.indexOf('@');\n\n var result = {\n username: email.substring(0, indexOfAt),\n domain: email.substring(indexOfAt + 1, email.length)\n };\n\n return result;\n}\n\nfunction assign(obj, keyPath, value) {\n\n if (!obj) obj = {};\n if (typeof keyPath === 'string') keyPath = parseAttributes(keyPath);\n\n var lastKeyIndex = keyPath.length - 1;\n\n for (var i = 0; i < lastKeyIndex; ++i) {\n var key = keyPath[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n obj[keyPath[lastKeyIndex]] = value;\n}\n\nfunction splitObjectURL(dataObjectURL) {\n console.info('[utils - splitObjectURL]: ', dataObjectURL);\n\n var splitedURL = dataObjectURL.split('/');\n var url = splitedURL[0] + '//' + splitedURL[2] + '/' + splitedURL[3];\n var resource = splitedURL[5];\n\n var result = {\n url: url,\n resource: resource\n };\n\n console.info('[utils - splitObjectURL]: ', result);\n\n return result;\n}\n\nfunction checkAttribute(path) {\n\n var regex = /((([a-zA-Z]+):\\/\\/([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\\/[a-zA-Z0-9.]+@[a-zA-Z0-9]+(-)?[a-zA-Z0-9]+(\\.)?[a-zA-Z0-9]{2,10}?\\.[a-zA-Z]{2,10})(.+(?=.identity))?/gm;\n\n var list = [];\n var final = [];\n var test = path.match(regex);\n\n if (test == null) {\n final = path.split('.');\n } else {\n var m = void 0;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach(function (match, groupIndex) {\n if (groupIndex === 0) {\n list.push(match);\n }\n });\n }\n var result = void 0;\n list.forEach(function (url) {\n\n result = path.replace(url, '*-*');\n final = result.split('.').map(function (item) {\n\n if (item === '*-*') {\n return url;\n }\n\n return item;\n });\n });\n }\n\n console.log('[RuntimeCore.Utils.checkAttribute]', final);\n return final;\n}\n\nfunction parseAttributes(path) {\n var regex = /([0-9a-zA-Z][-\\w]*):\\/\\//g;\n\n var string3 = 'identity';\n\n if (!path.includes('://')) {\n return path.split('.');\n } else {\n var string1 = path.split(regex)[0];\n\n var array1 = string1.split('.');\n\n var string2 = path.replace(string1, '');\n\n if (path.includes(string3)) {\n\n var array2 = string2.split(string3 + '.');\n\n console.log('array2 ' + array2);\n\n string2 = array2[0].slice('.', -1);\n\n array2 = array2[1].split('.');\n\n array1.push(string2, string3);\n\n array1 = array1.concat(array2);\n } else {\n array1.push(string2);\n }\n\n return array1.filter(Boolean);\n }\n}\n\nfunction isEmpty(obj) {\n for (var prop in obj) {\n\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return (0, _stringify2.default)(obj) === (0, _stringify2.default)({});\n}\n\nfunction chatkeysToStringCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n dataObjectSessionKeysClone[field].sessionKey = sessionKeys[field].sessionKey.toString();\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToStringCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction chatkeysToArrayCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n var arrayValues = JSON.parse('[' + sessionKeys[field].sessionKey + ']');\n dataObjectSessionKeysClone[field].sessionKey = new Uint8Array(arrayValues);\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToArrayCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction parseMessageURL(URL) {\n var splitedToURL = URL.split('/');\n if (splitedToURL.length <= 6) {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3];\n } else {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3] + '/' + splitedToURL[4];\n }\n}\n\nfunction availableSpace(usage, quota) {\n var available = (usage / quota).toFixed(2);\n return {\n quota: quota,\n usage: usage,\n percent: Number(available)\n };\n}\n\n/**\n* Encodes a JS object to base 64 encode\n* @param {Object} value byteArray value\n* @return {string} encoded value\n*/\nfunction encode(value) {\n try {\n var stringValue = stringify(value);\n return btoa(stringValue);\n } catch (err) {\n console.error('[Utils.encode:err] ' + err);\n throw err;\n }\n}\n\n/**\n * Decode a base64 string to object\n * @param {string_b64} value value encoded in base 64\n * @return {Object} decodedValue\n */\nfunction decode(value) {\n try {\n return JSON.parse(atob(value));\n } catch (err) {\n console.log('[Utils.decode:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Decode a base64 string to Uint8Array\n* @param {string_b64} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction decodeToUint8Array(value) {\n try {\n return new Uint8Array(decode(value));\n } catch (err) {\n console.error('[Utils.decodeToUint8Array:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a JS object to string\n* NOTE: Special conversion for Uint8Arrays\n* @param {Object} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction stringify(value) {\n try {\n var stringValue = void 0;\n if (value.constructor === Uint8Array) {\n stringValue = '[' + value.toString() + ']'; // the [] is for JSON.parse compatibility\n } else {\n stringValue = (0, _stringify2.default)(value);\n }\n return stringValue;\n } catch (err) {\n console.error('[Utils.stringify:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Object} encoded value\n*/\nfunction parse(value) {\n try {\n return JSON.parse(value);\n } catch (err) {\n console.error('[Utils.parse:err]' + err);\n console.trace();\n console.error('That that cause the error:', value);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction parseToUint8Array(value) {\n try {\n return new Uint8Array(parse(value));\n } catch (err) {\n console.error('[Utils.parseToUint8Array:err]' + err);\n throw err;\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL3V0aWxzL3V0aWxzLmpzP2JlNzMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGV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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBS0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n")},,,,,,,function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(7) && !__webpack_require__(13)(function () {\n return Object.defineProperty(__webpack_require__(28)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2llOC1kb20tZGVmaW5lLmpzPzQ5ZjAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSAmJiAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkocmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdkaXYnKSwgJ2EnLCB7IGdldDogZnVuY3Rpb24gKCkgeyByZXR1cm4gNzsgfSB9KS5hICE9IDc7XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(10);\nvar toIObject = __webpack_require__(12);\nvar arrayIndexOf = __webpack_require__(66)(false);\nvar IE_PROTO = __webpack_require__(30)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzPzIxYjgiXSwic291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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///44\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(24);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qcz80MTExIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xNSBUb0xlbmd0aFxudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCA+IDAgPyBtaW4odG9JbnRlZ2VyKGl0KSwgMHgxZmZmZmZmZmZmZmZmZikgOiAwOyAvLyBwb3coMiwgNTMpIC0gMSA9PSA5MDA3MTk5MjU0NzQwOTkxXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWxlbmd0aC5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiAzIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n")},,,function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(113), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzPzdkOTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9rZXlzXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA0OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSA0IDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///48\n')},,function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(5);\nvar core = __webpack_require__(0);\nvar fails = __webpack_require__(13);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1zYXAuanM/YmFhNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBtb3N0IE9iamVjdCBtZXRob2RzIGJ5IEVTNiBzaG91bGQgYWNjZXB0IHByaW1pdGl2ZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVksIGV4ZWMpIHtcbiAgdmFyIGZuID0gKGNvcmUuT2JqZWN0IHx8IHt9KVtLRVldIHx8IE9iamVjdFtLRVldO1xuICB2YXIgZXhwID0ge307XG4gIGV4cFtLRVldID0gZXhlYyhmbik7XG4gICRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogZmFpbHMoZnVuY3Rpb24gKCkgeyBmbigxKTsgfSksICdPYmplY3QnLCBleHApO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzXG4vLyBtb2R1bGUgaWQgPSA1MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///50\n")},,,,,,,,,,,,function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(16);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanM/MzE0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIGFuZCBub24tZW51bWVyYWJsZSBvbGQgVjggc3RyaW5nc1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXByb3RvdHlwZS1idWlsdGluc1xubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QoJ3onKS5wcm9wZXJ0eUlzRW51bWVyYWJsZSgwKSA/IE9iamVjdCA6IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gY29mKGl0KSA9PSAnU3RyaW5nJyA/IGl0LnNwbGl0KCcnKSA6IE9iamVjdChpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///62\n")},,function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(68), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/MGI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA2NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDMgNCA1Il0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///64\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(112), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzPzlhZjEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5XCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSA2NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAgMSAyIDUiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///65\n')},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(12);\nvar toLength = __webpack_require__(45);\nvar toAbsoluteIndex = __webpack_require__(67);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzP2JjNTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsc2UgLT4gQXJyYXkjaW5kZXhPZlxuLy8gdHJ1ZSAgLT4gQXJyYXkjaW5jbHVkZXNcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0Fic29sdXRlSW5kZXggPSByZXF1aXJlKCcuL190by1hYnNvbHV0ZS1pbmRleCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoSVNfSU5DTFVERVMpIHt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MuanNcbi8vIG1vZHVsZSBpZCA9IDY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(24);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzPzdlNDAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBtYXggPSBNYXRoLm1heDtcbnZhciBtaW4gPSBNYXRoLm1pbjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGluZGV4LCBsZW5ndGgpIHtcbiAgaW5kZXggPSB0b0ludGVnZXIoaW5kZXgpO1xuICByZXR1cm4gaW5kZXggPCAwID8gbWF4KGluZGV4ICsgbGVuZ3RoLCAwKSA6IG1pbihpbmRleCwgbGVuZ3RoKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tYWJzb2x1dGUtaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDY3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///67\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(69);\nvar $Object = __webpack_require__(0).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanM/ZjViMCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5Jyk7XG52YXIgJE9iamVjdCA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Q7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpIHtcbiAgcmV0dXJuICRPYmplY3QuZGVmaW5lUHJvcGVydHkoaXQsIGtleSwgZGVzYyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///68\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(5);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(8).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanM/OTgyOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuLy8gMTkuMS4yLjQgLyAxNS4yLjMuNiBPYmplY3QuZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnR5OiByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDIgMyA0IDUiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///69\n")},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){eval("var core = __webpack_require__(0);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9qc29uL3N0cmluZ2lmeS5qcz9hYTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpO1xudmFyICRKU09OID0gY29yZS5KU09OIHx8IChjb3JlLkpTT04gPSB7IHN0cmluZ2lmeTogSlNPTi5zdHJpbmdpZnkgfSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHN0cmluZ2lmeShpdCkgeyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gIHJldHVybiAkSlNPTi5zdHJpbmdpZnkuYXBwbHkoJEpTT04sIGFyZ3VtZW50cyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSAxMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIDEgMiA1Il0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///112\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(114);\nmodule.exports = __webpack_require__(0).Object.keys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qcz84YzU2Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Qua2V5cztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///113\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(33);\nvar $keys = __webpack_require__(19);\n\n__webpack_require__(50)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qcz8wOWRjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCBPYmplY3Qua2V5cyhPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2tleXMnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBrZXlzKGl0KSB7XG4gICAgcmV0dXJuICRrZXlzKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCAxIDQgNSJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///114\n")},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(3);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(4);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(36);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ReThinkCtx = function () {\n function ReThinkCtx() {\n (0, _classCallCheck3.default)(this, ReThinkCtx);\n\n this.defaultBehaviour = true;\n this.groups = {};\n }\n\n (0, _createClass3.default)(ReThinkCtx, [{\n key: 'scheme',\n get: function get() {\n return this._scheme;\n },\n set: function set(params) {\n var from = params.message.from;\n if ((0, _utils.isDataObjectURL)(from)) {\n this._scheme = (0, _utils.divideURL)(from).type;\n } else {\n this._scheme = undefined;\n }\n }\n }, {\n key: 'date',\n get: function get() {\n return this._date;\n },\n set: function set(now) {\n var date = new Date();\n var day = String(date.getDate());\n if (day.length === 1) {\n day = '0' + day;\n }\n var month = String(date.getMonth() + 1);\n if (month.length === 1) {\n month = '0' + month;\n }\n this._date = day + '/' + month + '/' + date.getFullYear();\n }\n }, {\n key: 'domain',\n get: function get() {\n return this._domain;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._domain = (0, _utils.divideEmail)(params.message.body.identity.userProfile.username).domain;\n }\n }\n }, {\n key: 'type',\n get: function get() {\n return this._type;\n },\n set: function set(params) {\n var message = params.message;\n if (message.body.value !== undefined) {\n this._type = message.body.value.resourceType;\n }\n }\n }, {\n key: 'source',\n get: function get() {\n return this._source;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._source = params.message.body.identity.userProfile.username;\n }\n }\n }, {\n key: 'time',\n get: function get() {\n return this._time;\n },\n set: function set(now) {\n now = new Date();\n var minutes = String(now.getMinutes());\n if (minutes.length === 1) {\n minutes = '0' + minutes;\n }\n this._time = parseInt(String(now.getHours()) + minutes);\n }\n }, {\n key: 'weekday',\n get: function get() {\n return this._weekday;\n },\n set: function set(now) {\n this._weekday = String(new Date().getDay());\n }\n }]);\n return ReThinkCtx;\n}();\n\nexports.default = ReThinkCtx;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUmVUaGlua0N0eC5qcz82ZmRhIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZGl2aWRlRW1haWwsIGRpdmlkZVVSTCwgaXNEYXRhT2JqZWN0VVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNsYXNzIFJlVGhpbmtDdHgge1xu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+++ b/dist/Runtime.js @@ -1,5 +1,5 @@ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -25,4 +25,4 @@ **/ -!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Runtime",[],n):"object"==typeof exports?exports.Runtime=n():e.Runtime=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function t(c){if(n[c])return n[c].exports;var g=n[c]={i:c,l:!1,exports:{}};return e[c].call(g.exports,g,g.exports,t),g.l=!0,g.exports}return t.m=e,t.c=n,t.d=function(e,n,c){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:c})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=222)}([function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar core = __webpack_require__(31);\nvar hide = __webpack_require__(23);\nvar redefine = __webpack_require__(24);\nvar ctx = __webpack_require__(32);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2V4cG9ydC5qcz8wZWNlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIFBST1RPVFlQRSA9ICdwcm90b3R5cGUnO1xuXG52YXIgJGV4cG9ydCA9IGZ1bmN0aW9uICh0eXBlLCBuYW1lLCBzb3VyY2UpIHtcbiAgdmFyIElTX0ZPUkNFRCA9IHR5cGUgJiAkZXhwb3J0LkY7XG4gIHZhciBJU19HTE9CQUwgPSB0eXBlICYgJGV4cG9ydC5HO1xuICB2YXIgSVNfU1RBVElDID0gdHlwZSAmICRleHBvcnQuUztcbiAgdmFyIElTX1BST1RPID0gdHlwZSAmICRleHBvcnQuUDtcbiAgdmFyIElTX0JJTkQgPSB0eXBlICYgJGV4cG9ydC5CO1xuICB2YXIgdGFyZ2V0ID0gSVNfR0xP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__){"use strict";eval('\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY2xhc3NDYWxsQ2hlY2suanM/NjZiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(204);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanM/YzMxMCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF9kZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoXCIuLi9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHlcIik7XG5cbnZhciBfZGVmaW5lUHJvcGVydHkyID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfZGVmaW5lUHJvcGVydHkpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG5leHBvcnRzLmRlZmF1bHQgPSBmdW5jdGlvbiAoKSB7XG4gIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXModGFyZ2V0LCBwcm9wcykge1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcHJvcHMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBkZXNjcmlwdG9yID0gcHJvcHNbaV07XG4gICAgICBkZX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In0=\n//# sourceURL=webpack-internal:///2\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(430), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvcHJvbWlzZS5qcz9mZmYxIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9wcm9taXNlXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3Byb21pc2UuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n "use strict";\n if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof module === \'object\' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n "use strict";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = "undefined";\n\n var logMethods = [\n "trace",\n "debug",\n "info",\n "warn",\n "error"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === \'function\') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === \'debug\') {\n methodName = \'log\';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, \'log\');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn\'t present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n var storageKey = "loglevel";\n if (name) {\n storageKey += ":" + name;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || \'silent\').toUpperCase();\n\n if (typeof window === undefinedType) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + "=" + levelName + ";";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + "=");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,\n "ERROR": 4, "SILENT": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return "No console available for logging";\n }\n } else {\n throw "log.setLevel() called with invalid level: " + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? "WARN" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if (typeof name !== "string" || name === "") {\n throw new TypeError("You must supply a name when creating a logger.");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n return defaultLogger;\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9sb2dsZXZlbC9saWIvbG9nbGV2ZWwuanM/MDZmYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuKiBsb2dsZXZlbCAtIGh0dHBzOi8vZ2l0aHViLmNvbS9waW10ZXJyeS9sb2dsZXZlbFxuKlxuKiBDb3B5cmlnaHQgKGMpIDIwMTMgVGltIFBlcnJ5XG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBNSVQgbGljZW5zZS5cbiovXG4oZnVuY3Rpb24gKHJvb3Q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iB3aW5kb3cgPT09IHVuZGVmaW5lZFR5cGUpIHJldHVybjtcblxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHN0b3JlZExldmVsID0gd2luZG93LmxvY2FsU3RvcmFnZVtzdG9yYWdlS2V5XTtcbiAgICAgICAgICB9IGNhdGNoIChpZ25vcmUpIHt9XG5cbiAgICAgICAgICAvLyBGYWxsYmFjayB0byBjb29raWVzIGlmIGxvY2FsIHN0b3JhZ2UgZ2l2ZXMgdXMgbm90aGluZ1xuICAgICAgICAgIGlmICh0eXBlb2Ygc3RvcmVkTGV2ZWwgPT09IHVuZGVmaW5lZFR5cGUpIHtcbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgIHZhciBjb29raWUgPSB3aW5kb3cuZG9jdW1lbnQuY29va2llO1xuICAgICAgICAgICAgICAgICAgdmFyIGxvY2F0aW9uID0gY29va2llLmluZGV4T2YoXG4gICAgICAgICAgICAgICAgICAgICAgZW5jb2RlVVJJQ29tcG9uZW50KHN0b3JhZ2VLZXkpICsgXCI9XCIpO1xuICAgICAgICAgICAgICAgICAgaWYgKGxvY2F0aW9uICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgIHN0b3JlZExldmVsID0gL14oW147XSspLy5leGVjKGNvb2tpZS5zbGljZShsb2NhdGlvbikpWzFdO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGNhdGNoIChpZ25vcmUpIHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gSWYgdGhlIHN0b3JlZCBsZXZlbCBpcyBub3QgdmFsaWQsIHRyZWF0IGl0IGFzIGlmIG5vdGhpbmcgd2FzIHN0b3JlZC5cbiAgICAgICAgICBpZiAoc2VsZi5sZXZlbHNbc3RvcmVkTGV2ZWxdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgc3RvcmVkTGV2ZWwgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuXG4gICA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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n')},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2FuLW9iamVjdC5qcz8wYzg1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYW4tb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.divideURL = divideURL;\nexports.emptyObject = emptyObject;\nexports.secondsSinceEpoch = secondsSinceEpoch;\nexports.deepClone = deepClone;\nexports.removePathFromURL = removePathFromURL;\nexports.getUserURLFromEmail = getUserURLFromEmail;\nexports.getUserEmailFromURL = getUserEmailFromURL;\nexports.convertToUserURL = convertToUserURL;\nexports.isDataObjectURL = isDataObjectURL;\nexports.isLegacy = isLegacy;\nexports.isURL = isURL;\nexports.isUserURL = isUserURL;\nexports.isHypertyURL = isHypertyURL;\nexports.getConfigurationResources = getConfigurationResources;\nexports.buildURL = buildURL;\nexports.generateGUID = generateGUID;\nexports.getUserIdentityDomain = getUserIdentityDomain;\nexports.isBackendServiceURL = isBackendServiceURL;\nexports.divideEmail = divideEmail;\nexports.assign = assign;\nexports.splitObjectURL = splitObjectURL;\nexports.checkAttribute = checkAttribute;\nexports.parseAttributes = parseAttributes;\nexports.isEmpty = isEmpty;\nexports.chatkeysToStringCloner = chatkeysToStringCloner;\nexports.chatkeysToArrayCloner = chatkeysToArrayCloner;\nexports.parseMessageURL = parseMessageURL;\nexports.availableSpace = availableSpace;\nexports.encode = encode;\nexports.decode = decode;\nexports.decodeToUint8Array = decodeToUint8Array;\nexports.stringify = stringify;\nexports.parse = parse;\nexports.parseToUint8Array = parseToUint8Array;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * Support module with some functions will be useful\n * @module utils\n */\n\n/**\n * @typedef divideURL\n * @type Object\n * @property {string} type The type of URL\n * @property {string} domain The domain of URL\n * @property {string} identity The identity of URL\n */\n\n/**\n * Divide an url in type, domain and identity\n * @param {URL.URL} url - url address\n * @return {divideURL} the result of divideURL\n */\nfunction divideURL(url) {\n\n function recurse(value) {\n var regex = /([a-zA-Z-]*)(:\\/\\/(?:\\.)?|:)([-a-zA-Z0-9@:%._+~#=]{2,256})([-a-zA-Z0-9@:%._+~#=/]*)/gi;\n var subst = '$1,$3,$4';\n var parts = value.replace(regex, subst).split(',');\n return parts;\n }\n\n var parts = recurse(url);\n\n // If the url has no scheme\n if (parts[0] === url && !parts[0].includes('@')) {\n\n var _result = {\n type: '',\n domain: url,\n identity: ''\n };\n\n console.warn('[DivideURL] DivideURL don\\'t support url without scheme. Please review your url address', url);\n\n return _result;\n }\n\n // check if the url has the scheme and includes an @\n if (parts[0] === url && parts[0].includes('@')) {\n var scheme = parts[0] === url ? 'smtp' : parts[0];\n parts = recurse(scheme + '://' + parts[0]);\n }\n\n // if the domain includes an @, divide it to domain and identity respectively\n if (parts[1].includes('@')) {\n parts[2] = parts[0] + '://' + parts[1];\n parts[1] = parts[1].substr(parts[1].indexOf('@') + 1);\n } /*else if (parts[2].includes('/')) {\n parts[2] = parts[2].substr(parts[2].lastIndexOf('/')+1);\n }*/\n\n var result = {\n type: parts[0],\n domain: parts[1],\n identity: parts[2]\n };\n\n return result;\n}\n\n/**\n * Check if an Object is empty\n * @param {Object} object Object to be checked\n * @return {Boolean} status of Object, empty or not (true|false);\n */\nfunction emptyObject(object) {\n return (0, _keys2.default)(object).length > 0 ? false : true;\n}\n\nfunction secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n}\n\n/**\n * Make a COPY of the original data\n * @param {Object} obj - object to be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n //TODO: simple but inefficient JSON deep clone...\n if (obj) return JSON.parse((0, _stringify2.default)(obj));\n}\n\nfunction removePathFromURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n}\n\n/**\n * Obtains the user URL that corresponds to a given email\n * @param {string} userEmail The user email\n * @return {URL.URL} userURL The user URL\n */\nfunction getUserURLFromEmail(userEmail) {\n var indexOfAt = userEmail.indexOf('@');\n return 'user://' + userEmail.substring(indexOfAt + 1, userEmail.length) + '/' + userEmail.substring(0, indexOfAt);\n}\n\n/**\n * Obtains the user email that corresponds to a given URL\n * @param {URL.URL} userURL The user URL\n * @return {string} userEmail The user email\n */\nfunction getUserEmailFromURL(userURL) {\n var url = divideURL(userURL);\n return url.identity.replace('/', '') + '@' + url.domain; // identity field has '/exampleID' instead of 'exampleID'\n}\n\n/**\n * Check if the user identifier is already in the URL format, if not, convert to URL format\n * @param {string} identifier user identifier\n * @return {string} userURL the user URL\n */\nfunction convertToUserURL(identifier) {\n\n // check if the identifier is already in the url format\n if (identifier.substring(0, 7) === 'user://') {\n var dividedURL = divideURL(identifier);\n\n //check if the url is well formated\n if (dividedURL.domain && dividedURL.identity) {\n return identifier;\n } else {\n throw 'userURL with wrong format';\n }\n\n //if not, convert the user email to URL format\n } else {\n return getUserURLFromEmail(identifier);\n }\n}\n\nfunction isDataObjectURL(url) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain', 'hyperty'];\n var splitURL = url.split('://');\n var urlSchema = splitURL[0];\n\n return schemasToIgnore.indexOf(urlSchema) === -1;\n}\n\nfunction isLegacy(url) {\n if (url.split('@').length > 1) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction isURL(url) {\n return url.split('/').length >= 3;\n}\n\nfunction isUserURL(url) {\n return divideURL(url).type === 'user';\n}\n\nfunction isHypertyURL(url) {\n return divideURL(url).type === 'hyperty';\n}\n\n/**\n * get information relative each component configured on runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @return {object} return an object with all configurations;\n */\nfunction getConfigurationResources(configuration, component, resource) {\n var objectResource = configuration[component];\n var resourceType = objectResource[resource];\n\n return resourceType;\n}\n\n/**\n * Build a full url with the runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @param {string} type resource to get, like a hyperty name or protocolstub name;\n * @param {boolean} useFallback if true the function will check if have a fallback url;\n * @return {string} partial url to contact the resource;\n */\nfunction buildURL(configuration, component, resource, type) {\n var useFallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n var objectResource = configuration[component];\n var url = void 0;\n\n if (!objectResource.hasOwnProperty(resource)) {\n throw Error('The configuration ' + (0, _stringify2.default)(objectResource, '', 2) + ' don\\'t have the ' + resource + ' resource you are looking for');\n }\n\n var resourceType = objectResource[resource];\n\n if (type) {\n url = resourceType.prefix + configuration.domain + resourceType.suffix + type;\n if (resourceType.hasOwnProperty('fallback') && useFallback) {\n if (resourceType.fallback.indexOf('%domain%')) {\n url = resourceType.fallback.replace(/(%domain%)/g, configuration.domain) + type;\n } else {\n url = resourceType.fallback + type;\n }\n }\n } else {\n url = resourceType.prefix + configuration.domain + resourceType.suffix;\n }\n\n // console.log(url);\n\n return url;\n}\n\n/**\n * Generate a Global Unique ID\n *\n * @returns String;\n */\nfunction generateGUID() {\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\nfunction getUserIdentityDomain(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var splitedLength = splitedDomain.length;\n if (splitedLength == 1) {\n return splitedDomain[splitedLength - 1];\n }\n var domain = splitedDomain[splitedLength - 2] + '.' + splitedDomain[splitedLength - 1];\n return domain;\n}\n\n/**\n * Check if URL is from a backend service\n * @param {string} url URL to be processed\n * @return {boolean}\n */\n\nfunction isBackendServiceURL(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var backendSchemes = ['domain', 'global', 'domain-idp']; // should be defined in the runtime configuration\n var backendSubDomains = ['registry', 'msg-node']; // should be defined in the runtime configuration\n var subDomain = void 0;\n\n if (splitedDomain.length > 1) {\n subDomain = splitedDomain.filter(function (item) {\n return backendSubDomains.indexOf(item) !== -1;\n })[0];\n }\n\n if (subDomain && backendSubDomains.indexOf(subDomain) !== -1) {\n return true;\n }\n\n if (dividedURL.type) {\n return backendSchemes.indexOf(dividedURL.type) !== -1;\n }\n\n return false;\n}\n\nfunction divideEmail(email) {\n var indexOfAt = email.indexOf('@');\n\n var result = {\n username: email.substring(0, indexOfAt),\n domain: email.substring(indexOfAt + 1, email.length)\n };\n\n return result;\n}\n\nfunction assign(obj, keyPath, value) {\n\n if (!obj) obj = {};\n if (typeof keyPath === 'string') keyPath = parseAttributes(keyPath);\n\n var lastKeyIndex = keyPath.length - 1;\n\n for (var i = 0; i < lastKeyIndex; ++i) {\n var key = keyPath[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n obj[keyPath[lastKeyIndex]] = value;\n}\n\nfunction splitObjectURL(dataObjectURL) {\n console.info('[utils - splitObjectURL]: ', dataObjectURL);\n\n var splitedURL = dataObjectURL.split('/');\n var url = splitedURL[0] + '//' + splitedURL[2] + '/' + splitedURL[3];\n var resource = splitedURL[5];\n\n var result = {\n url: url,\n resource: resource\n };\n\n console.info('[utils - splitObjectURL]: ', result);\n\n return result;\n}\n\nfunction checkAttribute(path) {\n\n var regex = /((([a-zA-Z]+):\\/\\/([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\\/[a-zA-Z0-9.]+@[a-zA-Z0-9]+(-)?[a-zA-Z0-9]+(\\.)?[a-zA-Z0-9]{2,10}?\\.[a-zA-Z]{2,10})(.+(?=.identity))?/gm;\n\n var list = [];\n var final = [];\n var test = path.match(regex);\n\n if (test == null) {\n final = path.split('.');\n } else {\n var m = void 0;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach(function (match, groupIndex) {\n if (groupIndex === 0) {\n list.push(match);\n }\n });\n }\n var result = void 0;\n list.forEach(function (url) {\n\n result = path.replace(url, '*-*');\n final = result.split('.').map(function (item) {\n\n if (item === '*-*') {\n return url;\n }\n\n return item;\n });\n });\n }\n\n console.log('[RuntimeCore.Utils.checkAttribute]', final);\n return final;\n}\n\nfunction parseAttributes(path) {\n var regex = /([0-9a-zA-Z][-\\w]*):\\/\\//g;\n\n var string3 = 'identity';\n\n if (!path.includes('://')) {\n return path.split('.');\n } else {\n var string1 = path.split(regex)[0];\n\n var array1 = string1.split('.');\n\n var string2 = path.replace(string1, '');\n\n if (path.includes(string3)) {\n\n var array2 = string2.split(string3 + '.');\n\n console.log('array2 ' + array2);\n\n string2 = array2[0].slice('.', -1);\n\n array2 = array2[1].split('.');\n\n array1.push(string2, string3);\n\n array1 = array1.concat(array2);\n } else {\n array1.push(string2);\n }\n\n return array1.filter(Boolean);\n }\n}\n\nfunction isEmpty(obj) {\n for (var prop in obj) {\n\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return (0, _stringify2.default)(obj) === (0, _stringify2.default)({});\n}\n\nfunction chatkeysToStringCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n dataObjectSessionKeysClone[field].sessionKey = sessionKeys[field].sessionKey.toString();\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToStringCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction chatkeysToArrayCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n var arrayValues = JSON.parse('[' + sessionKeys[field].sessionKey + ']');\n dataObjectSessionKeysClone[field].sessionKey = new Uint8Array(arrayValues);\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToArrayCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction parseMessageURL(URL) {\n var splitedToURL = URL.split('/');\n if (splitedToURL.length <= 6) {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3];\n } else {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3] + '/' + splitedToURL[4];\n }\n}\n\nfunction availableSpace(usage, quota) {\n var available = (usage / quota).toFixed(2);\n return {\n quota: quota,\n usage: usage,\n percent: Number(available)\n };\n}\n\n/**\n* Encodes a JS object to base 64 encode\n* @param {Object} value byteArray value\n* @return {string} encoded value\n*/\nfunction encode(value) {\n try {\n var stringValue = stringify(value);\n return btoa(stringValue);\n } catch (err) {\n console.error('[Utils.encode:err] ' + err);\n throw err;\n }\n}\n\n/**\n * Decode a base64 string to object\n * @param {string_b64} value value encoded in base 64\n * @return {Object} decodedValue\n */\nfunction decode(value) {\n try {\n return JSON.parse(atob(value));\n } catch (err) {\n console.log('[Utils.decode:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Decode a base64 string to Uint8Array\n* @param {string_b64} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction decodeToUint8Array(value) {\n try {\n return new Uint8Array(decode(value));\n } catch (err) {\n console.error('[Utils.decodeToUint8Array:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a JS object to string\n* NOTE: Special conversion for Uint8Arrays\n* @param {Object} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction stringify(value) {\n try {\n var stringValue = void 0;\n if (value.constructor === Uint8Array) {\n stringValue = '[' + value.toString() + ']'; // the [] is for JSON.parse compatibility\n } else {\n stringValue = (0, _stringify2.default)(value);\n }\n return stringValue;\n } catch (err) {\n console.error('[Utils.stringify:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Object} encoded value\n*/\nfunction parse(value) {\n try {\n return JSON.parse(value);\n } catch (err) {\n console.error('[Utils.parse:err]' + err);\n console.trace();\n console.error('That that cause the error:', value);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction parseToUint8Array(value) {\n try {\n return new Uint8Array(parse(value));\n } catch (err) {\n console.error('[Utils.parseToUint8Array:err]' + err);\n throw err;\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9zcmMvdXRpbHMvdXRpbHMuanM/YmU3MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2dsb2JhbC5qcz8zYjMyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS96bG9pcm9jay9jb3JlLWpzL2lzc3Vlcy84NiNpc3N1ZWNvbW1lbnQtMTE1NzU5MDI4XG52YXIgZ2xvYmFsID0gbW9kdWxlLmV4cG9ydHMgPSB0eXBlb2Ygd2luZG93ICE9ICd1bmRlZmluZWQnICYmIHdpbmRvdy5NYXRoID09IE1hdGhcbiAgPyB3aW5kb3cgOiB0eXBlb2Ygc2VsZiAhPSAndW5kZWZpbmVkJyAmJiBzZWxmLk1hdGggPT0gTWF0aCA/IHNlbGZcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLW5ldy1mdW5jXG4gIDogRnVuY3Rpb24oJ3JldHVybiB0aGlzJykoKTtcbmlmICh0eXBlb2YgX19nID09ICdudW1iZXInKSBfX2cgPSBnbG9iYWw7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZ2xvYmFsLmpzXG4vLyBtb2R1bGUgaWQgPSA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZhaWxzLmpzP2NlMDIiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mYWlscy5qc1xuLy8gbW9kdWxlIGlkID0gOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2lzLW9iamVjdC5qcz81MGEzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiB0eXBlb2YgaXQgPT09ICdvYmplY3QnID8gaXQgIT09IG51bGwgOiB0eXBlb2YgaXQgPT09ICdmdW5jdGlvbic7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(83)('wks');\nvar uid = __webpack_require__(53);\nvar Symbol = __webpack_require__(7).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL193a3MuanM/OTI0MCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc3RvcmUgPSByZXF1aXJlKCcuL19zaGFyZWQnKSgnd2tzJyk7XG52YXIgdWlkID0gcmVxdWlyZSgnLi9fdWlkJyk7XG52YXIgU3ltYm9sID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuU3ltYm9sO1xudmFyIFVTRV9TWU1CT0wgPSB0eXBlb2YgU3ltYm9sID09ICdmdW5jdGlvbic7XG5cbnZhciAkZXhwb3J0cyA9IG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgcmV0dXJuIHN0b3JlW25hbWVdIHx8IChzdG9yZVtuYW1lXSA9XG4gICAgVVNFX1NZTUJPTCAmJiBTeW1ib2xbbmFtZV0gfHwgKFVTRV9TWU1CT0wgPyBTeW1ib2wgOiB1aWQpKCdTeW1ib2wuJyArIG5hbWUpKTtcbn07XG5cbiRleHBvcnRzLnN0b3JlID0gc3RvcmU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3drcy5qc1xuLy8gbW9kdWxlIGlkID0gMTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///10\n")},function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvcmUuanM/MTVlMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29yZSA9IG1vZHVsZS5leHBvcnRzID0geyB2ZXJzaW9uOiAnMi41LjcnIH07XG5pZiAodHlwZW9mIF9fZSA9PSAnbnVtYmVyJykgX19lID0gY29yZTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvcmUuanNcbi8vIG1vZHVsZSBpZCA9IDExXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(8)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qcz82ZDRhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIFRoYW5rJ3MgSUU4IGZvciBoaXMgZnVubnkgZGVmaW5lUHJvcGVydHlcbm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHt9LCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(5);\nvar IE8_DOM_DEFINE = __webpack_require__(155);\nvar toPrimitive = __webpack_require__(36);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(12) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanM/OTQzMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBkUCA9IE9iamVjdC5kZWZpbmVQcm9wZXJ0eTtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0eSA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KE8sIFAsIEF0dHJpYnV0ZXMpIHtcbiAgYW5PYmplY3QoTyk7XG4gIFAgPSB0b1ByaW1pdGl2ZShQLCB0cnVlKTtcbiAgYW5PYmplY3QoQXR0cmlidXRlcyk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZFAoTywgUCwgQXR0cmlidXRlcyk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoJ2dldCcgaW4gQXR0cmlidXRlcyB8fCAnc2V0JyBpbiBBdHRyaWJ1dGVzKSB0aHJvdyBUeXBlRXJyb3IoJ0FjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIScpO1xuICBpZiAoJ3ZhbHVlJyBpbiBBdHRyaWJ1dGVzKSBPW1BdID0gQXR0cmlidXRlcy52YWx1ZTtcbiAgcmV0dXJuIE87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///13\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(38);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1sZW5ndGguanM/MDViYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMTUgVG9MZW5ndGhcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXQgPiAwID8gbWluKHRvSW50ZWdlcihpdCksIDB4MWZmZmZmZmZmZmZmZmYpIDogMDsgLy8gcG93KDIsIDUzKSAtIDEgPT0gOTAwNzE5OTI1NDc0MDk5MVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8tbGVuZ3RoLmpzXG4vLyBtb2R1bGUgaWQgPSAxNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(466), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzY3MWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAxNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(426), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzPzdkOTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9rZXlzXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAxNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n\n return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3Bvc3NpYmxlQ29uc3RydWN0b3JSZXR1cm4uanM/Y2YwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF90eXBlb2YyID0gcmVxdWlyZShcIi4uL2hlbHBlcnMvdHlwZW9mXCIpO1xuXG52YXIgX3R5cGVvZjMgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF90eXBlb2YyKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKHNlbGYsIGNhbGwpIHtcbiAgaWYgKCFzZWxmKSB7XG4gICAgdGhyb3cgbmV3IFJlZmVyZW5jZUVycm9yKFwidGhpcyBoYXNuJ3QgYmVlbiBpbml0aWFsaXNlZCAtIHN1cGVyKCkgaGFzbid0IGJlZW4gY2FsbGVkXCIpO1xuICB9XG5cbiAgcmV0dXJuIGNhbGwgJiYgKCh0eXBlb2YgY2FsbCA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiAoMCwgX3R5cGVvZjMuZGVmYXVsdCkoY2FsbCkpID09PSBcIm9iamVjdFwiIHx8IHR5cGVvZiBjYWxsID09PSBcImZ1bmN0aW9uXCIpID8gY2FsbCA6IHNlbGY7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9wb3NzaWJsZUNvbnN0cnVjdG9yUmV0dXJuLmpzXG4vLyBtb2R1bGUgaWQgPSAxN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///17\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = __webpack_require__(468);\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = __webpack_require__(472);\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ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IsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///18\n')},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(37);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1vYmplY3QuanM/MTZiYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMTMgVG9PYmplY3QoYXJndW1lbnQpXG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBPYmplY3QoZGVmaW5lZChpdCkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8tb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSAxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hLWZ1bmN0aW9uLmpzPzVkMjMiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKHR5cGVvZiBpdCAhPSAnZnVuY3Rpb24nKSB0aHJvdyBUeXBlRXJyb3IoaXQgKyAnIGlzIG5vdCBhIGZ1bmN0aW9uIScpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hLWZ1bmN0aW9uLmpzXG4vLyBtb2R1bGUgaWQgPSAyMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qcz9lY2FiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS96bG9pcm9jay9jb3JlLWpzL2lzc3Vlcy84NiNpc3N1ZWNvbW1lbnQtMTE1NzU5MDI4XG52YXIgZ2xvYmFsID0gbW9kdWxlLmV4cG9ydHMgPSB0eXBlb2Ygd2luZG93ICE9ICd1bmRlZmluZWQnICYmIHdpbmRvdy5NYXRoID09IE1hdGhcbiAgPyB3aW5kb3cgOiB0eXBlb2Ygc2VsZiAhPSAndW5kZWZpbmVkJyAmJiBzZWxmLk1hdGggPT0gTWF0aCA/IHNlbGZcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLW5ldy1mdW5jXG4gIDogRnVuY3Rpb24oJ3JldHVybiB0aGlzJykoKTtcbmlmICh0eXBlb2YgX19nID09ICdudW1iZXInKSBfX2cgPSBnbG9iYWw7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19nbG9iYWwuanNcbi8vIG1vZHVsZSBpZCA9IDIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///21\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(136)('wks');\nvar uid = __webpack_require__(98);\nvar Symbol = __webpack_require__(21).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy5qcz83NTJjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBzdG9yZSA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpKCd3a3MnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbnZhciBTeW1ib2wgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5TeW1ib2w7XG52YXIgVVNFX1NZTUJPTCA9IHR5cGVvZiBTeW1ib2wgPT0gJ2Z1bmN0aW9uJztcblxudmFyICRleHBvcnRzID0gbW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAobmFtZSkge1xuICByZXR1cm4gc3RvcmVbbmFtZV0gfHwgKHN0b3JlW25hbWVdID1cbiAgICBVU0VfU1lNQk9MICYmIFN5bWJvbFtuYW1lXSB8fCAoVVNFX1NZTUJPTCA/IFN5bWJvbCA6IHVpZCkoJ1N5bWJvbC4nICsgbmFtZSkpO1xufTtcblxuJGV4cG9ydHMuc3RvcmUgPSBzdG9yZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MuanNcbi8vIG1vZHVsZSBpZCA9IDIyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(13);\nvar createDesc = __webpack_require__(52);\nmodule.exports = __webpack_require__(12) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzP2RhOWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIGRQLmYob2JqZWN0LCBrZXksIGNyZWF0ZURlc2MoMSwgdmFsdWUpKTtcbn0gOiBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIG9iamVjdFtrZXldID0gdmFsdWU7XG4gIHJldHVybiBvYmplY3Q7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSAyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///23\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar hide = __webpack_require__(23);\nvar has = __webpack_require__(27);\nvar SRC = __webpack_require__(53)('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(31).inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19yZWRlZmluZS5qcz80NzcwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFNSQyA9IHJlcXVpcmUoJy4vX3VpZCcpKCdzcmMnKTtcbnZhciBUT19TVFJJTkcgPSAndG9TdHJpbmcnO1xudmFyICR0b1N0cmluZyA9IEZ1bmN0aW9uW1RPX1NUUklOR107XG52YXIgVFBMID0gKCcnICsgJHRvU3RyaW5nKS5zcGxpdChUT19TVFJJTkcpO1xuXG5yZXF1aXJlKCcuL19jb3JlJykuaW5zcGVjdFNvdXJjZSA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gJHRvU3RyaW5nLmNhbGwoaXQpO1xufTtcblxuKG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKE8sIGtleSwgdmFsLCBzYWZlKSB7XG4gIHZhciBpc0Z1bmN0aW9uID0gdHlwZW9mIHZhbCA9PSAnZnVuY3Rpb24nO1xuICBpZiAoaXNGdW5jdGlvbikgaGFzKHZhbCwgJ25hbWUnKSB8fCBoaWRlKHZhbCwgJ25hbWUnLCBrZXkpO1xuICBpZiAoT1trZXldID09PSB2YWwpIHJldHVybjtcbiAgaWYgKGlzRnVuY3Rpb24pIGhhcyh2Y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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar fails = __webpack_require__(8);\nvar defined = __webpack_require__(37);\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpbmctaHRtbC5qcz9jYjdkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG52YXIgcXVvdCA9IC9cIi9nO1xuLy8gQi4yLjMuMi4xIENyZWF0ZUhUTUwoc3RyaW5nLCB0YWcsIGF0dHJpYnV0ZSwgdmFsdWUpXG52YXIgY3JlYXRlSFRNTCA9IGZ1bmN0aW9uIChzdHJpbmcsIHRhZywgYXR0cmlidXRlLCB2YWx1ZSkge1xuICB2YXIgUyA9IFN0cmluZyhkZWZpbmVkKHN0cmluZykpO1xuICB2YXIgcDEgPSAnPCcgKyB0YWc7XG4gIGlmIChhdHRyaWJ1dGUgIT09ICcnKSBwMSArPSAnICcgKyBhdHRyaWJ1dGUgKyAnPVwiJyArIFN0cmluZyh2YWx1ZSkucmVwbGFjZShxdW90LCAnJnF1b3Q7JykgKyAnXCInO1xuICByZXR1cm4gcDEgKyAnPicgKyBTICsgJzwvJyArIHRhZyArICc+Jztcbn07XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChOQU1FLCBleGVjKSB7XG4gIHZhciBPID0ge307XG4gIE9bTkFNRV0gPSBleGVjKGNyZWF0ZUhUTUwpO1xuICAkZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIGZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgdGVzdCA9ICcnW05BTUVdKCdcIicpO1xuICAgIHJldHVybiB0ZXN0ICE9PSB0ZXN0LnRvTG93ZXJDYXNlKCkgfHwgdGVzdC5zcGxpdCgnXCInKS5sZW5ndGggPiAzO1xuICB9KSwgJ1N0cmluZycsIE8pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWh0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///25\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar core = __webpack_require__(11);\nvar ctx = __webpack_require__(69);\nvar hide = __webpack_require__(63);\nvar has = __webpack_require__(62);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6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saWJyYXJ5YFxubW9kdWxlLmV4cG9ydHMgPSAkZXhwb3J0O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2V4cG9ydC5qc1xuLy8gbW9kdWxlIGlkID0gMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///26\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oYXMuanM/NTgxNyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGFzT3duUHJvcGVydHkgPSB7fS5oYXNPd25Qcm9wZXJ0eTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBrZXkpIHtcbiAgcmV0dXJuIGhhc093blByb3BlcnR5LmNhbGwoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oYXMuanNcbi8vIG1vZHVsZSBpZCA9IDI3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///27\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(73);\nvar defined = __webpack_require__(37);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1pb2JqZWN0LmpzPzNjN2EiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gdG8gaW5kZXhlZCBvYmplY3QsIHRvT2JqZWN0IHdpdGggZmFsbGJhY2sgZm9yIG5vbi1hcnJheS1saWtlIEVTMyBzdHJpbmdzXG52YXIgSU9iamVjdCA9IHJlcXVpcmUoJy4vX2lvYmplY3QnKTtcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIElPYmplY3QoZGVmaW5lZChpdCkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8taW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(74);\nvar createDesc = __webpack_require__(52);\nvar toIObject = __webpack_require__(28);\nvar toPrimitive = __webpack_require__(36);\nvar has = __webpack_require__(27);\nvar IE8_DOM_DEFINE = __webpack_require__(155);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(12) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qcz9jN2RjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgZ09QRCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBnT1BEIDogZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIFApIHtcbiAgTyA9IHRvSU9iamVjdChPKTtcbiAgUCA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGdPUEQoTywgUCk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoaGFzKE8sIFApKSByZXR1cm4gY3JlYXRlRGVzYyghcElFLmYuY2FsbChPLCBQKSwgT1tQXSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qc1xuLy8gbW9kdWxlIGlkID0gMjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(27);\nvar toObject = __webpack_require__(19);\nvar IE_PROTO = __webpack_require__(108)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ3BvLmpzPzI4ZWEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjkgLyAxNS4yLjMuMiBPYmplY3QuZ2V0UHJvdG90eXBlT2YoTylcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElFX1BST1RPID0gcmVxdWlyZSgnLi9fc2hhcmVkLWtleScpKCdJRV9QUk9UTycpO1xudmFyIE9iamVjdFByb3RvID0gT2JqZWN0LnByb3RvdHlwZTtcblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuZ2V0UHJvdG90eXBlT2YgfHwgZnVuY3Rpb24gKE8pIHtcbiAgTyA9IHRvT2JqZWN0KE8pO1xuICBpZiAoaGFzKE8sIElFX1BST1RPKSkgcmV0dXJuIE9bSUVfUFJPVE9dO1xuICBpZiAodHlwZW9mIE8uY29uc3RydWN0b3IgPT0gJ2Z1bmN0aW9uJyAmJiBPIGluc3RhbmNlb2YgTy5jb25zdHJ1Y3Rvcikge1xuICAgIHJldHVybiBPLmNvbnN0cnVjdG9yLnByb3RvdHlwZTtcbiAgfSByZXR1cm4gTyBpbnN0YW5jZW9mIE9iamVjdCA/IE9iamVjdFByb3RvIDogbnVsbDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1ncG8uanNcbi8vIG1vZHVsZSBpZCA9IDMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///30\n")},function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb3JlLmpzP2VlMDUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNvcmUgPSBtb2R1bGUuZXhwb3J0cyA9IHsgdmVyc2lvbjogJzIuNS43JyB9O1xuaWYgKHR5cGVvZiBfX2UgPT0gJ251bWJlcicpIF9fZSA9IGNvcmU7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///31\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(20);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jdHguanM/YWM1YyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBvcHRpb25hbCAvIHNpbXBsZSBjb250ZXh0IGJpbmRpbmdcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChmbiwgdGhhdCwgbGVuZ3RoKSB7XG4gIGFGdW5jdGlvbihmbik7XG4gIGlmICh0aGF0ID09PSB1bmRlZmluZWQpIHJldHVybiBmbjtcbiAgc3dpdGNoIChsZW5ndGgpIHtcbiAgICBjYXNlIDE6IHJldHVybiBmdW5jdGlvbiAoYSkge1xuICAgICAgcmV0dXJuIGZuLmNhbGwodGhhdCwgYSk7XG4gICAgfTtcbiAgICBjYXNlIDI6IHJldHVybiBmdW5jdGlvbiAoYSwgYikge1xuICAgICAgcmV0dXJuIGZuLmNhbGwodGhhdCwgYSwgYik7XG4gICAgfTtcbiAgICBjYXNlIDM6IHJldHVybiBmdW5jdGlvbiAoYSwgYiwgYykge1xuICAgICAgcmV0dXJuIGZuLmNhbGwodGhhdCwgYSwgYiwgYyk7XG4gICAgfTtcbiAgfVxuICByZXR1cm4gZnVuY3Rpb24gKC8qIC4uLmFyZ3MgKi8pIHtcbiAgICByZXR1cm4gZm4uYXBwbHkodGhhdCwgYXJndW1lbnRzKTtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2N0eC5qc1xuLy8gbW9kdWxlIGlkID0gMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///32\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb2YuanM/YzlkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9TdHJpbmcgPSB7fS50b1N0cmluZztcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHRvU3RyaW5nLmNhbGwoaXQpLnNsaWNlKDgsIC0xKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2NvZi5qc1xuLy8gbW9kdWxlIGlkID0gMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///33\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar fails = __webpack_require__(8);\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpY3QtbWV0aG9kLmpzPzM0ZGEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAobWV0aG9kLCBhcmcpIHtcbiAgcmV0dXJuICEhbWV0aG9kICYmIGZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdXNlbGVzcy1jYWxsXG4gICAgYXJnID8gbWV0aG9kLmNhbGwobnVsbCwgZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9LCAxKSA6IG1ldGhvZC5jYWxsKG51bGwpO1xuICB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3N0cmljdC1tZXRob2QuanNcbi8vIG1vZHVsZSBpZCA9IDM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///34\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(478), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzPzlhZjEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5XCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///35\n')},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(9);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1wcmltaXRpdmUuanM/YjM4OCJdLCJzb3VyY2VzQ29udGVudC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BjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZWZpbmVkLmpzP2ZmMDgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjEgUmVxdWlyZU9iamVjdENvZXJjaWJsZShhcmd1bWVudClcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIGlmIChpdCA9PSB1bmRlZmluZWQpIHRocm93IFR5cGVFcnJvcihcIkNhbid0IGNhbGwgbWV0aG9kIG9uICBcIiArIGl0KTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGVmaW5lZC5qc1xuLy8gbW9kdWxlIGlkID0gMzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///37\n')},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1pbnRlZ2VyLmpzP2ExZTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4xLjQgVG9JbnRlZ2VyXG52YXIgY2VpbCA9IE1hdGguY2VpbDtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXNOYU4oaXQgPSAraXQpID8gMCA6IChpdCA+IDAgPyBmbG9vciA6IGNlaWwpKGl0KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3RvLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDM4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///38\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(0);\nvar core = __webpack_require__(31);\nvar fails = __webpack_require__(8);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3Qtc2FwLmpzP2RlMmUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gbW9zdCBPYmplY3QgbWV0aG9kcyBieSBFUzYgc2hvdWxkIGFjY2VwdCBwcmltaXRpdmVzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZLCBleGVjKSB7XG4gIHZhciBmbiA9IChjb3JlLk9iamVjdCB8fCB7fSlbS0VZXSB8fCBPYmplY3RbS0VZXTtcbiAgdmFyIGV4cCA9IHt9O1xuICBleHBbS0VZXSA9IGV4ZWMoZm4pO1xuICAkZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIGZhaWxzKGZ1bmN0aW9uICgpIHsgZm4oMSk7IH0pLCAnT2JqZWN0JywgZXhwKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1zYXAuanNcbi8vIG1vZHVsZSBpZCA9IDM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///39\n")},function(module,exports,__webpack_require__){eval("// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = __webpack_require__(32);\nvar IObject = __webpack_require__(73);\nvar toObject = __webpack_require__(19);\nvar toLength = __webpack_require__(14);\nvar asc = __webpack_require__(125);\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1tZXRob2RzLmpzPzJlMTQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMCAtPiBBcnJheSNmb3JFYWNoXG4vLyAxIC0+IEFycmF5I21hcFxuLy8gMiAtPiBBcnJheSNmaWx0ZXJcbi8vIDMgLT4gQXJyYXkjc29tZVxuLy8gNCAtPiBBcnJheSNldmVyeVxuLy8gNSAtPiBBcnJheSNmaW5kXG4vLyA2IC0+IEFycmF5I2ZpbmRJbmRleFxudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgdG9P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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///40\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(45);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qcz9lZmIzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDQxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///41\n")},function(module,exports,__webpack_require__){"use strict";eval("\nif (__webpack_require__(12)) {\n var LIBRARY = __webpack_require__(48);\n var global = __webpack_require__(7);\n var fails = __webpack_require__(8);\n var $export = __webpack_require__(0);\n var $typed = __webpack_require__(94);\n var $buffer = __webpack_require__(131);\n var ctx = __webpack_require__(32);\n var anInstance = __webpack_require__(59);\n var propertyDesc = __webpack_require__(52);\n var hide = __webpack_require__(23);\n var redefineAll = __webpack_require__(61);\n var toInteger = __webpack_require__(38);\n var toLength = __webpack_require__(14);\n var toIndex = __webpack_require__(181);\n var toAbsoluteIndex = __webpack_require__(55);\n var toPrimitive = __webpack_require__(36);\n var has = __webpack_require__(27);\n var classof = __webpack_require__(75);\n var isObject = __webpack_require__(9);\n var toObject = __webpack_require__(19);\n var isArrayIter = __webpack_require__(122);\n var create = __webpack_require__(56);\n var getPrototypeOf = __webpack_require__(30);\n var gOPN = __webpack_require__(57).f;\n var getIterFn = __webpack_require__(124);\n var uid = __webpack_require__(53);\n var wks = __webpack_require__(10);\n var createArrayMethod = __webpack_require__(40);\n var createArrayIncludes = __webpack_require__(84);\n var speciesConstructor = __webpack_require__(91);\n var ArrayIterators = __webpack_require__(127);\n var Iterators = __webpack_require__(66);\n var $iterDetect = __webpack_require__(88);\n var setSpecies = __webpack_require__(58);\n var arrayFill = __webpack_require__(126);\n var arrayCopyWithin = __webpack_require__(171);\n var $DP = __webpack_require__(13);\n var $GOPD = __webpack_require__(29);\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190eXBlZC1hcnJheS5qcz9lZmI1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///42\n")},function(module,exports,__webpack_require__){eval("var Map = __webpack_require__(176);\nvar $export = __webpack_require__(0);\nvar shared = __webpack_require__(83)('metadata');\nvar store = shared.store || (shared.store = new (__webpack_require__(179))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tZXRhZGF0YS5qcz9jMDJiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBNYXAgPSByZXF1aXJlKCcuL2VzNi5tYXAnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJykoJ21ldGFkYXRhJyk7XG52YXIgc3RvcmUgPSBzaGFyZWQuc3RvcmUgfHwgKHNoYXJlZC5zdG9yZSA9IG5ldyAocmVxdWlyZSgnLi9lczYud2Vhay1tYXAnKSkoKSk7XG5cbnZhciBnZXRPckNyZWF0ZU1ldGFkYXRhTWFwID0gZnVuY3Rpb24gKHRhcmdldCwgdGFyZ2V0S2V5LCBjcmVhdGUpIHtcbiAgdmFyIHRhcmdldE1ldGFkYXRhID0gc3RvcmUuZ2V0KHRhcmdldCk7XG4gIGlmICghdGFyZ2V0TWV0YW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bWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(41);\nvar IE8_DOM_DEFINE = __webpack_require__(191);\nvar toPrimitive = __webpack_require__(140);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(51) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcC5qcz83YWYwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBhbk9iamVjdCA9IHJlcXVp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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///44\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLW9iamVjdC5qcz8xMmE4Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiB0eXBlb2YgaXQgPT09ICdvYmplY3QnID8gaXQgIT09IG51bGwgOiB0eXBlb2YgaXQgPT09ICdmdW5jdGlvbic7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///45\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(447), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9hc3NpZ24uanM/YzI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2Fzc2lnblwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///46\n')},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(53)('meta');\nvar isObject = __webpack_require__(9);\nvar has = __webpack_require__(27);\nvar setDesc = __webpack_require__(13).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(8)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tZXRhLmpzP2Q1YTAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIE1FVEEgPSByZXF1aXJlKCcuL191aWQnKSgnbWV0YScpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgc2V0RGVzYyA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaWQgPSAwO1xudmFyIGlzRXh0ZW5zaWJsZSA9IE9iamVjdC5pc0V4dGVuc2libGUgfHwgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gdHJ1ZTtcbn07XG52YXIgRlJFRVpFID0gIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gaXNFeHRlbnNpYmxlKE9iamVjdC5wcmV2ZW50RXh0ZW5zaW9ucyh7fSkpO1xufSk7XG52YXIgc2V0TWV0YSA9IGZ1bmN0aW9uIChpdCkge1xuICBzZXREZXNjKGl0LCBNRVRBLCB7IHZhbHVlOiB7XG4gICAgaTogJ08nICsgKytpZCwgLy8gb2JqZWN0IElEXG4gICAgdzoge30gICAgICAgICAgLy8gd2VhayBjb2xsZWN0aW9ucyBJRHNcbiAgfSB9KTtcbn07XG52YXIgZmFzdEtleSA9IGZ1bmN0aW9uIChpdCwgY3JlYXRlKSB7XG4gIC8vIHJldHVybiBwcmltaXRpdmUgd2l0aCBwcmVmaXhcbiAgaWYgKCFpc09iamVjdChpdCkpIHJldHVybiB0eXBlb2YgaXQgP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W5zaWJsZShpdCkgJiYgIWhhcyhpdCwgTUVUQSkpIHNldE1ldGEoaXQpO1xuICByZXR1cm4gaXQ7XG59O1xudmFyIG1ldGEgPSBtb2R1bGUuZXhwb3J0cyA9IHtcbiAgS0VZOiBNRVRBLFxuICBORUVEOiBmYWxzZSxcbiAgZmFzdEtleTogZmFzdEtleSxcbiAgZ2V0V2VhazogZ2V0V2VhayxcbiAgb25GcmVlemU6IG9uRnJlZXplXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tZXRhLmpzXG4vLyBtb2R1bGUgaWQgPSA0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///47\n")},function(module,exports){eval("module.exports = false;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19saWJyYXJ5LmpzPzU3NzkiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmYWxzZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///48\n")},function(module,exports,__webpack_require__){eval("// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = __webpack_require__(10)('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(23)(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanM/NDYxMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjMuMzEgQXJyYXkucHJvdG90eXBlW0BAdW5zY29wYWJsZXNdXG52YXIgVU5TQ09QQUJMRVMgPSByZXF1aXJlKCcuL193a3MnKSgndW5zY29wYWJsZXMnKTtcbnZhciBBcnJheVByb3RvID0gQXJyYXkucHJvdG90eXBlO1xuaWYgKEFycmF5UHJvdG9bVU5TQ09QQUJMRVNdID09IHVuZGVmaW5lZCkgcmVxdWlyZSgnLi9faGlkZScpKEFycmF5UHJvdG8sIFVOU0NPUEFCTEVTLCB7fSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgQXJyYXlQcm90b1tVTlNDT1BBQkxFU11ba2V5XSA9IHRydWU7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanNcbi8vIG1vZHVsZSBpZCA9IDQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///49\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(190);\nvar defined = __webpack_require__(132);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NGRjNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDUwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///50\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(70)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2Rlc2NyaXB0b3JzLmpzP2Y4NGQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gVGhhbmsncyBJRTggZm9yIGhpcyBmdW5ueSBkZWZpbmVQcm9wZXJ0eVxubW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkoe30sICdhJywgeyBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIDc7IH0gfSkuYSAhPSA3O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanNcbi8vIG1vZHVsZSBpZCA9IDUxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///51\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wcm9wZXJ0eS1kZXNjLmpzPzdkNGQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoYml0bWFwLCB2YWx1ZSkge1xuICByZXR1cm4ge1xuICAgIGVudW1lcmFibGU6ICEoYml0bWFwICYgMSksXG4gICAgY29uZmlndXJhYmxlOiAhKGJpdG1hcCAmIDIpLFxuICAgIHdyaXRhYmxlOiAhKGJpdG1hcCAmIDQpLFxuICAgIHZhbHVlOiB2YWx1ZVxuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvcGVydHktZGVzYy5qc1xuLy8gbW9kdWxlIGlkID0gNTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///52\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL191aWQuanM/YmE1NCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaWQgPSAwO1xudmFyIHB4ID0gTWF0aC5yYW5kb20oKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gJ1N5bWJvbCgnLmNvbmNhdChrZXkgPT09IHVuZGVmaW5lZCA/ICcnIDoga2V5LCAnKV8nLCAoKytpZCArIHB4KS50b1N0cmluZygzNikpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdWlkLmpzXG4vLyBtb2R1bGUgaWQgPSA1M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///53\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(157);\nvar enumBugKeys = __webpack_require__(109);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3Qta2V5cy5qcz80MjFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCAvIDE1LjIuMy4xNCBPYmplY3Qua2V5cyhPKVxudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMtaW50ZXJuYWwnKTtcbnZhciBlbnVtQnVnS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3Qua2V5cyB8fCBmdW5jdGlvbiBrZXlzKE8pIHtcbiAgcmV0dXJuICRrZXlzKE8sIGVudW1CdWdLZXlzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA1NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///54\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(38);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1hYnNvbHV0ZS1pbmRleC5qcz9jZThmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWF4ID0gTWF0aC5tYXg7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpbmRleCwgbGVuZ3RoKSB7XG4gIGluZGV4ID0gdG9JbnRlZ2VyKGluZGV4KTtcbiAgcmV0dXJuIGluZGV4IDwgMCA/IG1heChpbmRleCArIGxlbmd0aCwgMCkgOiBtaW4oaW5kZXgsIGxlbmd0aCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1hYnNvbHV0ZS1pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gNTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///55\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(5);\nvar dPs = __webpack_require__(158);\nvar enumBugKeys = __webpack_require__(109);\nvar IE_PROTO = __webpack_require__(108)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(106)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(110).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtY3JlYXRlLmpzP2VmMjkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjIgLyAxNS4yLjMuNSBPYmplY3QuY3JlYXRlKE8gWywgUHJvcGVydGllc10pXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBkUHMgPSByZXF1aXJlKCcuL19vYmplY3QtZHBzJyk7XG52YXIgZW51bUJ1Z0tleXMgPSByZXF1aXJlKCcuL19lbnVtLWJ1Zy1rZXlzJyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgRW1wdHkgPSBmdW5jdGlvbiAoKSB7IC8qIGVtcHR5ICovIH07XG52YXIgUFJPVE9UWVBFID0gJ3Byb3RvdHlwZSc7XG5cbi8vIENyZWF0ZSBvYmplY3Qgd2l0aCBmYWtlIGBudWxsYCBwcm90b3R5cGU6IHVzZSBpZnJhbWUgT2JqZWN0IHdpdGggY2xlYXJlZCBwcm90b3R5cGVcbnZhciBjcmVhdGVEaWN0ID0gZnVuY3Rpb24gKCkge1xuICAvLyBUaHJhc2gsIHdhc3RlIGFuZCBzb2RvbXk6IElFIEdDIGJ1Z1xuICB2YXIgaWZyYW1lID0gcmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdpZnJhbWUnKTtcbiAgdmFyIGkgPSBlbnVtQnVnS2V5cy5sZW5ndGg7XG4gIHZhciBsdCA9ICc8JztcbiAgdmFyIGd0ID0gJz4nO1xuICB2YXIgaWZyYW1lRG9jdW1lbnQ7XG4gIGlmc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ICAgIHJlc3VsdFtJRV9QUk9UT10gPSBPO1xuICB9IGVsc2UgcmVzdWx0ID0gY3JlYXRlRGljdCgpO1xuICByZXR1cm4gUHJvcGVydGllcyA9PT0gdW5kZWZpbmVkID8gcmVzdWx0IDogZFBzKHJlc3VsdCwgUHJvcGVydGllcyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSA1NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///56\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(157);\nvar hiddenKeys = __webpack_require__(109).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wbi5qcz81OWMzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi43IC8gMTUuMi4zLjQgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMoTylcbnZhciAka2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzLWludGVybmFsJyk7XG52YXIgaGlkZGVuS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKS5jb25jYXQoJ2xlbmd0aCcsICdwcm90b3R5cGUnKTtcblxuZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMgfHwgZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlOYW1lcyhPKSB7XG4gIHJldHVybiAka2V5cyhPLCBoaWRkZW5LZXlzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1nb3BuLmpzXG4vLyBtb2R1bGUgaWQgPSA1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///57\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar dP = __webpack_require__(13);\nvar DESCRIPTORS = __webpack_require__(12);\nvar SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtc3BlY2llcy5qcz8wODQ5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBTUEVDSUVTID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZKSB7XG4gIHZhciBDID0gZ2xvYmFsW0tFWV07XG4gIGlmIChERVNDUklQVE9SUyAmJiBDICYmICFDW1NQRUNJRVNdKSBkUC5mKEMsIFNQRUNJRVMsIHtcbiAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9XG4gIH0pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2V0LXNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///58\n")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hbi1pbnN0YW5jZS5qcz9mNDZhIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBDb25zdHJ1Y3RvciwgbmFtZSwgZm9yYmlkZGVuRmllbGQpIHtcbiAgaWYgKCEoaXQgaW5zdGFuY2VvZiBDb25zdHJ1Y3RvcikgfHwgKGZvcmJpZGRlbkZpZWxkICE9PSB1bmRlZmluZWQgJiYgZm9yYmlkZGVuRmllbGQgaW4gaXQpKSB7XG4gICAgdGhyb3cgVHlwZUVycm9yKG5hbWUgKyAnOiBpbmNvcnJlY3QgaW52b2NhdGlvbiEnKTtcbiAgfSByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hbi1pbnN0YW5jZS5qc1xuLy8gbW9kdWxlIGlkID0gNTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///59\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(32);\nvar call = __webpack_require__(169);\nvar isArrayIter = __webpack_require__(122);\nvar anObject = __webpack_require__(5);\nvar toLength = __webpack_require__(14);\nvar getIterFn = __webpack_require__(124);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mb3Itb2YuanM/YmU2NCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgY2FsbCA9IHJlcXVpcmUoJy4vX2l0ZXItY2FsbCcpO1xudmFyIGlzQXJyYXlJdGVyID0gcmVxdWlyZSgnLi9faXMtYXJyYXktaXRlcicpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBnZXRJdGVyRm4gPSByZXF1aXJlKCcuL2NvcmUuZ2V0LWl0ZXJhdG9yLW1ldGhvZCcpO1xudmFyIEJSRUFLID0ge307XG52YXIgUkVUVVJOID0ge307XG52YXIgZXhwb3J0cyA9IG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0ZXJhYmxlLCBlbnRyaWVzLCBmbiwgdGhhdCwgSVRFUkFUT1IpIHtcbiAgdmFyIGl0ZXJGbiA9IElURVJBVE9SID8gZnVuY3Rpb24gKCkgeyByZXR1cm4gaXRlcmFibGU7IH0gOiBnZXRJdGVyRm4oaXRlcmFibGUpO1xuICB2YXIgZiA9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XMvY29yZS1qcy9tb2R1bGVzL19mb3Itb2YuanNcbi8vIG1vZHVsZSBpZCA9IDYwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///60\n")},function(module,exports,__webpack_require__){eval("var redefine = __webpack_require__(24);\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19yZWRlZmluZS1hbGwuanM/MDM1ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGFyZ2V0LCBzcmMsIHNhZmUpIHtcbiAgZm9yICh2YXIga2V5IGluIHNyYykgcmVkZWZpbmUodGFyZ2V0LCBrZXksIHNyY1trZXldLCBzYWZlKTtcbiAgcmV0dXJuIHRhcmdldDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3JlZGVmaW5lLWFsbC5qc1xuLy8gbW9kdWxlIGlkID0gNjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///61\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz8wZjYyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSA2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///62\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(44);\nvar createDesc = __webpack_require__(79);\nmodule.exports = __webpack_require__(51) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ODQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gNjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///63\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(13).f;\nvar has = __webpack_require__(27);\nvar TAG = __webpack_require__(10)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtdG8tc3RyaW5nLXRhZy5qcz9jOThiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkZWYgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFRBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgdGFnLCBzdGF0KSB7XG4gIGlmIChpdCAmJiAhaGFzKGl0ID0gc3RhdCA/IGl0IDogaXQucHJvdG90eXBlLCBUQUcpKSBkZWYoaXQsIFRBRywgeyBjb25maWd1cmFibGU6IHRydWUsIHZhbHVlOiB0YWcgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtdG8tc3RyaW5nLXRhZy5qc1xuLy8gbW9kdWxlIGlkID0gNjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///64\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar defined = __webpack_require__(37);\nvar fails = __webpack_require__(8);\nvar spaces = __webpack_require__(112);\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpbmctdHJpbS5qcz82MjY3Il0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG52YXIgc3BhY2VzID0gcmVxdWlyZSgnLi9fc3RyaW5nLXdzJyk7XG52YXIgc3BhY2UgPSAnWycgKyBzcGFjZXMgKyAnXSc7XG52YXIgbm9uID0gJ1xcdTIwMGJcXHUwMDg1JztcbnZhciBsdHJpbSA9IFJlZ0V4cCgnXicgKyBzcGFjZSArIHNwYWNlICsgJyonKTtcbnZhciBydHJpbSA9IFJlZ0V4cChzcGFjZSArIHNwYWNlICsgJyokJyk7XG5cbnZhciBleHBvcnRlciA9IGZ1bmN0aW9uIChLRVksIGV4ZWMsIEFMSUFTKSB7XG4gIHZhciBleHAgPSB7fTtcbiAgdmFyIEZPUkNFID0gZmFpbHMoZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiAhIXNwYWNlc1tLRVldKCkgfHwgbm9uW0tFWV0oKSAhPSBub247XG4gIH0pO1xuICB2YXIgZm4gPSBleHBbS0VZXSA9IEZPUkNFID8gZXhlYyh0cmltKSA6IHNw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//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyYXRvcnMuanM/NmNkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHt9O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyYXRvcnMuanNcbi8vIG1vZHVsZSBpZCA9IDY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL192YWxpZGF0ZS1jb2xsZWN0aW9uLmpzP2NlYWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgVFlQRSkge1xuICBpZiAoIWlzT2JqZWN0KGl0KSB8fCBpdC5fdCAhPT0gVFlQRSkgdGhyb3cgVHlwZUVycm9yKCdJbmNvbXBhdGlibGUgcmVjZWl2ZXIsICcgKyBUWVBFICsgJyByZXF1aXJlZCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdmFsaWRhdGUtY29sbGVjdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///67\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(189);\nvar enumBugKeys = __webpack_require__(137);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///68\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(99);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///69\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSA3MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///70\n")},function(module,exports){eval("module.exports = {};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXJhdG9ycy5qcz9mZGI0Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0ge307XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlcmF0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSA3MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///71\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DataObjectSourceLanguage = exports.CatalogueObjectType = undefined;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _RethinkObject2 = __webpack_require__(557);\n\nvar _RethinkObject3 = _interopRequireDefault(_RethinkObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author alice.cheambe[at]fokus.fraunhofer.de\n * The CatalogueDataObject class is the representation of the reTHINK Catalogue Data Model\n */\nvar CatalogueDataObject = function (_RethinkObject) {\n (0, _inherits3.default)(CatalogueDataObject, _RethinkObject);\n\n /**\n * Creates the Catalogue Data Object\n * @param guid - Global Unique identifier of the Catalogue Object (e.g. Hyperty descriptor, ProtocolStub descriptor,\n * etc) enabling the same object to be stored and discovered in different Catalogues. That means, guid corresponds to\n * [resource-type-id] per BNF of Resource Path. Couldn't we have problems with too long URL paths?\n * @param type - indicates the type of Catalogue Data Object e.g. Hyperty, ProtocolStub, etc\n * @param {string} version - Indicates the version of Catalogue Data\n * @param objectName - human-understandable name of the catalogue object e.g. \"My Awesome Hyperty\"\n * @param description - description of the source package\n * @param language - the programming language used in the SourcePackage.SourceCode\n * @param sourcePackageURL - A string containing the URL from where the source code package of the corresponding\n * catalogue object, e.g. deployable packages containing executable code for Hyperties or ProtoStubs, can be downloaded\n */\n function CatalogueDataObject(guid, type, version, objectName, description, language, sourcePackageURL) {\n (0, _classCallCheck3.default)(this, CatalogueDataObject);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (CatalogueDataObject.__proto__ || (0, _getPrototypeOf2.default)(CatalogueDataObject)).call(this));\n\n _this._guid = guid;\n _this._type = type;\n _this._version = version;\n _this._objectName = objectName;\n _this._description = description;\n _this._language = language;\n _this._sourcePackageURL = sourcePackageURL;\n\n _this._signature = null;\n _this._sourcePackage = null;\n return _this;\n }\n\n // Getters\n\n\n (0, _createClass3.default)(CatalogueDataObject, [{\n key: 'guid',\n get: function get() {\n return this._guid;\n },\n set: function set(guid) {\n if (guid) this._guid = guid;\n }\n }, {\n key: 'type',\n get: function get() {\n return this._type;\n },\n set: function set(type) {\n if (type) this._type = type;\n }\n }, {\n key: 'version',\n get: function get() {\n return this._version;\n },\n set: function set(version) {\n if (version) {\n this._version = version;\n }\n }\n }, {\n key: 'objectName',\n get: function get() {\n return this._objectName;\n },\n set: function set(objectName) {\n if (objectName) this._objectName = objectName;\n }\n }, {\n key: 'description',\n get: function get() {\n return this._description;\n },\n set: function set(description) {\n if (description) this._description = description;\n }\n }, {\n key: 'language',\n get: function get() {\n return this._language;\n },\n set: function set(language) {\n if (language) this._language = language;\n }\n }, {\n key: 'signature',\n get: function get() {\n return this._signature;\n },\n\n\n // Setters\n /**\n * Set the signature to enables integrity and authenticity verification\n * @param signature\n */\n set: function set(signature) {\n if (signature) this._signature = signature;\n }\n }, {\n key: 'sourcePackage',\n get: function get() {\n return this._sourcePackage;\n },\n set: function set(sourcePackage) {\n if (sourcePackage) this._sourcePackage = sourcePackage;\n }\n }, {\n key: 'sourcePackageURL',\n get: function get() {\n return this._sourcePackageURL;\n },\n set: function set(sourcePackageURL) {\n if (sourcePackageURL) this._sourcePackageURL = sourcePackageURL;\n }\n }]);\n return CatalogueDataObject;\n}(_RethinkObject3.default);\n//Alice: removed POLICY_ENFORCER: 'policy_enforcer', DATA_SCHEMA: 'data_schema' from the list\n//wrt: https://github.com/reTHINK-project/dev-service-framework/blob/develop/docs/datamodel/core/hyperty-catalogue/readme.md#data-object-schema\n/**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nvar CatalogueObjectType = exports.CatalogueObjectType = {\n HYPERTY: 'hyperty', PROTOSTUB: 'protostub', HYPERTY_RUNTIME: 'hyperty_runtime',\n HYPERTY_INTERCEPTOR: 'hyperty_inspector', HYPERTY_DATA_OBJECT: 'hyperty_data_object'\n};\nvar DataObjectSourceLanguage = exports.DataObjectSourceLanguage = {\n JAVASCRIPT_ECMA6: 'javascript_ecma6', JAVASCRIPT_ECMA5: 'javascript_ecma5',\n JSON_SCHEMA_V4: 'json_schema_v4', PYTHON: 'python', TYPESCRIPT: 'typescript'\n};\nexports.default = CatalogueDataObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL3J1bnRpbWUtY2F0YWxvZ3VlL0NhdGFsb2d1ZURhdGFPYmplY3QuanM/ZTViNiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuICogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiAqIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuICogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0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Ozs7Ozs7Ozs7QUFtSkE7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBO0FBQ0E7QUFGQTtBQUlBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///72\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(33);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pb2JqZWN0LmpzPzQzYTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsbGJhY2sgZm9yIG5vbi1hcnJheS1saWtlIEVTMyBhbmQgbm9uLWVudW1lcmFibGUgb2xkIFY4IHN0cmluZ3NcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wcm90b3R5cGUtYnVpbHRpbnNcbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0KCd6JykucHJvcGVydHlJc0VudW1lcmFibGUoMCkgPyBPYmplY3QgOiBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGNvZihpdCkgPT0gJ1N0cmluZycgPyBpdC5zcGxpdCgnJykgOiBPYmplY3QoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///73\n")},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtcGllLmpzPzYzNTYiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0ge30ucHJvcGVydHlJc0VudW1lcmFibGU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1waWUuanNcbi8vIG1vZHVsZSBpZCA9IDc0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///74\n")},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(33);\nvar TAG = __webpack_require__(10)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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lID09ICdmdW5jdGlvbicgPyAnQXJndW1lbnRzJyA6IEI7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jbGFzc29mLmpzXG4vLyBtb2R1bGUgaWQgPSA3NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///75\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(132);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///76\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDc3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///77\n")},function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gNzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///78\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///79\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(431)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(193)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qcz9jZDA0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuLy8gMjEuMS4zLjI3IFN0cmluZy5wcm90b3R5cGVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faXRlci1kZWZpbmUnKShTdHJpbmcsICdTdHJpbmcnLCBmdW5jdGlvbiAoaXRlcmF0ZWQpIHtcbiAgdGhpcy5fdCA9IFN0cmluZyhpdGVyYXRlZCk7IC8vIHRhcmdldFxuICB0aGlzLl9pID0gMDsgICAgICAgICAgICAgICAgLy8gbmV4dCBpbmRleFxuLy8gMjEuMS41LjIuMSAlU3RyaW5nSXRlcmF0b3JQcm90b3R5cGUlLm5leHQoKVxufSwgZnVuY3Rpb24gKCkge1xuICB2YXIgTyA9IHRoaXMuX3Q7XG4gIHZhciBpbmRleCA9IHRoaXMuX2k7XG4gIHZhciBwb2ludDtcbiAgaWYgKGluZGV4ID49IE8ubGVuZ3RoKSByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIHBvaW50ID0gJGF0KE8sIGluZGV4KTtcbiAgdGhpcy5faSArPSBwb2ludC5sZW5ndGg7XG4gIHJldHVybiB7IHZhbHVlOiBwb2ludCwgZG9uZTogZmFsc2UgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gODBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///80\n")},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/MzY5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSA4MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///81\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(454);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(456);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {\n return typeof obj === "undefined" ? "undefined" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz9hNDU2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2l0ZXJhdG9yID0gcmVxdWlyZShcIi4uL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yXCIpO1xuXG52YXIgX2l0ZXJhdG9yMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2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N0aW9uXCIgJiYgb2JqLmNvbnN0cnVjdG9yID09PSBfc3ltYm9sMi5kZWZhdWx0ICYmIG9iaiAhPT0gX3N5bWJvbDIuZGVmYXVsdC5wcm90b3R5cGUgPyBcInN5bWJvbFwiIDogdHlwZW9mIG9iaiA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiBfdHlwZW9mKG9iaik7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90eXBlb2YuanNcbi8vIG1vZHVsZSBpZCA9IDgyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///82\n')},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(31);\nvar global = __webpack_require__(7);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(48) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zaGFyZWQuanM/NTU2OCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBTSEFSRUQgPSAnX19jb3JlLWpzX3NoYXJlZF9fJztcbnZhciBzdG9yZSA9IGdsb2JhbFtTSEFSRURdIHx8IChnbG9iYWxbU0hBUkVEXSA9IHt9KTtcblxuKG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIHN0b3JlW2tleV0gfHwgKHN0b3JlW2tleV0gPSB2YWx1ZSAhPT0gdW5kZWZpbmVkID8gdmFsdWUgOiB7fSk7XG59KSgndmVyc2lvbnMnLCBbXSkucHVzaCh7XG4gIHZlcnNpb246IGNvcmUudmVyc2lvbixcbiAgbW9kZTogcmVxdWlyZSgnLi9fbGlicmFyeScpID8gJ3B1cmUnIDogJ2dsb2JhbCcsXG4gIGNvcHlyaWdodDogJ8KpIDIwMTggRGVuaXMgUHVzaGthcmV2ICh6bG9pcm9jay5ydSknXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2hhcmVkLmpzXG4vLyBtb2R1bGUgaWQgPSA4M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///83\n")},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(28);\nvar toLength = __webpack_require__(14);\nvar toAbsoluteIndex = __webpack_require__(55);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1pbmNsdWRlcy5qcz9hMmRlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbHNlIC0+IEFycmF5I2luZGV4T2Zcbi8vIHRydWUgIC0+IEFycmF5I2luY2x1ZGVzXG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKElTX0lOQ0xVREVTKSB7XG4gIHJldHVybiBmdW5jdGlvbiAoJHRoaXMsIGVsLCBmcm9tSW5kZXgpIHtcbiAgICB2YXIgTyA9IHRvSU9iamVjdCgkdGhpcyk7XG4gICAgdmFyIGxlbmd0aCA9IHRvTGVuZ3RoKE8ubGVuZ3RoKTtcbiAgICB2YXIgaW5kZXggPSB0b0Fic29sdXRlSW5kZXgoZnJvbUluZGV4LCBsZW5ndGgpO1xuICAgIHZhciB2YWx1ZTtcbiAgICAvLyBBcnJheSNpbmNsdWRlcyB1c2VzIFNhbWVWYWx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f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wcy5qcz82MzUzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMuZiA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1nb3BzLmpzXG4vLyBtb2R1bGUgaWQgPSA4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///85\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(33);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1hcnJheS5qcz81Y2VkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMi4yIElzQXJyYXkoYXJndW1lbnQpXG52YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gaXNBcnJheShhcmcpIHtcbiAgcmV0dXJuIGNvZihhcmcpID09ICdBcnJheSc7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///86\n")},function(module,exports,__webpack_require__){eval("// 7.2.8 IsRegExp(argument)\nvar isObject = __webpack_require__(9);\nvar cof = __webpack_require__(33);\nvar MATCH = __webpack_require__(10)('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1yZWdleHAuanM/YmI0MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuOCBJc1JlZ0V4cChhcmd1bWVudClcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xudmFyIE1BVENIID0gcmVxdWlyZSgnLi9fd2tzJykoJ21hdGNoJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICB2YXIgaXNSZWdFeHA7XG4gIHJldHVybiBpc09iamVjdChpdCkgJiYgKChpc1JlZ0V4cCA9IGl0W01BVENIXSkgIT09IHVuZGVmaW5lZCA/ICEhaXNSZWdFeHAgOiBjb2YoaXQpID09ICdSZWdFeHAnKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2lzLXJlZ2V4cC5qc1xuLy8gbW9kdWxlIGlkID0gODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///87\n")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(10)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyLWRldGVjdC5qcz9hYTRjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIFNBRkVfQ0xPU0lORyA9IGZhbHNlO1xuXG50cnkge1xuICB2YXIgcml0ZXIgPSBbN11bSVRFUkFUT1JdKCk7XG4gIHJpdGVyWydyZXR1cm4nXSA9IGZ1bmN0aW9uICgpIHsgU0FGRV9DTE9TSU5HID0gdHJ1ZTsgfTtcbiAgLy8gZXNsaW50LWRp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("\n// 21.2.5.3 get RegExp.prototype.flags\nvar anObject = __webpack_require__(5);\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mbGFncy5qcz9kMjkxIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIxLjIuNS4zIGdldCBSZWdFeHAucHJvdG90eXBlLmZsYWdzXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkge1xuICB2YXIgdGhhdCA9IGFuT2JqZWN0KHRoaXMpO1xuICB2YXIgcmVzdWx0ID0gJyc7XG4gIGlmICh0aGF0Lmdsb2JhbCkgcmVzdWx0ICs9ICdnJztcbiAgaWYgKHRoYXQuaWdub3JlQ2FzZSkgcmVzdWx0ICs9ICdpJztcbiAgaWYgKHRoYXQubXVsdGlsaW5lKSByZXN1bHQgKz0gJ20nO1xuICBpZiAodGhhdC51bmljb2RlKSByZXN1bHQgKz0gJ3UnO1xuICBpZiAodGhhdC5zdGlja3kpIHJlc3VsdCArPSAneSc7XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gODlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///89\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar hide = __webpack_require__(23);\nvar redefine = __webpack_require__(24);\nvar fails = __webpack_require__(8);\nvar defined = __webpack_require__(37);\nvar wks = __webpack_require__(10);\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19maXgtcmUtd2tzLmpzPzU2MGQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xudmFyIHdrcyA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y8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZpeC1yZS13a3MuanNcbi8vIG1vZHVsZSBpZCA9IDkwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///90\n")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(5);\nvar aFunction = __webpack_require__(20);\nvar SPECIES = __webpack_require__(10)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zcGVjaWVzLWNvbnN0cnVjdG9yLmpzP2VjZWQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4zLjIwIFNwZWNpZXNDb25zdHJ1Y3RvcihPLCBkZWZhdWx0Q29uc3RydWN0b3IpXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgU1BFQ0lFUyA9IHJlcXVpcmUoJy4vX3drcycpKCdzcGVjaWVzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChPLCBEKSB7XG4gIHZhciBDID0gYW5PYmplY3QoTykuY29uc3RydWN0b3I7XG4gIHZhciBTO1xuICByZXR1cm4gQyA9PT0gdW5kZWZpbmVkIHx8IChTID0gYW5PYmplY3QoQylbU1BFQ0lFU10pID09IHVuZGVmaW5lZCA/IEQgOiBhRnVuY3Rpb24oUyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zcGVjaWVzLWNvbnN0cnVjdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///91\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL191c2VyLWFnZW50LmpzP2UzNWMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIG5hdmlnYXRvciA9IGdsb2JhbC5uYXZpZ2F0b3I7XG5cbm1vZHVsZS5leHBvcnRzID0gbmF2aWdhdG9yICYmIG5hdmlnYXRvci51c2VyQWdlbnQgfHwgJyc7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3VzZXItYWdlbnQuanNcbi8vIG1vZHVsZSBpZCA9IDkyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///92\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(24);\nvar redefineAll = __webpack_require__(61);\nvar meta = __webpack_require__(47);\nvar forOf = __webpack_require__(60);\nvar anInstance = __webpack_require__(59);\nvar isObject = __webpack_require__(9);\nvar fails = __webpack_require__(8);\nvar $iterDetect = __webpack_require__(88);\nvar setToStringTag = __webpack_require__(64);\nvar inheritIfRequired = __webpack_require__(113);\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb2xsZWN0aW9uLmpzP2QxMTgiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcp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ICBpZiAoIUlTX1dFQUspIGNvbW1vbi5zZXRTdHJvbmcoQywgTkFNRSwgSVNfTUFQKTtcblxuICByZXR1cm4gQztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2NvbGxlY3Rpb24uanNcbi8vIG1vZHVsZSBpZCA9IDkzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///93\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar hide = __webpack_require__(23);\nvar uid = __webpack_require__(53);\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190eXBlZC5qcz9kM2I5Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xudmFyIFRZUEVEID0gdWlkKCd0eXBlZF9hcnJheScpO1xudmFyIFZJRVcgPSB1aWQoJ3ZpZXcnKTtcbnZhciBBQlYgPSAhIShnbG9iYWwuQXJyYXlCdWZmZXIgJiYgZ2xvYmFsLkRhdGFWaWV3KTtcbnZhciBDT05TVFIgPSBBQlY7XG52YXIgaSA9IDA7XG52YXIgbCA9IDk7XG52YXIgVHlwZWQ7XG5cbnZhciBUeXBlZEFycmF5Q29uc3RydWN0b3JzID0gKFxuICAnSW50OEFycmF5LFVpbnQ4QXJyYXksVWludDhDbGFtcGVkQXJyYXksSW50MTZBcnJheSxVaW50MTZBcnJheSxJbnQzMkFycmF5LFVpbnQzMkFycmF5LEZsb2F0MzJBcnJheSxGbG9hdDY0QXJyYXknXG4pLnNwbGl0KCcsJyk7XG5cbndoaWxlIChpIDwgbCkge1xuICBpZiAoVHlwZWQgPSBnbG9iYWxbVHlwZWRBcnJheUNvbnN0cnVjdG9yc1tpKytdXSkge1xuICAgIGhpZGUoVHlwZWQucHJvdG90eXBlLCBUWVBFRCwgdHJ1ZSk7XG4gICAgaGlkZShUeXBlZC5wcm90b3R5cGUsIFZJRVcsIHRydWUpO1xuICB9IGVsc2UgQ09OU1RSID0gZmFsc2U7XG59XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICBBQlY6IEFCVixcbiAgQ09OU1RSOiBDT05TVFIsXG4gIFRZUEVEOiBUWVBFRCxcbiAgVklFVzogVklFV1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdHlwZWQuanNcbi8vIG1vZHVsZSBpZCA9IDk0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///94\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// Forced replacement prototype accessors methods\nmodule.exports = __webpack_require__(48) || !__webpack_require__(8)(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete __webpack_require__(7)[K];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZm9yY2VkLXBhbS5qcz83NjZlIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEZvcmNlZCByZXBsYWNlbWVudCBwcm90b3R5cGUgYWNjZXNzb3JzIG1ldGhvZHNcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fbGlicmFyeScpIHx8ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgdmFyIEsgPSBNYXRoLnJhbmRvbSgpO1xuICAvLyBJbiBGRiB0aHJvd3Mgb25seSBkZWZpbmUgbWV0aG9kc1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdW5kZWYsIG5vLXVzZWxlc3MtY2FsbFxuICBfX2RlZmluZVNldHRlcl9fLmNhbGwobnVsbCwgSywgZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9KTtcbiAgZGVsZXRlIHJlcXVpcmUoJy4vX2dsb2JhbCcpW0tdO1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1mb3JjZWQtcGFtLmpzXG4vLyBtb2R1bGUgaWQgPSA5NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///95\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = __webpack_require__(0);\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtY29sbGVjdGlvbi1vZi5qcz9kMjNkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtc2V0bWFwLW9mZnJvbS9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKENPTExFQ1RJT04pIHtcbiAgJGV4cG9ydCgkZXhwb3J0LlMsIENPTExFQ1RJT04sIHsgb2Y6IGZ1bmN0aW9uIG9mKCkge1xuICAgIHZhciBsZW5ndGggPSBhcmd1bWVudHMubGVuZ3RoO1xuICAgIHZhciBBID0gbmV3IEFycmF5KGxlbmd0aCk7XG4gICAgd2hpbGUgKGxlbmd0aC0tKSBBW2xlbmd0aF0gPSBhcmd1bWVudHNbbGVuZ3RoXTtcbiAgICByZXR1cm4gbmV3IHRoaXMoQSk7XG4gIH0gfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtY29sbGVjdGlvbi1vZi5qc1xuLy8gbW9kdWxlIGlkID0gOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///96\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(20);\nvar ctx = __webpack_require__(32);\nvar forOf = __webpack_require__(60);\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtY29sbGVjdGlvbi1mcm9tLmpzPzg4YWEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1zZXRtYXAtb2Zmcm9tL1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgZm9yT2YgPSByZXF1aXJlKCcuL19mb3Itb2YnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoQ09MTEVDVElPTikge1xuICAkZXhwb3J0KCRleHBvcnQuUywgQ09MTEVDVElPTiwgeyBmcm9tOiBmdW5jdGl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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///97\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gOThcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///98\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gOTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///99\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(44).f;\nvar has = __webpack_require__(62);\nvar TAG = __webpack_require__(22)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtdG8tc3RyaW5nLXRhZy5qcz83YmE5Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkZWYgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFRBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgdGFnLCBzdGF0KSB7XG4gIGlmIChpdCAmJiAhaGFzKGl0ID0gc3RhdCA/IGl0IDogaXQucHJvdG90eXBlLCBUQUcpKSBkZWYoaXQsIFRBRywgeyBjb25maWd1cmFibGU6IHRydWUsIHZhbHVlOiB0YWcgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC10by1zdHJpbmctdGFnLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///100\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(434);\nvar global = __webpack_require__(21);\nvar hide = __webpack_require__(63);\nvar Iterators = __webpack_require__(71);\nvar TO_STRING_TAG = __webpack_require__(22)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = Iterators.Array;\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL3dlYi5kb20uaXRlcmFibGUuanM/ZmFkMyJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL2VzNi5hcnJheS5pdGVyYXRvcicpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgVE9fU1RSSU5HX1RBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuXG52YXIgRE9NSXRlcmFibGVzID0gKCdDU1NSdWxlTGlzdCxDU1NTdHlsZURlY2xhcmF0aW9uLENTU1ZhbHVlTGlzdCxDbGllbnRSZWN0TGlzdCxET01SZWN0TGlzdCxET01TdHJpbmdMaXN0LCcgK1xuICAnRE9NVG9rZW5MaXN0LERhdGFUcmFuc2Zlckl0ZW1MaXN0LEZpbGVMaXN0LEhUTUxBbGxDb2xsZWN0aW9uLEhUTUxDb2xsZWN0aW9uLEhUTUxGb3JtRWxlbWVudCxIVE1MU2VsZWN0RWxlbWVudCwnICtcbiAgJ01lZGlhTGlzdCxNaW1lVHlwZUFycmF5LE5hbWVkTm9kZU1hcCxOb2RlTGlzdCxQYWludFJlcXVlc3RMaXN0LFBsdWdpbixQbHVnaW5BcnJheSxTVkdMZW5ndGhMaXN0LFNWR051bWJlckxpc3QsJyArXG4gICdTVkdQYXRoU2VnTGlzdCxTVkdQb2ludExpc3QsU1ZHU3RyaW5nTGlzdCxTVkdUcmFuc2Zvcm1MaXN0LFNvdXJjZUJ1ZmZlckxpc3QsU3R5bGVTaGVldExpc3QsVGV4dFRyYWNrQ3VlTGlzdCwnICtcbiAgJ1RleHRUcmFja0xpc3QsVG91Y2hMaXN0Jykuc3BsaXQoJywnKTtcblxuZm9yICh2YXIgaSA9IDA7IGkgPCBET01JdGVyYWJsZXMubGVuZ3RoOyBpKyspIHtcbiAgdmFyIE5BTUUgPSBET01JdGVyYWJsZXNbaV07XG4gIHZhciBDb2xsZWN0aW9uID0gZ2xvYmFsW05BTUVdO1xuICB2YXIgcHJvdG8gPSBDb2xsZWN0aW9uICYmIENvbGxlY3Rpb24ucHJvdG90eXBlO1xuICBpZiAocHJvdG8gJiYgIXByb3RvW1RPX1NUUklOR19UQUddKSBoaWRlKHByb3RvLCBUT19TVFJJTkdfVEFHLCBOQU1FKTtcbiAgSXRlcmF0b3JzW05BTUVdID0gSXRlcmF0b3JzLkFycmF5O1xufVxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZS5qc1xuLy8gbW9kdWxlIGlkID0gMTAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///101\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nvar runtimeUtils = exports.runtimeUtils = {\n runtimeDescriptor: {},\n runtimeCapabilities: {\n constraints: {}\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL3J1bnRpbWVVdGlscy5qcz9iYWE0Il0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBsZXQgcnVudGltZVV0aWxzID0ge1xuICBydW50aW1lRGVzY3JpcHRvcjoge30sXG4gIHJ1bnRpbWVDYXBhYmlsaXRpZXM6IHtcbiAgICBjb25zdHJhaW50czoge31cbiAgfVxufTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcnVudGltZS9ydW50aW1lVXRpbHMuanMiXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFEQTtBQUZBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///102\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _getOwnPropertyDescriptor = __webpack_require__(480);\n\nvar _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = (0, _getOwnPropertyDescriptor2.default)(object, property);\n\n if (desc === undefined) {\n var parent = (0, _getPrototypeOf2.default)(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vb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bHQpKG9iamVjdCk7XG5cbiAgICBpZiAocGFyZW50ID09PSBudWxsKSB7XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gZ2V0KHBhcmVudCwgcHJvcGVydHksIHJlY2VpdmVyKTtcbiAgICB9XG4gIH0gZWxzZSBpZiAoXCJ2YWx1ZVwiIGluIGRlc2MpIHtcbiAgICByZXR1cm4gZGVzYy52YWx1ZTtcbiAgfSBlbHNlIHtcbiAgICB2YXIgZ2V0dGVyID0gZGVzYy5nZXQ7XG5cbiAgICBpZiAoZ2V0dGVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgcmV0dXJuIGdldHRlci5jYWxsKHJlY2VpdmVyKTtcbiAgfVxufTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvZ2V0LmpzXG4vLyBtb2R1bGUgaWQgPSAxMDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///103\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('address-allocation'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log system\n\n\n// TODO: this could not be the best way to do a Singleton but at this moment it works;\n\nvar instance = void 0;\n\n/**\n * Class will ask to the message node for addresses\n */\n\nvar AddressAllocation = function () {\n /* private\n _url: URL\n _bus: MiniBus\n */\n\n /**\n * Create an Address Allocation\n * @param {URL.URL} url - url from who is sending the message\n * @param {MiniBus} bus - MiniBus used for address allocation\n */\n function AddressAllocation(url, bus, registry, subscriptionManager) {\n (0, _classCallCheck3.default)(this, AddressAllocation);\n\n\n if (!instance) {\n this._url = url + '/address-allocation';\n this._bus = bus;\n this._registry = registry;\n this._subscriptionManager = subscriptionManager;\n instance = this;\n } else {\n return instance;\n }\n }\n\n (0, _createClass3.default)(AddressAllocation, [{\n key: 'create',\n\n\n /**\n *\n * Ask for creation of a number of Hyperty addresses, to the domain message node.\n *\n * @param {Domain} domain - domain of the message node\n * @param {Number} number - number of address to be allocated\n * @param {Descriptor} info - descriptor to search for the hyperty (TODO:// this should be confirmed)\n * @see https://github.com/reTHINK-project/specs/blob/master/datamodel/core/hyperty-catalogue/readme.md#catalogue-data-model\n * @param {scheme} scheme - scheme of address to be created or reused, like: hyperty, comm, context, etc;\n * @param {boolean|URL.HypertyURL} reuseURL - reuseURL is used to reuse the hypertyURL previously registred;\n * @returns {Promise} this is Promise and returns an object with the address information\n *\n * @memberOf AddressAllocation\n */\n value: function create(domain, number, info, scheme, reuseURL) {\n\n // // console.log('typeof(reuseURL)', typeof(reuseURL), reuseURL);\n //debugger;\n if (reuseURL) {\n\n if (typeof reuseURL === 'boolean') {\n\n if (reuseURL) {\n return this._reuseAllocatedAddress(domain, number, info, scheme, reuseURL);\n } else {\n return this._allocateNewAddress(domain, scheme, number, info);\n }\n }\n\n if (typeof reuseURL === 'string' && (0, _utils.isURL)(reuseURL)) {\n //return this._reuseAllocatedAddress(domain, number, info, scheme, reuseURL);\n return new _promise2.default(function (resolve, reject) {\n var value = { newAddress: false, address: [reuseURL] };\n return resolve(value);\n });\n }\n } else {\n log.info('[AddressAllocation] - new address will be allocated');\n\n // if there is no URL saved request a new URL\n return this._allocateNewAddress(domain, scheme, number, info);\n }\n }\n }, {\n key: '_reuseAllocatedAddress',\n value: function _reuseAllocatedAddress(domain, number, info, scheme, reuseURL) {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n console.log('REUSETEST - _reuseAllocatedAddress', domain, number, info, scheme, reuseURL);\n _this2._registry.checkRegisteredURLs(info, reuseURL).then(function (urls) {\n console.log('REUSETEST - registeredurls', urls);\n if (urls) {\n log.info('[AddressAllocation - ' + scheme + '] - Reuse URL');\n var value = { newAddress: false, address: urls };\n resolve(value);\n } else {\n\n if (typeof reuseURL === 'string') {\n log.info('[AddressAllocation - reuseURL] - Object ' + reuseURL + ' not found');\n reject('URL Not Found');\n } else if (typeof reuseURL === 'boolean') {\n _this2._allocateNewAddress(domain, scheme, number, info).then(resolve).catch(reject);\n } else {\n reject('URL Not Found');\n }\n }\n });\n });\n }\n }, {\n key: '_allocateNewAddress',\n value: function _allocateNewAddress(domain, scheme, number, info) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var addresses = [];\n var i;\n\n for (i = 0; i < number; i++) {\n addresses.push(scheme + '://' + domain + '/' + (0, _utils.generateGUID)());\n }\n\n var result = { newAddress: true, address: addresses };\n\n if (scheme === 'hyperty') {\n if (info.hasOwnProperty('_configuration')) {\n var domainRouting = info._configuration.hasOwnProperty('domain_routing') ? info.configuration.domain_routing : true;\n if (domainRouting) {\n _this._subscriptionManager.createSubscription(domain, addresses, _this._url).then(function () {\n resolve(result);\n });\n } else resolve(result);\n } else resolve(result);\n } else resolve(result);\n\n /* let msg = {\n type: 'create', from: this._url, to: 'domain://msg-node.' + domain + '/address-allocation',\n body: {value: { number: number } }\n };\n \n if (scheme !== 'hyperty') msg.body.scheme = scheme;\n \n log.info('[AddressAllocation - ' + scheme + '] - Request new URL');\n \n this._bus.postMessage(msg, (reply) => {\n if (reply.body.code === 200) {\n let result = {newAddress: true, address: reply.body.value.allocated};\n resolve(result);\n } else {\n reject(reply.body.desc);\n }\n });*/\n });\n }\n\n /**\n * Send a request to the domain message node, to deallocate one or more addresses\n * @param {Domain} domain - Domain of the message node.\n * @param {addresses} addresses to request the deallocation\n * @returns {Promise} the response by the message node\n */\n\n }, {\n key: 'delete',\n value: function _delete(domain, addresses) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n resolve(200);\n\n /* let message = {\n type: 'delete', from: _this._url, to: 'domain://msg-node.' + domain + '/address-allocation',\n body: {childrenResources: addresses}\n };\n \n _this._bus.postMessage(message, (reply) => {\n if (reply.body.code === 200) {\n resolve(reply.body.code);\n } else {\n reject(reply.body.desc);\n }\n });*/\n });\n }\n }, {\n key: 'url',\n\n\n /**\n * get the URL value\n * @return {string} The url value;\n */\n get: function get() {\n return this._url;\n }\n }], [{\n key: 'instance',\n get: function get() {\n if (!instance) {\n throw new Error('The address allocation was not instantiated');\n }\n\n return instance;\n }\n }]);\n return AddressAllocation;\n}();\n\nexports.default = AddressAllocation;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9hbGxvY2F0aW9uL0FkZHJlc3NBbGxvY2F0aW9uLmpzPzFlNmEiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7OztBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTtBQUVBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFHQTtBQUNBO0FBRUE7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBa0JBO0FBRUE7QUFDQTtBQUNBOzs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7QUFZQTtBQUVBOzs7OztBQWhLQTs7OztBQUlBO0FBQUE7QUFBQTs7O0FBWkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBcUtBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///104\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Crypto = __webpack_require__(525);\n\nvar _Crypto2 = _interopRequireDefault(_Crypto);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('CryptoManager'); // Log System\n\n/**\n* The Crypto Manager provides manages cryptographic features for the runtime including:\n* - Mutual Authentication between peers\n* - Crypto Keys\n* - e2e encryption and decription of communication between Hyperties and dta objects\n*\n*/\nvar CryptoManager = function () {\n\n /**\n * This is the constructor to initialise the CryptoManager, it does not require any input.\n * The init() must called in order to set mandatories attributes\n */\n\n function CryptoManager(storageManager) {\n (0, _classCallCheck3.default)(this, CryptoManager);\n\n this.storageManager = storageManager;\n this.userDefaultKeyRef = 'userAsymmetricKey';\n }\n\n (0, _createClass3.default)(CryptoManager, [{\n key: 'init',\n value: function init(runtimeURL, runtimeCapabilities, storageManager, dataObjectsStorage, registry, coreDiscovery, idm, runtimeFactory) {\n var _this = this;\n\n if (!runtimeURL) throw new Error('[] runtimeURL is missing.');\n if (!storageManager) throw new Error('storageManager is missing');\n if (!runtimeFactory) throw new Error('runtimeFactory is missing');\n\n _this._runtimeURL = runtimeURL;\n _this._cryptoManagerURL = _this._runtimeURL + '/cryptoManager';\n\n //_this._myURL = _this._runtimeURL + '/crypto';\n _this.storageManager = storageManager;\n _this.dataObjectsStorage = dataObjectsStorage;\n _this.runtimeCapabilities = runtimeCapabilities;\n\n _this._runtimeFactory = runtimeFactory;\n _this._domain = (0, _utils.divideURL)(_this._runtimeURL).domain;\n\n _this.crypto = new _Crypto2.default(_this._runtimeFactory);\n\n // hashTable to store all the crypto information between two hyperties\n _this.chatKeys = {};\n\n // hashTable to store the symmetric keys to be used in the chat group\n _this.dataObjectSessionKeys = {};\n\n //failsafe to enable/disable all the criptographic functions\n _this.isToUseEncryption = true;\n\n _this._registry = registry;\n _this._coreDiscovery = coreDiscovery;\n\n _this._idm = idm;\n }\n\n //******************* GET AND SET METHODS *******************\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n }, {\n key: 'loadSessionKeys',\n\n\n // to be used to initialise IDM with SessionKeys used in previous session\n\n value: function loadSessionKeys() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n if (sessionKeys) _this.dataObjectSessionKeys = sessionKeys;else _this.dataObjectSessionKeys = {};\n resolve();\n });\n });\n }\n }, {\n key: '_isFromRemoteSM',\n value: function _isFromRemoteSM(from) {\n var splitFrom = from.split('://');\n return splitFrom[0] === 'runtime' && from !== this._runtimeURL + '/sm';\n }\n }, {\n key: 'addCryptoGUIListeners',\n value: function addCryptoGUIListeners() {\n //TODO: Change the GUI invocation of this method\n var _this = this;\n\n _this._messageBus.addListener(_this._cryptoManagerURL, function (msg) {\n var funcName = msg.body.method;\n\n //let returnedValue;\n if (funcName === 'generateRSAKeyPair') {\n _this._crypto.getMyPublicKey().then(function (key) {\n var value = { type: 'execute', value: key, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if generateRSAKeyPair method postMessage error: ' + err);\n }\n });\n return;\n }\n });\n }\n\n //******************* ENCRYPTION METHODS *******************\n /**\n * Identifies the messages to be encrypted\n * @param {Message} message\n * @returns {boolean} returns true if the message requires encryption\n */\n\n }, {\n key: '_isToEncrypt',\n value: function _isToEncrypt(message) {\n var _this = this;\n log.info('[CryptoManager.istoChyperModule]', message);\n var isCreate = message.type === 'create';\n var isFromHyperty = message.from.includes('hyperty://');\n var isToHyperty = message.to.includes('hyperty://');\n var isToDataObject = (0, _utils.isDataObjectURL)(message.to);\n var reporter = _this.registry.getDataObjectReporter(message.to);\n\n var doMutualAuthentication = message.body.hasOwnProperty('mutual') ? message.body.mutual : true;\n\n if (!doMutualAuthentication) return false;\n if (reporter !== null && (0, _utils.isLegacy)(reporter)) {\n return false;\n }\n\n //if is not to apply encryption, then returns resolve\n if (!this.isToUseEncryption && !(message.type === 'handshake')) {\n log.info('not handshake: encryption disabled');\n return false;\n }\n\n if (message.type === 'update') {\n log.info('update:encryption disabled');\n return false;\n }\n\n if ((0, _utils.isLegacy)(message.to)) return false;\n\n return isCreate && isFromHyperty && isToHyperty || isCreate && isFromHyperty && isToDataObject && doMutualAuthentication || message.type === 'handshake' || message.type === 'update' && doMutualAuthentication;\n }\n }, {\n key: '_isToDecrypt',\n value: function _isToDecrypt(message) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n // For sybscribe message let's start the mutualAuthentication\n var isSubscription = message.type === 'subscribe';\n var isFromRemoteSM = _this._isFromRemoteSM(message.from);\n\n if (isSubscription & isFromRemoteSM) {\n log.log('_doMutualAuthenticationPhase1');\n console.log('istoDecrypt', message);\n var reporter = _this.registry.getDataObjectReporter(message.to);\n if (reporter !== null && (0, _utils.isLegacy)(reporter)) {\n return resolve(false);\n }\n\n _this._doMutualAuthenticationPhase1(message).then(function () {\n resolve(false);\n }, function (error) {\n reject(error);\n });\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('value') && typeof message.body.value === 'string') {\n log.log('_isToDecrypt:true');\n resolve(true);\n } else {\n log.log('_isToDecrypt:false');\n resolve(false);\n }\n }).catch(function (error) {\n log.error('[CryptoManager._isToDecrypt]', error);\n });\n }\n }, {\n key: 'encryptMessage',\n value: function encryptMessage(message) {\n //log.info('encryptMessage:message', message);\n var _this = this;\n\n log.log('encrypt message ');\n\n return new _promise2.default(function (resolve, reject) {\n\n var isHandShakeType = message.type === 'handshake';\n\n //if is not to apply encryption, then returns resolve\n if (!_this._isToEncrypt(message)) {\n // log.log('decryption disabled');\n return resolve(message);\n }\n\n var dataObjectURL = (0, _utils.parseMessageURL)(message.to);\n\n var isToDataObject = (0, _utils.isDataObjectURL)(dataObjectURL);\n var isToLegacyIdentity = (0, _utils.isLegacy)(message.to);\n var isFromHyperty = (0, _utils.divideURL)(message.from).type === 'hyperty';\n var isToHyperty = (0, _utils.divideURL)(message.to).type === 'hyperty';\n\n if (message.type === 'update') {\n log.log('encrypt message: message type update');\n return resolve(message);\n }\n\n if (isToLegacyIdentity) {\n resolve(message);\n } else if (isFromHyperty && isToHyperty) {\n var userURL = _this._registry.getHypertyOwner(message.from);\n if (userURL) {\n\n // check if exists any keys between two users\n var chatKeys = _this.chatKeys[message.from + '<->' + message.to];\n if (!chatKeys) {\n chatKeys = _this._newChatCrypto(message, userURL);\n\n //log.log('createChatKey encrypt', message.from + message.to);\n _this.chatKeys[message.from + '<->' + message.to] = chatKeys;\n message.body.handshakePhase = 'startHandShake';\n }\n\n if (chatKeys.authenticated && !isHandShakeType) {\n\n var iv = _this.crypto.generateIV();\n _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, (0, _utils.stringify)(message.body.value), iv).then(function (encryptedValue) {\n\n var filteredMessage = _this._filterMessageToHash(message, (0, _utils.stringify)(message.body.value) + (0, _utils.stringify)(iv), chatKeys.hypertyFrom.messageInfo);\n\n _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage).then(function (hash) {\n //log.log('result of hash ', hash);\n var value = { iv: (0, _utils.encode)(iv), value: (0, _utils.encode)(encryptedValue), hash: (0, _utils.encode)(hash) };\n message.body.value = (0, _utils.encode)(value);\n\n resolve(message);\n });\n });\n\n // if is a handshake message, just resolve it\n } else if (isHandShakeType) {\n resolve(message);\n\n // else, starts a new handshake protocol\n } else {\n _this._doHandShakePhase(message, chatKeys).then(function (value) {\n _this.chatKeys[message.from + '<->' + message.to] = value.chatKeys;\n\n _this._messageBus.postMessage(value.message);\n reject('encrypt handshake protocol phase ');\n });\n }\n } else {\n reject('In encryptMessage: Hyperty owner URL was not found');\n }\n\n //if from hyperty to a dataObjectURL\n } else if (isFromHyperty && isToDataObject) {\n\n //log.log('dataObject value to encrypt: ', message.body.value);\n //log.log('IdentityModule - encrypt from hyperty to dataobject ', message);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys || {});\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n _this.dataObjectsStorage.getDataObject(dataObjectURL).then(function (isHypertyReporter) {\n //if no key exists, create a new one if is the reporter of dataObject\n if (!dataObjectKey) {\n // if the hyperty is the reporter of the dataObject then generates a session key\n if (isHypertyReporter.reporter && isHypertyReporter.reporter === message.from) {\n\n var sessionKey = _this.crypto.generateRandom();\n _this.dataObjectSessionKeys[dataObjectURL] = { sessionKey: sessionKey, isToEncrypt: true };\n var dataObjectSessionKeysClone = (0, _utils.chatkeysToStringCloner)(_this.dataObjectSessionKeys);\n\n //TODO: check if this does not need to be stored\n _this.storageManager.set('dataObjectSessionKeys', 0, dataObjectSessionKeysClone).catch(function (err) {\n reject('On encryptMessage from method storageManager.set error: ' + err);\n });\n dataObjectKey = _this.dataObjectSessionKeys[dataObjectURL];\n }\n }\n\n //check if there is already a session key for the chat room\n if (dataObjectKey) {\n\n // and if is to apply encryption, encrypt the messages\n if (dataObjectKey.isToEncrypt) {\n var _iv = _this.crypto.generateIV();\n var stringifiedIV = (0, _utils.stringify)(_iv);\n var stringifiedMessageBody = (0, _utils.stringify)(message.body.value);\n\n _this.crypto.encryptAES(dataObjectKey.sessionKey, stringifiedMessageBody, _iv).then(function (encryptedValue) {\n delete message.body.identity.assertion; //TODO: Check why assertion is comming on the message!\n delete message.body.identity.expires; //TODO: Check why expires is comming on the message!\n var filteredMessage = _this._filterMessageToHash(message, stringifiedMessageBody + stringifiedIV);\n\n _this.crypto.hashHMAC(dataObjectKey.sessionKey, filteredMessage).then(function (hash) {\n // log.log('hash ', hash);\n\n var newValue = { value: (0, _utils.encode)(encryptedValue), iv: (0, _utils.encode)(_iv), hash: (0, _utils.encode)(hash) };\n\n message.body.value = (0, _utils.stringify)(newValue);\n resolve(message);\n });\n });\n\n // if not, just send the message\n } else {\n resolve(message);\n }\n\n // start the generation of a new session Key\n } else {\n reject('Data object key could not be defined: Failed to decrypt message ');\n }\n }).catch(function (err) {\n reject('On encryptMessage from method dataObjectsStorage.getDataObject error: ' + err);\n });\n }).catch(function (err) {\n reject('On encryptMessage from method storageManager.get error: ' + err);\n });\n }\n });\n }\n }, {\n key: 'encryptDataObject',\n value: function encryptDataObject(dataObject, sender) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n log.info('dataObject value to encrypt: ', dataObject);\n\n var dataObjectURL = (0, _utils.parseMessageURL)(sender);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys || {});\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n //check if there is already a session key for the chat room\n if (dataObjectKey) {\n\n // and if is to apply encryption, encrypt the messages\n if (dataObjectKey.isToEncrypt) {\n var iv = _this.crypto.generateIV();\n\n _this.crypto.encryptAES(dataObjectKey.sessionKey, (0, _utils.stringify)(dataObject), iv).then(function (encryptedValue) {\n var newValue = { value: (0, _utils.encode)(encryptedValue), iv: (0, _utils.encode)(iv) };\n\n //log.log('encrypted dataObject', newValue);\n return resolve(newValue);\n }).catch(function (err) {\n reject('On encryptDataObject from method encryptAES error: ' + err);\n });\n\n // if not, just send the message\n } else {\n log.info('The dataObject is not encrypted');\n return resolve(dataObject);\n }\n\n // start the generation of a new session Key\n } else {\n return reject('No dataObjectKey for this dataObjectURL:', dataObjectURL);\n }\n }).catch(function (err) {\n reject('On encryptDataObject from method storageManager.get error: ' + err);\n });\n });\n }\n }, {\n key: 'decryptMessage',\n value: function decryptMessage(message) {\n var _this = this;\n\n // log.log('decryptMessage:message', message);\n\n return new _promise2.default(function (resolve, reject) {\n var isHandShakeType = message.type === 'handshake';\n\n _this._isToDecrypt(message).then(function (isToDecrypt) {\n\n //if is not to apply encryption, then returns resolve\n if (!isToDecrypt) return resolve(message);\n\n var dataObjectURL = (0, _utils.parseMessageURL)(message.to);\n\n var isToDataObject = (0, _utils.isDataObjectURL)(dataObjectURL);\n var isFromHyperty = (0, _utils.divideURL)(message.from).type === 'hyperty';\n var isToHyperty = (0, _utils.divideURL)(message.to).type === 'hyperty';\n\n if (message.type === 'update') {\n return resolve(message);\n }\n\n //is is hyperty to hyperty communication\n if (isFromHyperty && isToHyperty) {\n // log.log('decrypt hyperty to hyperty');\n var userURL = _this._registry.getHypertyOwner(message.to);\n if (userURL) {\n\n var chatKeys = _this.chatKeys[message.to + '<->' + message.from];\n if (!chatKeys) {\n chatKeys = _this._newChatCrypto(message, userURL, 'decrypt');\n _this.chatKeys[message.to + '<->' + message.from] = chatKeys;\n }\n\n if (chatKeys.authenticated && !isHandShakeType) {\n var value = (0, _utils.decode)(message.body.value);\n var iv = (0, _utils.decodeToUint8Array)(value.iv);\n var data = (0, _utils.decodeToUint8Array)(value.value);\n var hash = (0, _utils.decodeToUint8Array)(value.hash);\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, data, iv).then(function (decryptedData) {\n // log.log('decrypted value ', decryptedData);\n message.body.value = decryptedData;\n\n var filteredMessage = _this._filterMessageToHash(message, decryptedData + iv);\n\n _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, hash).then(function (result) {\n //log.log('result of hash verification! ', result);\n message.body.assertedIdentity = true;\n resolve(message);\n });\n });\n } else if (isHandShakeType) {\n _this._doHandShakePhase(message, chatKeys).then(function (value) {\n\n //if it was started by doMutualAuthentication then ends the protocol\n if (value === 'handShakeEnd') {\n //reject('decrypt handshake protocol phase');\n\n // if was started by a message, then resend that message\n } else {\n _this.chatKeys[message.to + '<->' + message.from] = value.chatKeys;\n _this._messageBus.postMessage(value.message);\n\n //reject('decrypt handshake protocol phase ');\n }\n });\n } else {\n reject('wrong message do decrypt');\n }\n } else {\n reject('error on decrypt message');\n }\n\n //if from hyperty to a dataObjectURL\n } else if (isFromHyperty && isToDataObject) {\n // log.log('dataObject value to decrypt: ', message.body);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys || {});\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n if (dataObjectKey) {\n\n //check if is to apply encryption\n if (dataObjectKey.isToEncrypt) {\n var parsedValue = (0, _utils.parse)(message.body.value);\n var _iv2 = (0, _utils.decodeToUint8Array)(parsedValue.iv);\n var encryptedValue = (0, _utils.decodeToUint8Array)(parsedValue.value);\n var _hash = (0, _utils.decodeToUint8Array)(parsedValue.hash);\n\n _this.crypto.decryptAES(dataObjectKey.sessionKey, encryptedValue, _iv2).then(function (decryptedValue) {\n var parsedValue = (0, _utils.parse)(decryptedValue);\n\n // log.log('decrypted Value,', parsedValue);\n message.body.value = parsedValue;\n\n var filteredMessage = _this._filterMessageToHash(message, (0, _utils.stringify)(parsedValue) + (0, _utils.stringify)(_iv2));\n\n _this.crypto.verifyHMAC(dataObjectKey.sessionKey, filteredMessage, _hash).then(function (result) {\n log.log('Received message HMAC result', result);\n\n message.body.assertedIdentity = true;\n resolve(message);\n }).catch(function (err) {\n reject('Message HMAC is invalid: ' + err);\n });\n });\n\n //if not, just return the message\n } else {\n message.body.assertedIdentity = true;\n resolve(message);\n }\n } else {\n message.body.assertedIdentity = true;\n resolve(message);\n\n //reject('no sessionKey for chat room found');\n }\n });\n } else {\n reject('wrong message to decrypt');\n }\n });\n });\n }\n }, {\n key: 'decryptDataObject',\n value: function decryptDataObject(dataObject, sender) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //if is not to apply encryption, then returns resolve\n if (!_this.isToUseEncryption) {\n // log.log('decryption disabled');\n return resolve(dataObject);\n }\n\n var dataObjectURL = (0, _utils.parseMessageURL)(sender);\n\n // log.log('dataObject value to decrypt: ', dataObject);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys);\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n if (dataObjectKey) {\n\n //check if is to apply encryption\n if (dataObjectKey.isToEncrypt) {\n var iv = (0, _utils.decodeToUint8Array)(dataObject.iv);\n var encryptedValue = (0, _utils.decodeToUint8Array)(dataObject.value);\n\n _this.crypto.decryptAES(dataObjectKey.sessionKey, encryptedValue, iv).then(function (decryptedValue) {\n var parsedValue = (0, _utils.parse)(decryptedValue);\n var newValue = { value: parsedValue, iv: (0, _utils.encode)(iv) };\n\n // log.log('decrypted dataObject,', newValue);\n\n return resolve(newValue);\n }).catch(function (err) {\n reject('On decryptDataObject from method encryptAES error: ' + err);\n });\n\n //if not, just return the dataObject\n } else {\n // log.log('The dataObject is not encrypted');\n return resolve(dataObject);\n }\n } else {\n return reject('No dataObjectKey for this dataObjectURL:', dataObjectURL);\n }\n });\n });\n }\n }, {\n key: '_doMutualAuthenticationPhase1',\n value: function _doMutualAuthenticationPhase1(message) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n var to = message.to.split('/');\n\n //let subsIndex = to.indexOf('subscription');\n //let isDataObjectSubscription = subsIndex !== -1;\n to.pop();\n var dataObjectURL = to[0] + '//' + to[2] + '/' + to[3];\n _this._doMutualAuthenticationPhase2(dataObjectURL, message.body.subscriber).then(function () {\n _this._registry.registerSubscriber(dataObjectURL, message.body.subscriber);\n resolve();\n }, function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: '_doMutualAuthenticationPhase2',\n value: function _doMutualAuthenticationPhase2(sender, receiver) {\n log.info('doMutualAuthentication:sender ', sender);\n log.info('doMutualAuthentication:receiver ', receiver);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var dataObjectURL = void 0;\n\n // check if the sender is a dataObject and if so stores that value\n var reporterURL = _this._registry.getReporterURLSynchonous(sender);\n if (reporterURL) {\n dataObjectURL = sender;\n sender = reporterURL;\n }\n\n var msg = {\n to: receiver,\n from: sender,\n callback: undefined,\n body: { handshakePhase: 'startHandShake', ignore: 'ignoreMessage' }\n };\n\n if (!sender || !receiver) {\n return reject('sender or receiver missing on doMutualAuthentication');\n }\n\n var chatKeys = _this.chatKeys[sender + '<->' + receiver];\n var userURL = _this._registry.getHypertyOwner(sender);\n\n if (userURL) {\n\n if (!chatKeys) {\n // callback to resolve when finish the mutual authentication\n var resolved = function resolved(value) {\n // log.log('callback value:', value);\n resolve(value);\n };\n msg.callback = resolved;\n msg.dataObjectURL = dataObjectURL;\n\n chatKeys = _this._newChatCrypto(msg, userURL);\n _this.chatKeys[sender + '<->' + receiver] = chatKeys;\n }\n\n if (chatKeys.authenticated) {\n\n var startSessionKeyExchange = {\n to: sender,\n from: receiver\n };\n chatKeys.dataObjectURL = dataObjectURL;\n _this._sendReporterSessionKey(startSessionKeyExchange, chatKeys).then(function (value) {\n\n _this._messageBus.postMessage(value.message);\n resolve('exchange of chat sessionKey initiated');\n }).catch(function (err) {\n reject('On doMutualAuthentication from method _sendReporterSessionKey error: ' + err);\n });\n } else {\n _this._doHandShakePhase(msg, chatKeys);\n }\n } else {\n reject('Mutual authentication error: Hyperty owner could not be resolved');\n }\n });\n }\n\n /**\n * returns the reporter associated to the dataObject URL\n * @param {String} dataObjectURL dataObject url\n * @return {String} reporter dataObject url reporter\n */\n /* _getHypertyFromDataObject(dataObjectURL) {\n log.info('_getHypertyFromDataObject:dataObjectURL', dataObjectURL);\n let _this = this;\n return new Promise(function(resolve, reject) {\n let splitedURL = divideURL(dataObjectURL);\n let domain = splitedURL.domain;\n let finalURL = _this._parseMessageURL(dataObjectURL);\n // check if is the creator of the hyperty\n let reporterURL = _this.registry.getReporterURLSynchonous(finalURL);\n log.info('_getHypertyFromDataObject:reporterURL', reporterURL);\n if (reporterURL) {\n resolve(reporterURL);\n } else {\n // check if there is already an association from an hypertyURL to the dataObject\n let storedReporterURL = _this.dataObjectsIdentity[finalURL];\n log.info('_getHypertyFromDataObject:storedReporterURL', storedReporterURL);\n if (storedReporterURL) {\n resolve(storedReporterURL);\n } else {\n // check if there is any hyperty that subscribed the dataObjectURL\n let subscriberHyperty = _this.registry.getDataObjectSubscriberHyperty(dataObjectURL);\n log.info('_getHypertyFromDataObject:subscriberHyperty', subscriberHyperty);\n if (subscriberHyperty) {\n resolve(subscriberHyperty);\n } else {\n // search in domain registry for the hyperty associated to the dataObject\n // search in case is a subscriber who wants to know the reporter\n _this._coreDiscovery.discoverDataObjectPerURL(finalURL, domain).then(dataObject => {\n log.info('_getHypertyFromDataObject:dataObject', dataObject);\n _this.dataObjectsIdentity[finalURL] = dataObject.reporter;\n log.info('_getHypertyFromDataObject:dataObject.reporter', dataObject.reporter);\n resolve(dataObject.reporter);\n }, err => {\n reject(err);\n });\n }\n }\n }\n });\n }*/\n\n }, {\n key: '_sendReporterSessionKey',\n value: function _sendReporterSessionKey(message, chatKeys) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var sessionKeyBundle = _this.dataObjectSessionKeys[chatKeys.dataObjectURL];\n var reporterSessionKeyMsg = void 0;\n var valueToEncrypt = void 0;\n var sessionKey = void 0;\n var iv = void 0;\n var value = {};\n\n //if there is not yet a session Key, generates a new one\n if (!sessionKeyBundle) {\n sessionKey = _this.crypto.generateRandom();\n _this.dataObjectSessionKeys[chatKeys.dataObjectURL] = { sessionKey: sessionKey, isToEncrypt: true };\n\n var dataObjectSessionKeysClone = (0, _utils.chatkeysToStringCloner)(_this.dataObjectSessionKeys);\n\n _this.storageManager.set('dataObjectSessionKeys', 0, dataObjectSessionKeysClone).catch(function (err) {\n reject('On _sendReporterSessionKey from method storageManager.set(dataObjectSessionKeys...) error: ' + err);\n });\n } else {\n sessionKey = sessionKeyBundle.sessionKey;\n }\n\n try {\n valueToEncrypt = (0, _utils.encode)({ value: (0, _utils.encode)(sessionKey), dataObjectURL: chatKeys.dataObjectURL });\n } catch (err) {\n return reject('On _sendReporterSessionKey from method storageManager.set error valueToEncrypt: ' + err);\n }\n\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, valueToEncrypt, iv).then(function (encryptedValue) {\n\n reporterSessionKeyMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'reporterSessionKey',\n value: (0, _utils.encode)(encryptedValue)\n }\n };\n\n var filteredMessage = _this._filterMessageToHash(reporterSessionKeyMsg, valueToEncrypt + iv, chatKeys.hypertyFrom.messageInfo);\n\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage);\n }).then(function (hashedMessage) {\n var valueWithHash = (0, _utils.encode)({ value: reporterSessionKeyMsg.body.value, hash: (0, _utils.encode)(hashedMessage), iv: value.iv });\n\n reporterSessionKeyMsg.body.value = valueWithHash;\n\n resolve({ message: reporterSessionKeyMsg, chatKeys: chatKeys });\n }).catch(function (err) {\n reject('On _sendReporterSessionKey from chained promises encryptAES error: ' + err);\n });\n });\n }\n\n /**\n * Function that resolve and create the domainURL in case it is provided one. If not, resolve the default domainURL\n * @param {String} idpDomain idpDomain (Optional)\n */\n\n }, {\n key: '_resolveDomain',\n value: function _resolveDomain(idpDomain) {\n if (!idpDomain) {\n return 'domain-idp://google.com';\n } else {\n return 'domain-idp://' + idpDomain;\n }\n }\n }, {\n key: '_doHandShakePhase',\n value: function _doHandShakePhase(message, chatKeys) {\n // log('_doHandShakePhase:dataObject', message);\n //\tlog('_doHandShakePhase:chatKeys', chatKeys);\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var handshakeType = message.body.handshakePhase;\n var iv = void 0;\n var hash = void 0;\n var value = {};\n var filteredMessage = void 0;\n var privateKeyHolder = void 0;\n\n log.info('handshake phase: ', handshakeType);\n\n switch (handshakeType) {\n\n case 'startHandShake':\n {\n chatKeys.keys.fromRandom = _this.crypto.generateRandom();\n var startHandShakeMsg = {\n type: 'handshake',\n to: message.to,\n from: message.from,\n body: {\n handshakePhase: 'senderHello',\n value: (0, _utils.encode)(chatKeys.keys.fromRandom)\n }\n };\n chatKeys.handshakeHistory.senderHello = _this._filterMessageToHash(startHandShakeMsg, undefined, chatKeys.hypertyFrom.messageInfo);\n\n // check if was the encrypt function or the mutual authentication that request the\n // start of the handShakePhase.\n\n if (chatKeys.initialMessage) {\n resolve({ message: startHandShakeMsg, chatKeys: chatKeys });\n } else {\n _this.chatKeys[message.from + '<->' + message.to] = chatKeys;\n _this._messageBus.postMessage(startHandShakeMsg);\n }\n\n break;\n }\n case 'senderHello':\n {\n\n log.log('senderHello');\n chatKeys.handshakeHistory.senderHello = _this._filterMessageToHash(message);\n chatKeys.keys.fromRandom = (0, _utils.decodeToUint8Array)(message.body.value);\n chatKeys.keys.toRandom = _this.crypto.generateRandom();\n\n var senderHelloMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverHello',\n value: (0, _utils.encode)(chatKeys.keys.toRandom)\n }\n };\n chatKeys.handshakeHistory.receiverHello = _this._filterMessageToHash(senderHelloMsg, undefined, chatKeys.hypertyFrom.messageInfo);\n resolve({ message: senderHelloMsg, chatKeys: chatKeys });\n\n break;\n }\n case 'receiverHello':\n {\n\n log.log('receiverHello');\n _this.getMyPrivateKey().then(function (privateKey) {\n privateKeyHolder = privateKey;\n\n chatKeys.handshakeHistory.receiverHello = _this._filterMessageToHash(message);\n\n return _this._idm.validateAssertion(message.body.identity.assertion, undefined, message.body.identity.idp.domain);\n }).then(function (value) {\n\n //TODO remove later this verification as soon as all the IdP proxy are updated in the example\n var encodedpublicKey = typeof value.contents === 'string' ? value.contents : value.contents.nonce;\n\n var receiverPublicKey = (0, _utils.parseToUint8Array)(encodedpublicKey);\n var premasterSecret = _this.crypto.generatePMS();\n var toRandom = message.body.value;\n chatKeys.hypertyTo.assertion = message.body.identity.assertion;\n chatKeys.hypertyTo.publicKey = receiverPublicKey;\n chatKeys.hypertyTo.userID = message.body.identity.userProfile.userURL;\n chatKeys.keys.toRandom = (0, _utils.decodeToUint8Array)(toRandom);\n chatKeys.keys.premasterKey = premasterSecret;\n\n var concatKey = _this.crypto.concatPMSwithRandoms(premasterSecret, chatKeys.keys.toRandom, chatKeys.keys.fromRandom);\n\n return _this.crypto.generateMasterSecret(concatKey, 'messageHistoric' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n //generate the master key\n }).then(function (masterKey) {\n chatKeys.keys.masterKey = masterKey;\n\n return _this.crypto.generateKeys(masterKey, 'key expansion' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n //generate the symmetric and hash keys\n }).then(function (keys) {\n\n chatKeys.keys.hypertyToSessionKey = new Uint8Array(keys[0]);\n chatKeys.keys.hypertyFromSessionKey = new Uint8Array(keys[1]);\n chatKeys.keys.hypertyToHashKey = new Uint8Array(keys[2]);\n chatKeys.keys.hypertyFromHashKey = new Uint8Array(keys[3]);\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n\n var messageStructure = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'senderCertificate'\n }\n };\n\n // hash the value and the iv\n filteredMessage = _this._filterMessageToHash(messageStructure, 'ok' + iv, chatKeys.hypertyFrom.messageInfo);\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage);\n }).then(function (hash) {\n value.hash = (0, _utils.encode)(hash);\n\n //encrypt the data\n return _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, 'ok', iv);\n }).then(function (encryptedData) {\n value.symetricEncryption = (0, _utils.encode)(encryptedData);\n\n return _this.crypto.encryptRSA(chatKeys.hypertyTo.publicKey, chatKeys.keys.premasterKey);\n }).then(function (encryptedValue) {\n value.assymetricEncryption = (0, _utils.encode)(encryptedValue);\n\n var messageStructure = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'senderCertificate'\n }\n };\n\n var messageToHash = _this._filterMessageToHash(messageStructure, chatKeys.keys.premasterKey, chatKeys.hypertyFrom.messageInfo);\n return _this.crypto.signRSA(privateKeyHolder, (0, _utils.encode)(chatKeys.handshakeHistory) + (0, _utils.encode)(messageToHash));\n }).then(function (signature) {\n\n value.signature = (0, _utils.encode)(signature);\n\n var receiverHelloMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'senderCertificate',\n value: (0, _utils.encode)(value)\n }\n };\n chatKeys.handshakeHistory.senderCertificate = _this._filterMessageToHash(receiverHelloMsg, 'ok' + iv, chatKeys.hypertyFrom.messageInfo);\n\n resolve({ message: receiverHelloMsg, chatKeys: chatKeys });\n }, function (error) {\n return reject(error);\n });\n\n break;\n }\n case 'senderCertificate':\n {\n\n log.log('senderCertificate');\n\n var receivedValue = (0, _utils.decode)(message.body.value);\n\n _this.getMyPrivateKey().then(function (privateKey) {\n privateKeyHolder = privateKey;\n\n return _this._idm.validateAssertion(message.body.identity.assertion, undefined, message.body.identity.idp.domain);\n }).then(function (value) {\n var encryptedPMS = (0, _utils.decodeToUint8Array)(receivedValue.assymetricEncryption);\n\n //TODO remove later this verification as soon as all the IdP proxy are updated in the example\n var encodedpublicKey = typeof value.contents === 'string' ? value.contents : value.contents.nonce;\n\n var senderPublicKey = (0, _utils.parseToUint8Array)(encodedpublicKey);\n chatKeys.hypertyTo.assertion = message.body.identity.assertion;\n chatKeys.hypertyTo.publicKey = senderPublicKey;\n chatKeys.hypertyTo.userID = message.body.identity.userProfile.userURL;\n\n return _this.crypto.decryptRSA(privateKeyHolder, encryptedPMS);\n }, function (error) {\n // log.log(error);\n reject('Error during authentication of identity: ', error.message);\n\n //obtain the PremasterKey using the private key\n }).then(function (pms) {\n\n chatKeys.keys.premasterKey = new Uint8Array(pms);\n\n var signature = (0, _utils.decodeToUint8Array)(receivedValue.signature);\n\n var receivedmsgToHash = _this._filterMessageToHash(message, chatKeys.keys.premasterKey);\n\n return _this.crypto.verifyRSA(chatKeys.hypertyTo.publicKey, (0, _utils.encode)(chatKeys.handshakeHistory) + (0, _utils.encode)(receivedmsgToHash), signature);\n\n // validates the signature received\n }).then(function (signValidationResult) {\n\n //log.log('SenderCertificate - signature validation result ', signValidationResult);\n var concatKey = _this.crypto.concatPMSwithRandoms(chatKeys.keys.premasterKey, chatKeys.keys.toRandom, chatKeys.keys.fromRandom);\n\n return _this.crypto.generateMasterSecret(concatKey, 'messageHistoric' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n // generates the master keys from the Premaster key and the randoms\n }).then(function (masterKey) {\n chatKeys.keys.masterKey = masterKey;\n\n return _this.crypto.generateKeys(masterKey, 'key expansion' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n // generates the symmetric keys to be used in the symmetric encryption\n }).then(function (keys) {\n chatKeys.keys.hypertyFromSessionKey = new Uint8Array(keys[0]);\n chatKeys.keys.hypertyToSessionKey = new Uint8Array(keys[1]);\n chatKeys.keys.hypertyFromHashKey = new Uint8Array(keys[2]);\n chatKeys.keys.hypertyToHashKey = new Uint8Array(keys[3]);\n iv = (0, _utils.decodeToUint8Array)(receivedValue.iv);\n var data = (0, _utils.decodeToUint8Array)(receivedValue.symetricEncryption);\n\n return _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, data, iv);\n }).then(function (decryptedData) {\n // log.log('decryptedData', decryptedData);\n\n chatKeys.handshakeHistory.senderCertificate = _this._filterMessageToHash(message, decryptedData + iv);\n\n var hashReceived = (0, _utils.decodeToUint8Array)(receivedValue.hash);\n\n filteredMessage = _this._filterMessageToHash(message, decryptedData + iv);\n\n return _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, hashReceived);\n }).then(function (verifiedHash) {\n\n // log.log('result of hash verification ', verifiedHash);\n var receiverFinishedMessage = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverFinishedMessage'\n }\n };\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n\n filteredMessage = _this._filterMessageToHash(receiverFinishedMessage, 'ok!' + iv, chatKeys.hypertyFrom.messageInfo);\n\n //log.log('TIAGO: doHandShakePhase verifiedHash');\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage);\n }).then(function (hash) {\n\n value.hash = (0, _utils.encode)(hash);\n return _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, 'ok!', iv);\n }).then(function (encryptedValue) {\n value.value = (0, _utils.encode)(encryptedValue);\n var receiverFinishedMessage = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverFinishedMessage',\n value: (0, _utils.encode)(value)\n }\n };\n\n chatKeys.handshakeHistory.receiverFinishedMessage = _this._filterMessageToHash(receiverFinishedMessage, 'ok!' + iv, chatKeys.hypertyFrom.messageInfo);\n chatKeys.authenticated = true;\n resolve({ message: receiverFinishedMessage, chatKeys: chatKeys });\n }).catch(function (err) {\n reject('On _doHandShakePhase from senderCertificate error: ' + err);\n });\n\n break;\n }\n case 'receiverFinishedMessage':\n {\n\n chatKeys.authenticated = true;\n\n value = (0, _utils.decode)(message.body.value);\n\n iv = (0, _utils.decodeToUint8Array)(value.iv);\n var data = (0, _utils.decodeToUint8Array)(value.value);\n hash = (0, _utils.decodeToUint8Array)(value.hash);\n\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, data, iv).then(function (decryptedData) {\n // log.log('decryptedData', decryptedData);\n chatKeys.handshakeHistory.receiverFinishedMessage = _this._filterMessageToHash(message, decryptedData + iv);\n\n var filteredMessage = _this._filterMessageToHash(message, decryptedData + iv);\n _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, hash).then(function (result) {\n\n // check if there was an initial message that was blocked and send it\n if (chatKeys.initialMessage) {\n\n var initialMessage = {\n type: 'create',\n to: message.from,\n from: message.to,\n body: {\n value: chatKeys.initialMessage.body.value\n }\n };\n\n resolve({ message: initialMessage, chatKeys: chatKeys });\n\n //sends the sessionKey to the subscriber hyperty\n } else {\n _this._sendReporterSessionKey(message, chatKeys).then(function (value) {\n\n resolve(value);\n }).catch(function (err) {\n reject('On _doHandShakePhase from receiverFinishedMessage error: ' + err);\n });\n }\n });\n });\n\n break;\n }\n\n case 'reporterSessionKey':\n {\n\n log.log('reporterSessionKey');\n\n var valueIVandHash = (0, _utils.decode)(message.body.value);\n hash = (0, _utils.decodeToUint8Array)(valueIVandHash.hash);\n iv = (0, _utils.decodeToUint8Array)(valueIVandHash.iv);\n var encryptedValue = (0, _utils.decodeToUint8Array)(valueIVandHash.value);\n var parsedValue = void 0;\n var sessionKey = void 0;\n var dataObjectURL = void 0;\n var receiverAcknowledgeMsg = void 0;\n\n //log.log('[IdentityModule reporterSessionKey] - decryptAES: ', chatKeys.keys.hypertyToSessionKey, encryptedValue, iv);\n\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, encryptedValue, iv).then(function (decryptedValue) {\n\n parsedValue = (0, _utils.decode)(decryptedValue);\n sessionKey = (0, _utils.decodeToUint8Array)(parsedValue.value);\n dataObjectURL = parsedValue.dataObjectURL;\n\n var messageToHash = _this._filterMessageToHash(message, decryptedValue + iv);\n\n return _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, messageToHash, hash);\n }).then(function (hashResult) {\n\n // log.log('hash successfully validated ', hashResult);\n\n _this.dataObjectSessionKeys[dataObjectURL] = { sessionKey: sessionKey, isToEncrypt: true };\n var dataObjectSessionKeysClone = (0, _utils.chatkeysToStringCloner)(_this.dataObjectSessionKeys);\n _this.storageManager.set('dataObjectSessionKeys', 0, dataObjectSessionKeysClone).catch(function (err) {\n reject('On _sendReporterSessionKey from method reporterSessionKey error: ' + err);\n });\n\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n\n return _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, 'ok!!', iv);\n }).then(function (encryptedValue) {\n\n receiverAcknowledgeMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverAcknowledge'\n }\n };\n\n value.value = (0, _utils.encode)(encryptedValue);\n var messageToHash = _this._filterMessageToHash(receiverAcknowledgeMsg, 'ok!!' + iv, chatKeys.hypertyFrom.messageInfo);\n\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, messageToHash);\n }).then(function (hashedMessage) {\n var finalValue = (0, _utils.encode)({ value: value.value, hash: (0, _utils.encode)(hashedMessage), iv: value.iv });\n\n receiverAcknowledgeMsg.body.value = finalValue;\n resolve({ message: receiverAcknowledgeMsg, chatKeys: chatKeys });\n }).catch(function (err) {\n reject('On _doHandShakePhase from reporterSessionKey error: ' + err);\n });\n\n break;\n }\n\n case 'receiverAcknowledge':\n {\n\n log.log('receiverAcknowledge');\n\n var receivedvalueIVandHash = (0, _utils.decode)(message.body.value);\n var receivedHash = (0, _utils.decodeToUint8Array)(receivedvalueIVandHash.hash);\n iv = (0, _utils.decodeToUint8Array)(receivedvalueIVandHash.iv);\n var receivedEncryptedValue = (0, _utils.decodeToUint8Array)(receivedvalueIVandHash.value);\n\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, receivedEncryptedValue, iv).then(function (decryptedValue) {\n\n var filteredMessage = _this._filterMessageToHash(message, decryptedValue + iv);\n return _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, receivedHash);\n }).then(function (hashResult) {\n // log.log('hashResult ', hashResult);\n\n var callback = chatKeys.callback;\n\n if (callback) {\n callback('handShakeEnd');\n }\n resolve('handShakeEnd');\n }).catch(function (err) {\n reject('On _doHandShakePhase from receiverAcknowledge error: ' + err);\n });\n\n break;\n }\n\n default:\n reject(message);\n }\n });\n }\n\n /**\n * filter the messages to hash, by removing some fields not generated by the runtime core\n * @param {Message} message message\n * @param {String} decryptedValue (Optional) value from body.value in case it originally comes encrypted\n * @param {JSON} identity(Optional) add the hyperty identity associated in case is not added to the initial message\n * @return {Message} new message filtered\n */\n\n }, {\n key: '_filterMessageToHash',\n value: function _filterMessageToHash(message, decryptedValue, identity) {\n\n return {\n type: message.type,\n from: message.from,\n to: message.to,\n body: {\n identity: identity || message.body.identity,\n value: decryptedValue || message.body.value,\n handshakePhase: message.body.handshakePhase\n }\n };\n }\n\n /**\n * generates the initial structure for the keys between two users\n * @param {JSON} message initial message that triggers the mutual authentication\n * @param {String} userURL userURL\n * @param {boolean} receiver(Optional) indicates if is the sender or the receiver that creates a new chat crypto\n * @return {JSON} newChatCrypto new JSON structure for the chat crypto\n */\n\n }, {\n key: '_newChatCrypto',\n value: function _newChatCrypto(message, userURL, receiver) {\n var _this = this;\n\n //check whether is the sender or the receiver to create a new chatCrypto\n //to mantain consistency on the keys if the receiver create a new chatCrypto,\n //then invert the fields\n var from = receiver ? message.to : message.from;\n var to = receiver ? message.from : message.to;\n\n var userInfo = _this._idm.getIdentity(userURL);\n\n var newChatCrypto = {\n hypertyFrom: {\n hyperty: from,\n userID: userInfo.userProfile.userURL,\n\n //privateKey: \"getMyPublicKey\",\n //publicKey: \"getMyPrivateKey\",\n assertion: userInfo.assertion,\n messageInfo: userInfo\n },\n hypertyTo: {\n hyperty: to,\n userID: undefined,\n publicKey: undefined,\n assertion: undefined\n },\n keys: {\n hypertyToSessionKey: undefined,\n hypertyFromSessionKey: undefined,\n hypertyToHashKey: undefined,\n hypertyFromHashKey: undefined,\n toRandom: undefined,\n fromRandom: undefined,\n premasterKey: undefined,\n masterKey: undefined\n },\n handshakeHistory: {\n senderHello: undefined,\n receiverHello: undefined,\n senderCertificate: undefined,\n receiverFinishedMessage: undefined\n },\n initialMessage: message.body.ignore ? undefined : message,\n callback: message.callback,\n authenticated: false,\n dataObjectURL: message.dataObjectURL\n };\n\n return newChatCrypto;\n }\n\n /**\n * Retrieves a public keys given a user refrence. If no key is found,\n generates a new key asymmetric key and retrieves the public keys.\n * @param {userRef} String user reference for the key pair\n * @return {Array} public key\n */\n\n }, {\n key: 'getMyPublicKey',\n value: function getMyPublicKey() {\n var userRef = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.userDefaultKeyRef;\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.get(userRef).then(function (storedKeyPair) {\n if (storedKeyPair) {\n return resolve(storedKeyPair.public);\n }\n _this._generateAndStoreNewAsymetricKey(userRef).then(function (generatedKeyPair) {\n resolve(generatedKeyPair.public);\n }).catch(function (err) {\n log.error('[getMyPublicKey:_generateAndStoreNewAsymetricKey:err]: ' + err.message);\n reject(err);\n });\n }).catch(function (err) {\n log.error('[getMyPublicKey:storageManager:err]: ' + err.message);\n reject(err);\n });\n });\n }\n\n /**\n * Retrieves a private keys given a user refrence. If no key is found,\n generates a new key asymmetric key and retrieves the private key.\n * @param {userRef} String user reference for the key pair\n * @return {Array} private key\n **/\n\n }, {\n key: 'getMyPrivateKey',\n value: function getMyPrivateKey() {\n var userRef = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.userDefaultKeyRef;\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.get(userRef).then(function (storedKeyPair) {\n if (storedKeyPair) {\n return resolve(storedKeyPair.private);\n }\n _this._generateAndStoreNewAsymetricKey(userRef).then(function (generatedKeyPair) {\n resolve(generatedKeyPair.private);\n }).catch(function (err) {\n log.error('[getMyPrivateKey:_generateAndStoreNewAsymetricKey:err]: ' + err.message);\n reject(err);\n });\n }).catch(function (err) {\n log.error('[getMyPrivateKey:storageManager:err]: ' + err.message);\n reject(err);\n });\n });\n }\n\n /**\n * Generates a new key pair, stores and retrives the key pair.\n * @param {userRef} String user reference for the key pair\n * @return {Array} private key\n **/\n\n }, {\n key: '_generateAndStoreNewAsymetricKey',\n value: function _generateAndStoreNewAsymetricKey(userRef) {\n var _this = this;\n var keyPair = undefined;\n return new _promise2.default(function (resolve, reject) {\n _this.crypto.generateRSAKeyPair().then(function (generatedKeyPair) {\n log.log('_generateAndStoreNewAsymetricKey:userAsymmetricKeyGenerated', generatedKeyPair);\n keyPair = generatedKeyPair;\n return _this.storageManager.set(userRef, 0, generatedKeyPair);\n }).then(function (storedReference) {\n log.log('_generateAndStoreNewAsymetricKey:userAsymmetricKeySuccess', storedReference);\n resolve(keyPair);\n }).catch(function (err) {\n log.error('[_generateAndStoreNewAsymetricKey:err]: ' + err.message);\n reject(err);\n });\n });\n }\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n\n _this.addCryptoGUIListeners();\n }\n\n /**\n * return the coreDiscovery component\n */\n\n }, {\n key: 'coreDiscovery',\n get: function get() {\n var _this = this;\n return _this._coreDiscovery;\n }\n\n /**\n * return user's public key\n */\n\n /* getMyPublicKey() {\n // to be implemented\n return new Promise((resolve)=> {\n resolve('mypublickey');\n });\n }\n */\n /**\n * Set the coreDiscovery component\n * @param {coreDiscovery} coreDiscovery\n */\n ,\n set: function set(coreDiscovery) {\n var _this = this;\n _this._coreDiscovery = coreDiscovery;\n }\n\n /**\n * return the registry in this idModule\n * @param {registry} registry\n */\n\n }, {\n key: 'registry',\n get: function get() {\n var _this = this;\n return _this._registry;\n }\n\n /**\n * Set the registry in this idModule\n * @param {registry} reg\n */\n ,\n set: function set(registry) {\n var _this = this;\n _this._registry = registry;\n }\n }]);\n return CryptoManager;\n}();\n\n/*\nconst nodeJSKeyPairPopulate = { public: [48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 228, 43, 101, 12, 121, 7, 157, 71, 81, 58, 219, 32, 10, 108, 193, 179, 212, 116, 255, 59, 217, 32, 161, 201, 53, 171, 226, 199, 137, 202, 171, 60, 82, 53, 125, 62, 177, 126, 165, 24, 141, 30, 15, 226, 59, 107, 34, 7, 13, 149, 112, 125, 10, 230, 191, 156, 164, 177, 10, 185, 13, 66, 3, 217, 166, 244, 90, 119, 111, 27, 145, 104, 71, 189, 166, 226, 255, 133, 83, 151, 231, 101, 151, 89, 22, 19, 65, 154, 10, 53, 208, 218, 252, 219, 37, 50, 212, 86, 145, 107, 132, 90, 233, 202, 227, 108, 114, 141, 29, 73, 187, 31, 13, 234, 0, 232, 24, 191, 35, 149, 179, 138, 214, 159, 245, 162, 148, 221, 118, 17, 105, 89, 151, 146, 209, 55, 236, 61, 143, 233, 228, 10, 115, 8, 81, 197, 45, 123, 187, 223, 176, 254, 165, 69, 143, 29, 100, 114, 17, 130, 226, 223, 33, 11, 240, 81, 61, 172, 191, 157, 246, 202, 87, 131, 221, 88, 48, 127, 159, 119, 160, 152, 117, 61, 253, 174, 65, 214, 203, 218, 63, 50, 78, 160, 181, 221, 211, 128, 70, 178, 191, 170, 0, 13, 122, 173, 12, 203, 252, 4, 184, 225, 252, 7, 62, 96, 116, 15, 216, 158, 55, 85, 48, 16, 9, 206, 119, 74, 112, 243, 136, 84, 184, 223, 254, 101, 91, 61, 10, 91, 85, 192, 147, 144, 57, 29, 66, 238, 199, 244, 193, 194, 150, 232, 200, 107, 2, 3, 1, 0, 1],\n private: [48, 130, 4, 191, 2, 1, 0, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 4, 130, 4, 169, 48, 130, 4, 165, 2, 1, 0, 2, 130, 1, 1, 0, 228, 43, 101, 12, 121, 7, 157, 71, 81, 58, 219, 32, 10, 108, 193, 179, 212, 116, 255, 59, 217, 32, 161, 201, 53, 171, 226, 199, 137, 202, 171, 60, 82, 53, 125, 62, 177, 126, 165, 24, 141, 30, 15, 226, 59, 107, 34, 7, 13, 149, 112, 125, 10, 230, 191, 156, 164, 177, 10, 185, 13, 66, 3, 217, 166, 244, 90, 119, 111, 27, 145, 104, 71, 189, 166, 226, 255, 133, 83, 151, 231, 101, 151, 89, 22, 19, 65, 154, 10, 53, 208, 218, 252, 219, 37, 50, 212, 86, 145, 107, 132, 90, 233, 202, 227, 108, 114, 141, 29, 73, 187, 31, 13, 234, 0, 232, 24, 191, 35, 149, 179, 138, 214, 159, 245, 162, 148, 221, 118, 17, 105, 89, 151, 146, 209, 55, 236, 61, 143, 233, 228, 10, 115, 8, 81, 197, 45, 123, 187, 223, 176, 254, 165, 69, 143, 29, 100, 114, 17, 130, 226, 223, 33, 11, 240, 81, 61, 172, 191, 157, 246, 202, 87, 131, 221, 88, 48, 127, 159, 119, 160, 152, 117, 61, 253, 174, 65, 214, 203, 218, 63, 50, 78, 160, 181, 221, 211, 128, 70, 178, 191, 170, 0, 13, 122, 173, 12, 203, 252, 4, 184, 225, 252, 7, 62, 96, 116, 15, 216, 158, 55, 85, 48, 16, 9, 206, 119, 74, 112, 243, 136, 84, 184, 223, 254, 101, 91, 61, 10, 91, 85, 192, 147, 144, 57, 29, 66, 238, 199, 244, 193, 194, 150, 232, 200, 107, 2, 3, 1, 0, 1, 2, 130, 1, 0, 103, 244, 137, 118, 116, 82, 14, 203, 102, 107, 253, 88, 12, 199, 222, 60, 243, 136, 86, 157, 74, 224, 190, 53, 113, 57, 157, 250, 49, 130, 96, 31, 252, 136, 152, 70, 143, 17, 215, 96, 103, 51, 18, 35, 141, 212, 210, 205, 9, 216, 83, 70, 245, 71, 138, 119, 112, 229, 164, 176, 9, 37, 81, 161, 193, 154, 68, 249, 115, 106, 201, 6, 12, 225, 144, 126, 141, 210, 141, 242, 128, 159, 221, 163, 222, 21, 233, 230, 167, 206, 59, 24, 250, 233, 81, 122, 102, 26, 6, 233, 72, 133, 47, 77, 155, 238, 86, 6, 139, 24, 131, 163, 179, 112, 48, 247, 142, 6, 207, 204, 173, 223, 140, 199, 150, 95, 123, 152, 202, 155, 131, 238, 62, 96, 133, 4, 217, 51, 121, 30, 38, 178, 189, 216, 44, 35, 241, 93, 7, 62, 90, 111, 216, 66, 209, 243, 128, 234, 141, 84, 135, 181, 13, 38, 220, 114, 245, 240, 178, 95, 220, 206, 11, 186, 234, 213, 66, 121, 83, 68, 89, 75, 46, 183, 145, 183, 147, 160, 215, 118, 198, 125, 181, 146, 30, 251, 58, 87, 47, 209, 237, 97, 24, 47, 179, 6, 110, 242, 99, 150, 226, 148, 198, 174, 146, 101, 213, 87, 178, 10, 223, 105, 18, 56, 53, 22, 212, 158, 170, 176, 51, 86, 145, 125, 124, 44, 9, 85, 19, 144, 246, 170, 78, 124, 30, 32, 12, 166, 174, 139, 77, 63, 173, 82, 10, 153, 2, 129, 129, 0, 248, 18, 143, 246, 137, 136, 145, 219, 178, 39, 27, 94, 64, 90, 47, 163, 114, 60, 63, 187, 131, 143, 244, 16, 42, 128, 231, 117, 92, 98, 219, 155, 62, 107, 252, 17, 245, 45, 160, 225, 103, 142, 72, 36, 193, 150, 235, 214, 175, 62, 212, 56, 45, 9, 0, 60, 114, 107, 134, 228, 204, 131, 131, 214, 94, 201, 148, 159, 99, 139, 181, 13, 119, 38, 30, 107, 166, 165, 203, 43, 34, 20, 207, 171, 32, 58, 167, 62, 196, 153, 103, 204, 213, 247, 48, 111, 227, 59, 95, 97, 194, 187, 53, 10, 247, 108, 58, 86, 28, 29, 113, 8, 110, 171, 220, 245, 11, 82, 233, 223, 91, 68, 166, 117, 174, 187, 62, 77, 2, 129, 129, 0, 235, 118, 2, 105, 239, 212, 30, 104, 157, 41, 109, 11, 248, 152, 22, 236, 97, 40, 153, 131, 228, 5, 86, 187, 113, 126, 144, 76, 141, 79, 110, 250, 146, 152, 49, 58, 156, 201, 176, 92, 189, 209, 30, 112, 108, 175, 204, 204, 247, 164, 46, 129, 239, 98, 127, 49, 145, 218, 63, 193, 124, 174, 18, 98, 201, 99, 154, 162, 138, 78, 159, 253, 3, 248, 3, 209, 36, 239, 193, 155, 193, 5, 19, 236, 37, 78, 118, 135, 250, 199, 7, 141, 248, 120, 36, 136, 93, 98, 174, 60, 18, 215, 93, 174, 107, 141, 116, 145, 167, 221, 210, 169, 247, 67, 254, 222, 161, 134, 63, 221, 90, 87, 42, 99, 227, 81, 173, 151, 2, 129, 129, 0, 133, 23, 168, 103, 83, 232, 146, 160, 181, 23, 40, 38, 204, 13, 214, 203, 49, 41, 195, 227, 189, 181, 8, 243, 119, 106, 75, 67, 250, 250, 10, 234, 98, 118, 26, 250, 35, 121, 132, 124, 10, 76, 26, 198, 165, 154, 108, 19, 117, 88, 23, 17, 192, 143, 184, 177, 181, 141, 157, 4, 185, 248, 193, 77, 204, 243, 7, 170, 240, 4, 111, 113, 183, 0, 27, 136, 20, 19, 149, 74, 33, 241, 218, 108, 236, 80, 171, 148, 16, 116, 97, 109, 83, 74, 88, 145, 94, 239, 102, 192, 19, 114, 207, 5, 128, 51, 111, 164, 237, 86, 154, 99, 52, 197, 62, 57, 182, 6, 152, 245, 61, 137, 58, 105, 159, 2, 84, 109, 2, 129, 129, 0, 226, 67, 111, 132, 95, 91, 101, 177, 63, 189, 44, 53, 193, 184, 92, 230, 223, 98, 133, 74, 209, 86, 52, 7, 65, 195, 206, 100, 81, 178, 144, 65, 167, 151, 42, 79, 89, 149, 18, 173, 188, 21, 244, 251, 49, 230, 41, 150, 153, 46, 35, 38, 231, 99, 174, 56, 115, 32, 215, 253, 85, 147, 108, 197, 147, 34, 236, 216, 222, 177, 57, 90, 136, 114, 207, 48, 46, 31, 90, 220, 18, 58, 143, 239, 111, 214, 27, 95, 6, 36, 53, 229, 62, 108, 45, 39, 1, 30, 47, 178, 56, 164, 206, 56, 42, 208, 46, 193, 61, 31, 147, 45, 147, 23, 187, 22, 50, 255, 111, 229, 132, 199, 152, 75, 142, 136, 209, 151, 2, 129, 129, 0, 165, 56, 232, 76, 55, 57, 240, 159, 92, 207, 220, 143, 130, 30, 57, 234, 251, 172, 171, 180, 54, 159, 229, 96, 246, 73, 112, 146, 75, 157, 242, 201, 161, 218, 37, 176, 35, 170, 50, 90, 148, 102, 191, 199, 239, 174, 78, 72, 67, 85, 199, 45, 149, 145, 132, 161, 212, 33, 157, 75, 216, 79, 39, 233, 18, 210, 255, 26, 72, 229, 239, 44, 12, 147, 158, 176, 192, 95, 126, 32, 175, 23, 226, 131, 139, 197, 175, 193, 62, 8, 151, 252, 68, 154, 94, 89, 189, 125, 90, 30, 36, 175, 73, 230, 194, 13, 233, 247, 123, 60, 241, 47, 171, 51, 189, 112, 111, 213, 141, 89, 70, 249, 236, 63, 236, 110, 115, 208]};\n*/\n\nexports.default = new CryptoManager();\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jcnlwdG9NYW5hZ2VyL0NyeXB0b01hbmFnZXIuanM/ZDliYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBMb2cgU3lzdGVtXG5pbXBvcnQgKiBhcyBsb2dnZXIgZnJvbSAnbG9nbGV2ZWwnO1xubGV0IGxvZyA9IGxvZ2dlci5nZXRMb2dnZXIoJ0NyeXB0b01hbmFnZXInKTtcblxuaW1wb3J0IHtkaXZpZGVVUkwsIGlzRGF0YU9iamVjdFVSTCwgaXNMZWdhY3ksIGNoYXRrZXlzVG9TdHJpbmdDbG9uZXIsIGNoYXRrZXlzVG9BcnJheUNsb25lciwgcGFyc2VNZXNzYWdlVVJMLFxuICBwYXJzZSwgc3RyaW5naWZ5LCBlbmNvZGUsIGRlY29kZSwgZGVjb2RlVG9VaW50OEFycmF5LCBwYXJzZVRvVWludDhBcnJheX0gZnJvbSAnLi4vdXRpbHMvdXRpbHMuanMnO1xuaW1wb3J0IENyeXB0byBmcm9tICcuL0NyeXB0byc7XG5cbi8qKlxuKiAgVGhlIENyeXB0byBNYW5hZ2VyIHByb3ZpZGVzIG1hbmFnZXMgY3J5cHRvZ3JhcGhpYyBmZWF0dXJlcyBmb3IgdGhlIHJ1bnRpbWUgaW5jbHVkaW5nOlxuKiAgLSBNdXR1YWwgQXV0aGVudGljYXRpb24gYmV0d2VlbiBwZWVyc1x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Ym9keS5hc3NlcnRlZElkZW50aXR5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUobWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICB9IGVsc2UgaWYgKGlzSGFuZFNoYWtlVHlwZSkge1xuICAgICAgICAgICAgICBfdGhpcy5fZG9IYW5kU2hha2VQaGFzZShtZXNzYWdlLCBjaGF0S2V5cykudGhlbihmdW5jdGlvbih2YWx1ZSkge1xuXG4gICAgICAgICAgICAgICAgLy9pZiBpdCB3YXMgc3RhcnRlZCBieSBkb011dHVhbEF1dGhlbnRpY2F0aW9uIHRoZW4gZW5kcyB0aGUgcHJvdG9jb2xcbiAgICAgICAgICAgICAgICBpZiAodmFsdWUgPT09ICdoYW5kU2hha2VFbmQnKSB7XG4gICAgICAgICAgICAgICAgICAvL3JlamVjdCgnZGVjcnlwdCBoYW5kc2hha2UgcHJvdG9jb2wgcGhhc2UnKTtcblxuICAgICAgICAgICAgICAgICAgLy8gaWYgd2FzIHN0YXJ0ZWQgYnkgYSBtZXNzYWdlLCB0aGVuIHJlc2VuZCB0aGF0IG1lc3NhZ2VcbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgX3RoaXMuY2hhdEtleXNbbWVzc2FnZS50byArICc8LT4nICsgbWVzc2FnZS5mcm9tXSA9IHZhbHVlLmNoYXRLZXlzO1xuICAgICAgICAgICAgICAgICAgX3RoaXMuX21lc3NhZ2VCdXMucG9zdE1lc3NhZ2UodmFsdWUubWVzc2FnZSk7XG5cbiAgICAgICAgICAgICAgICAgIC8vcmVqZWN0KCdkZWNyeXB0IGhhbmRzaGFrZSBwcm90b2NvbCBwaGFzZSAnKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgcmVqZWN0KCd3cm9uZyBtZ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AgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICByZXNvbHZlKHttZXNzYWdlOiBpbml0aWFsTWVzc2FnZSwgY2hhdEtleXM6IGNoYXRLZXlzfSk7XG5cbiAgICAgICAgICAgICAgICAvL3NlbmRzIHRoZSBzZXNzaW9uS2V5IHRvIHRoZSBzdWJzY3JpYmVyIGh5cGVydHlcbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5fc2VuZFJlcG9ydGVyU2Vzc2lvbktleShtZXNzYWdlLCBjaGF0S2V5cykudGhlbih2YWx1ZSA9PiB7XG5cbiAgICAgICAgICAgICAgICAgIHJlc29sdmUodmFsdWUpO1xuICAgICAgICAgICAgICAgIH0pLmNhdGNoKGVyciA9PiB7XG4gICAgICAgICAgICAgICAgICByZWplY3QoJ09uIF9kb0hhbmRTaGFrZVBoYXNlIGZyb20gcmVjZWl2ZXJGaW5pc2hlZE1lc3NhZ2UgZXJyb3I6ICcgKyBlcnIpO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIGJyZWFrO1xuICAgICAgICB9XG5cbiAgICAgICAgY2FzZSAncmVwb3J0ZXJTZXNzaW9uS2V5Jzoge1xuXG4gICAgICAgICAgbG9nLmxvZygncmVwb3J0ZXJTZXNzaW9uS2V5Jyk7XG5cbiAgICAgICAgICBsZXQgdmFsdWVJVmFuZEhhc2ggPSBkZWNvZGUobWVzc2FnZS5ib2R5LnZhbHVlKTtcbiAgICAgICAgICBoYXNoID0gZGVjb2RlVG9VaW50OEFycmF5KHZhbHVlSVZhbmRIYXNoLmhhc2gpO1xuICAgICAgICAgIGl2ID0gZGVjb2RlVG9VaW50OEFycmF5KHZhbHVlSVZhbmRIYXNoLml2KTtcbiAgICAgICAgICBsZXQgZW5jcnlwdGVkVmFsdWUgPSBkZWNv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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBdjBDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7O0FBSUE7Ozs7Ozs7QUFTQTs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBNndDQTs7Ozs7QUFLQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///105\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar document = __webpack_require__(7).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZG9tLWNyZWF0ZS5qcz84ZTFjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGRvY3VtZW50ID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuZG9jdW1lbnQ7XG4vLyB0eXBlb2YgZG9jdW1lbnQuY3JlYXRlRWxlbWVudCBpcyAnb2JqZWN0JyBpbiBvbGQgSUVcbnZhciBpcyA9IGlzT2JqZWN0KGRvY3VtZW50KSAmJiBpc09iamVjdChkb2N1bWVudC5jcmVhdGVFbGVtZW50KTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpcyA/IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoaXQpIDoge307XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///106\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar core = __webpack_require__(31);\nvar LIBRARY = __webpack_require__(48);\nvar wksExt = __webpack_require__(156);\nvar defineProperty = __webpack_require__(13).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fd2tzLWRlZmluZS5qcz9kZTBmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIExJQlJBUlkgPSByZXF1aXJlKCcuL19saWJyYXJ5Jyk7XG52YXIgd2tzRXh0ID0gcmVxdWlyZSgnLi9fd2tzLWV4dCcpO1xudmFyIGRlZmluZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgdmFyICRTeW1ib2wgPSBjb3JlLlN5bWJvbCB8fCAoY29yZS5TeW1ib2wgPSBMSUJSQVJZID8ge30gOiBnbG9iYWwuU3ltYm9sIHx8IHt9KTtcbiAgaWYgKG5hbWUuY2hhckF0KDApICE9ICdfJyAmJiAhKG5hbWUgaW4gJFN5bWJvbCkpIGRlZmluZVByb3BlcnR5KCRTeW1ib2wsIG5hbWUsIHsgdmFsdWU6IHdrc0V4dC5mKG5hbWUpIH0pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fd2tzLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMTA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///107\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(83)('keys');\nvar uid = __webpack_require__(53);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2hhcmVkLWtleS5qcz85OTkzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBzaGFyZWQgPSByZXF1aXJlKCcuL19zaGFyZWQnKSgna2V5cycpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiBzaGFyZWRba2V5XSB8fCAoc2hhcmVkW2tleV0gPSB1aWQoa2V5KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAxMDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///108\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZW51bS1idWcta2V5cy5qcz80MGE1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIElFIDgtIGRvbid0IGVudW0gYnVnIGtleXNcbm1vZHVsZS5leHBvcnRzID0gKFxuICAnY29uc3RydWN0b3IsaGFzT3duUHJvcGVydHksaXNQcm90b3R5cGVPZixwcm9wZXJ0eUlzRW51bWVyYWJsZSx0b0xvY2FsZVN0cmluZyx0b1N0cmluZyx2YWx1ZU9mJ1xuKS5zcGxpdCgnLCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///109\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(7).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faHRtbC5qcz83NzRlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xubW9kdWxlLmV4cG9ydHMgPSBkb2N1bWVudCAmJiBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQ7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2h0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDExMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///110\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(9);\nvar anObject = __webpack_require__(5);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(32)(Function.call, __webpack_require__(29).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2V0LXByb3RvLmpzPzgyZjAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gV29ya3Mgd2l0aCBfX3Byb3RvX18gb25seS4gT2xkIHY4IGNhbid0IHdvcmsgd2l0aCBudWxsIHByb3RvIG9iamVjdHMuXG4vKiBlc2xpbnQtZGlzYWJsZSBuby1wcm90byAqL1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBjaGVjayA9IGZ1bmN0aW9uIChPLCBwcm90bykge1xuICBhbk9iamVjdChPKTtcbiAgaWYgKCFpc09iamVjdChwcm90bykgJiYgcHJvdG8gIT09IG51bGwpIHRocm93IFR5cGVFcnJvcihwcm90byArIFwiOiBjYW4ndCBzZXQgYXMgcHJvdG90eXBlIVwiKTtcbn07XG5tb2R1bGUuZXhwb3J0cyA9IHtcbiAgc2V0OiBPYmplY3Quc2V0UHJvd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QTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///111\n")},function(module,exports){eval("module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXdzLmpzPzVkZGIiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAnXFx4MDlcXHgwQVxceDBCXFx4MENcXHgwRFxceDIwXFx4QTBcXHUxNjgwXFx1MTgwRVxcdTIwMDBcXHUyMDAxXFx1MjAwMlxcdTIwMDMnICtcbiAgJ1xcdTIwMDRcXHUyMDA1XFx1MjAwNlxcdTIwMDdcXHUyMDA4XFx1MjAwOVxcdTIwMEFcXHUyMDJGXFx1MjA1RlxcdTMwMDBcXHUyMDI4XFx1MjAyOVxcdUZFRkYnO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpbmctd3MuanNcbi8vIG1vZHVsZSBpZCA9IDExMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///112\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar setPrototypeOf = __webpack_require__(111).set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faW5oZXJpdC1pZi1yZXF1aXJlZC5qcz85MjI3Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIHNldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fc2V0LXByb3RvJykuc2V0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGhhdCwgdGFyZ2V0LCBDKSB7XG4gIHZhciBTID0gdGFyZ2V0LmNvbnN0cnVjdG9yO1xuICB2YXIgUDtcbiAgaWYgKFMgIT09IEMgJiYgdHlwZW9mIFMgPT0gJ2Z1bmN0aW9uJyAmJiAoUCA9IFMucHJvdG90eXBlKSAhPT0gQy5wcm90b3R5cGUgJiYgaXNPYmplY3QoUCkgJiYgc2V0UHJvdG90eXBlT2YpIHtcbiAgICBzZXRQcm90b3R5cGVPZih0aGF0LCBQKTtcbiAgfSByZXR1cm4gdGhhdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2luaGVyaXQtaWYtcmVxdWlyZWQuanNcbi8vIG1vZHVsZSBpZCA9IDExM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///113\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar toInteger = __webpack_require__(38);\nvar defined = __webpack_require__(37);\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXJlcGVhdC5qcz9jNDA3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiByZXBlYXQoY291bnQpIHtcbiAgdmFyIHN0ciA9IFN0cmluZyhkZWZpbmVkKHRoaXMpKTtcbiAgdmFyIHJlcyA9ICcnO1xuICB2YXIgbiA9IHRvSW50ZWdlcihjb3VudCk7XG4gIGlmIChuIDwgMCB8fCBuID09IEluZmluaXR5KSB0aHJvdyBSYW5nZUVycm9yKFwiQ291bnQgY2FuJ3QgYmUgbmVnYXRpdmVcIik7XG4gIGZvciAoO24gPiAwOyAobiA+Pj49IDEpICYmIChzdHIgKz0gc3RyKSkgaWYgKG4gJiAxKSByZXMgKz0gc3RyO1xuICByZXR1cm4gcmVzO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXJlcGVhdC5qc1xuLy8gbW9kdWxlIGlkID0gMTE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///114\n")},function(module,exports){eval("// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zaWduLmpzPzczMDkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjI4IE1hdGguc2lnbih4KVxubW9kdWxlLmV4cG9ydHMgPSBNYXRoLnNpZ24gfHwgZnVuY3Rpb24gc2lnbih4KSB7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgcmV0dXJuICh4ID0gK3gpID09IDAgfHwgeCAhPSB4ID8geCA6IHggPCAwID8gLTEgOiAxO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zaWduLmpzXG4vLyBtb2R1bGUgaWQgPSAxMTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///115\n")},function(module,exports){eval("// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1leHBtMS5qcz9jN2JmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xNCBNYXRoLmV4cG0xKHgpXG52YXIgJGV4cG0xID0gTWF0aC5leHBtMTtcbm1vZHVsZS5leHBvcnRzID0gKCEkZXhwbTFcbiAgLy8gT2xkIEZGIGJ1Z1xuICB8fCAkZXhwbTEoMTApID4gMjIwMjUuNDY1Nzk0ODA2NzE5IHx8ICRleHBtMSgxMCkgPCAyMjAyNS40NjU3OTQ4MDY3MTY1MTY4XG4gIC8vIFRvciBCcm93c2VyIGJ1Z1xuICB8fCAkZXhwbTEoLTJlLTE3KSAhPSAtMmUtMTdcbikgPyBmdW5jdGlvbiBleHBtMSh4KSB7XG4gIHJldHVybiAoeCA9ICt4KSA9PSAwID8geCA6IHggPiAtMWUtNiAmJiB4IDwgMWUtNiA/IHggKyB4ICogeCAvIDIgOiBNYXRoLmV4cCh4KSAtIDE7XG59IDogJGV4cG0xO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tYXRoLWV4cG0xLmpzXG4vLyBtb2R1bGUgaWQgPSAxMTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///116\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(38);\nvar defined = __webpack_require__(37);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWF0LmpzP2UzZGEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xuLy8gdHJ1ZSAgLT4gU3RyaW5nI2F0XG4vLyBmYWxzZSAtPiBTdHJpbmcjY29kZVBvaW50QXRcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKFRPX1NUUklORykge1xuICByZXR1cm4gZnVuY3Rpb24gKHRoYXQsIHBvcykge1xuICAgIHZhciBzID0gU3RyaW5nKGRlZmluZWQodGhhdCkpO1xuICAgIHZhciBpID0gdG9JbnRlZ2VyKHBvcyk7XG4gICAgdmFyIGwgPSBzLmxlbmd0aDtcbiAgICB2YXIgYSwgYjtcbiAgICBpZiAoaSA8IDAgfHwgaSA+PSBsKSByZXR1cm4gVE9fU1RSSU5HID8gJycgOiB1bmRlZmluZWQ7XG4gICAgYSA9IHMuY2hhckNvZGVBdChpKTtcbiAgICByZXR1cm4gYSA8IDB4ZDgwMCB8fCBhID4gMHhkYmZmIHx8IGkgKyAxID09PSBsIHx8IChiID0gcy5jaGFyQ29kZUF0KGkgKyAxKSkgPCAweGRjMDAgfHwgYiA+IDB4ZGZmZlxuICAgICAgPyBUT19TVFJJTkcgPyBzLmNoYXJBdChpKSA6IGFcbiAgICAgIDogVE9fU1RSSU5HID8gcy5zbGljZShpLCBpICsgMikgOiAoYSAtIDB4ZDgwMCA8PCAxMCkgKyAoYiAtIDB4ZGMwMCkgKyAweDEwMDAwO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWF0LmpzXG4vLyBtb2R1bGUgaWQgPSAxMTdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///117\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(48);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(24);\nvar hide = __webpack_require__(23);\nvar Iterators = __webpack_require__(66);\nvar $iterCreate = __webpack_require__(119);\nvar setToStringTag = __webpack_require__(64);\nvar getPrototypeOf = __webpack_require__(30);\nvar ITERATOR = __webpack_require__(10)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1kZWZpbmUuanM/YjljZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgTElCUkFSWSA9IHJlcXVpcmUoJy4vX2xpYnJhcnknKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgJGl0ZXJDcmVhdGUgPSByZXF1aXJlKCcuL19pdGVyLWNyZWF0ZScpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciBnZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEJVR0dZID0gIShbXS5rZXlzICYmICduZXh0JyBpbiBbXS5rZXlzKCkpOyAvLyBTYWZhcmkgaGFzIGJ1Z2d5IGl0ZXJhdG9ycyB3L28gYG5leHRgXG52YXIgRkZfSVRFUkFUT1IgPSAnQEBpdGVyYXRvcic7XG52YXIgS0VZUyA9ICdrZXlzJztcbnZhciBWQUxVRVMgPSAndmFsdWVzJztcblxudmFyIHJldHVyblRoaXMgPS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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///118\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(56);\nvar descriptor = __webpack_require__(52);\nvar setToStringTag = __webpack_require__(64);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(23)(IteratorPrototype, __webpack_require__(10)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1jcmVhdGUuanM/MjExMiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgY3JlYXRlID0gcmVxdWlyZSgnLi9fb2JqZWN0LWNyZWF0ZScpO1xudmFyIGRlc2NyaXB0b3IgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG52YXIgc2V0VG9TdHJpbmdUYWcgPSByZXF1aXJlKCcuL19zZXQtdG8tc3RyaW5nLXRhZycpO1xudmFyIEl0ZXJhdG9yUHJvdG90eXBlID0ge307XG5cbi8vIDI1LjEuMi4xLjEgJUl0ZXJhdG9yUHJvdG90eXBlJVtAQGl0ZXJhdG9yXSgpXG5yZXF1aXJlKCcuL19oaWRlJykoSXRlcmF0b3JQcm90b3R5cGUsIHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpLCBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9KTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoQ29uc3RydWN0b3IsIE5BTUUsIG5leHQpIHtcbiAgQ29uc3RydWN0b3IucHJvdG90eXBlID0gY3JlYXRlKEl0ZXJhdG9yUHJvdG90eXBlLCB7IG5leHQ6IGRlc2NyaXB0b3IoMSwgbmV4dCkgfSk7XG4gIHNldFRvU3RyaW5nVGFnKENvbnN0cnVjdG9yLCBOQU1FICsgJyBJdGVyYXRvcicpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDExOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///119\n")},function(module,exports,__webpack_require__){eval("// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = __webpack_require__(87);\nvar defined = __webpack_require__(37);\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWNvbnRleHQuanM/OTJhYSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBoZWxwZXIgZm9yIFN0cmluZyN7c3RhcnRzV2l0aCwgZW5kc1dpdGgsIGluY2x1ZGVzfVxudmFyIGlzUmVnRXhwID0gcmVxdWlyZSgnLi9faXMtcmVnZXhwJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGhhdCwgc2VhcmNoU3RyaW5nLCBOQU1FKSB7XG4gIGlmIChpc1JlZ0V4cChzZWFyY2hTdHJpbmcpKSB0aHJvdyBUeXBlRXJyb3IoJ1N0cmluZyMnICsgTkFNRSArIFwiIGRvZXNuJ3QgYWNjZXB0IHJlZ2V4IVwiKTtcbiAgcmV0dXJuIFN0cmluZyhkZWZpbmVkKHRoYXQpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3N0cmluZy1jb250ZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAxMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///120\n")},function(module,exports,__webpack_require__){eval("var MATCH = __webpack_require__(10)('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZmFpbHMtaXMtcmVnZXhwLmpzP2Q0NDQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIE1BVENIID0gcmVxdWlyZSgnLi9fd2tzJykoJ21hdGNoJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVkpIHtcbiAgdmFyIHJlID0gLy4vO1xuICB0cnkge1xuICAgICcvLi8nW0tFWV0ocmUpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgdHJ5IHtcbiAgICAgIHJlW01BVENIXSA9IGZhbHNlO1xuICAgICAgcmV0dXJuICEnLy4vJ1tLRVldKHJlKTtcbiAgICB9IGNhdGNoIChmKSB7IC8qIGVtcHR5ICovIH1cbiAgfSByZXR1cm4gdHJ1ZTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZhaWxzLWlzLXJlZ2V4cC5qc1xuLy8gbW9kdWxlIGlkID0gMTIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///121\n")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(66);\nvar ITERATOR = __webpack_require__(10)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXMtYXJyYXktaXRlci5qcz9mNmY2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGNoZWNrIG9uIGRlZmF1bHQgQXJyYXkgaXRlcmF0b3JcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEFycmF5UHJvdG8gPSBBcnJheS5wcm90b3R5cGU7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCAhPT0gdW5kZWZpbmVkICYmIChJdGVyYXRvcnMuQXJyYXkgPT09IGl0IHx8IEFycmF5UHJvdG9bSVRFUkFUT1JdID09PSBpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1hcnJheS1pdGVyLmpzXG4vLyBtb2R1bGUgaWQgPSAxMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///122\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $defineProperty = __webpack_require__(13);\nvar createDesc = __webpack_require__(52);\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY3JlYXRlLXByb3BlcnR5LmpzPzZkMjMiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGNyZWF0ZURlc2MgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG9iamVjdCwgaW5kZXgsIHZhbHVlKSB7XG4gIGlmIChpbmRleCBpbiBvYmplY3QpICRkZWZpbmVQcm9wZXJ0eS5mKG9iamVjdCwgaW5kZXgsIGNyZWF0ZURlc2MoMCwgdmFsdWUpKTtcbiAgZWxzZSBvYmplY3RbaW5kZXhdID0gdmFsdWU7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jcmVhdGUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDEyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///123\n")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(75);\nvar ITERATOR = __webpack_require__(10)('iterator');\nvar Iterators = __webpack_require__(66);\nmodule.exports = __webpack_require__(31).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QuanM/NDg3NyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY2xhc3NvZiA9IHJlcXVpcmUoJy4vX2NsYXNzb2YnKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19jb3JlJykuZ2V0SXRlcmF0b3JNZXRob2QgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ICE9IHVuZGVmaW5lZCkgcmV0dXJuIGl0W0lURVJBVE9SXVxuICAgIHx8IGl0WydAQGl0ZXJhdG9yJ11cbiAgICB8fCBJdGVyYXRvcnNbY2xhc3NvZihpdCldO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QuanNcbi8vIG1vZHVsZSBpZCA9IDEyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///124\n")},function(module,exports,__webpack_require__){eval("// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = __webpack_require__(315);\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktc3BlY2llcy1jcmVhdGUuanM/YTY1NCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA5LjQuMi4zIEFycmF5U3BlY2llc0NyZWF0ZShvcmlnaW5hbEFycmF5LCBsZW5ndGgpXG52YXIgc3BlY2llc0NvbnN0cnVjdG9yID0gcmVxdWlyZSgnLi9fYXJyYXktc3BlY2llcy1jb25zdHJ1Y3RvcicpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvcmlnaW5hbCwgbGVuZ3RoKSB7XG4gIHJldHVybiBuZXcgKHNwZWNpZXNDb25zdHJ1Y3RvcihvcmlnaW5hbCkpKGxlbmd0aCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1zcGVjaWVzLWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///125\n")},function(module,exports,__webpack_require__){"use strict";eval("// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n\nvar toObject = __webpack_require__(19);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktZmlsbC5qcz9jYzI2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIyLjEuMy42IEFycmF5LnByb3RvdHlwZS5maWxsKHZhbHVlLCBzdGFydCA9IDAsIGVuZCA9IHRoaXMubGVuZ3RoKVxuJ3VzZSBzdHJpY3QnO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBmaWxsKHZhbHVlIC8qICwgc3RhcnQgPSAwLCBlbmQgPSBAbGVuZ3RoICovKSB7XG4gIHZhciBPID0gdG9PYmplY3QodGhpcyk7XG4gIHZhciBsZW5ndGggPSB0b0xlbmd0aChPLmxlbmd0aCk7XG4gIHZhciBhTGVuID0gYXJndW1lbnRzLmxlbmd0aDtcbiAgdmFyIGluZGV4ID0gdG9BYnNvbHV0ZUluZGV4KGFMZW4gPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkLCBsZW5ndGgpO1xuICB2YXIgZW5kID0gYUxlbiA+IDIgPyBhcmd1bWVudHNbMl0gOiB1bmRlZmluZWQ7XG4gIHZhciBlbmRQb3MgPSBlbmQgPT09IHVuZGVmaW5lZCA/IGxlbmd0aCA6IHRvQWJzb2x1dGVJbmRleChlbmQsIGxlbmd0aCk7XG4gIHdoaWxlIChlbmRQb3MgPiBpbmRleCkgT1tpbmRleCsrXSA9IHZhbHVlO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2FycmF5LWZpbGwuanNcbi8vIG1vZHVsZSBpZCA9IDEyNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///126\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(49);\nvar step = __webpack_require__(172);\nvar Iterators = __webpack_require__(66);\nvar toIObject = __webpack_require__(28);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(118)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaXRlcmF0b3IuanM/NWEwNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgYWRkVG9VbnNjb3BhYmxlcyA9IHJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpO1xudmFyIHN0ZXAgPSByZXF1aXJlKCcuL19pdGVyLXN0ZXAnKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG5cbi8vIDIyLjEuMy40IEFycmF5LnByb3RvdHlwZS5lbnRyaWVzKClcbi8vIDIyLjEuMy4xMyBBcnJheS5wcm90b3R5cGUua2V5cygpXG4vLyAyMi4xLjMuMjkgQXJyYXkucHJvdG90eXBlLnZhbHVlcygpXG4vLyAyMi4xLjMuMzAgQXJyYXkucHJvdG90eXBlW0BAaXRlcmF0b3JdKClcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9faXRlci1kZWZpbmUnKShBcnJheSwgJ0FycmF5JywgZnVuY3Rpb24gKGl0ZXJhdGVkLCBraW5kKSB7XG4gIHRoaXMuX3QgPSB0b0lPYmplY3QoaXRlcmF0ZWQpOyAvLyB0YXJnZXRcbiAgdGhpcy5faSA9IDA7ICAgICAgICAgICAgICAgICAgIC8vIG5leHQgaW5kZXhcbiAgdGhpcy5fayA9IGtpbmQ7ICAgICAgICAgICAgICAgIC8v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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///127\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(32);\nvar invoke = __webpack_require__(162);\nvar html = __webpack_require__(110);\nvar cel = __webpack_require__(106);\nvar global = __webpack_require__(7);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(33)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdGFzay5qcz80OWU4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBpbnZva2UgPSByZXF1aXJlKCcuL19pbnZva2UnKTtcbnZhciBodG1sID0gcmVxdWlyZSgnLi9faHRtbCcpO1xudmFyIGNlbCA9IHJlcXVpcmUoJy4vX2RvbS1jcmVhdGUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBwcm9jZXNzID0gZ2xvYmFsLnByb2Nlc3M7XG52YXIgc2V0VGFzayA9IGdsb2JhbC5zZXRJbW1lZGlhdGU7XG52YXIgY2xlYXJUYXNrID0gZ2xvYmFsLmNsZWFySW1tZWRpYXRlO1xudmFyIE1lc3NhZ2VDaGFubmVsID0gZ2xvYmFsLk1lc3NhZ2VDaGFubmVsO1xudmFyIERpc3BhdGNoID0gZ2xvYmFsLkRpc3BhdGNoO1xudmFyIGNvdW50ZXIgPSAwO1xudmFyIHF1ZXVlID0ge307XG52YXIgT05SRUFEWVNUQVRFQ0hBTkdFID0gJ29uc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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///128\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar macrotask = __webpack_require__(128).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(33)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWljcm90YXNrLmpzPzgzN2UiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIG1hY3JvdGFzayA9IHJlcXVpcmUoJy4vX3Rhc2snKS5zZXQ7XG52YXIgT2JzZXJ2ZXIgPSBnbG9iYWwuTXV0YXRpb25PYnNlcnZlciB8fCBnbG9iYWwuV2ViS2l0TXV0YXRpb25PYnNlcnZlcjtcbnZhciBwcm9jZXNzID0gZ2xvYmFsLnByb2Nlc3M7XG52YXIgUHJvbWlzZSA9IGdsb2JhbC5Qcm9taXNlO1xudmFyIGlzTm9kZSA9IHJlcXVpcmUoJy4vX2NvZicpKHByb2Nlc3MpID09ICdwcm9jZXNzJztcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoKSB7XG4gIHZhciBoZWFkLCBsYXN0LCBub3RpZnk7XG5cbiAgdmFyIGZsdXNoID0gZnVuY3Rpb24gKCkge1xuICAgIHZhciBwYXJlbnQsIGZuO1xuICAgIGlmIChpc05vZGUgJiYgKHBhcmVudCA9IHByb2Nlc3MuZG9tYWluKSkgcGFyZW50LmV4aXQoKTtcbiAgICB3aGlsZSAoaGVhZCkge1xuICA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0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX21pY3JvdGFzay5qc1xuLy8gbW9kdWxlIGlkID0gMTI5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///129\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = __webpack_require__(20);\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMwLmpzIiwic291cmNlcyI6WyJ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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///130\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar DESCRIPTORS = __webpack_require__(12);\nvar LIBRARY = __webpack_require__(48);\nvar $typed = __webpack_require__(94);\nvar hide = __webpack_require__(23);\nvar redefineAll = __webpack_require__(61);\nvar fails = __webpack_require__(8);\nvar anInstance = __webpack_require__(59);\nvar toInteger = __webpack_require__(38);\nvar toLength = __webpack_require__(14);\nvar toIndex = __webpack_require__(181);\nvar gOPN = __webpack_require__(57).f;\nvar dP = __webpack_require__(13).f;\nvar arrayFill = __webpack_require__(126);\nvar setToStringTag = __webpack_require__(64);\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n//# sourceURL=[module]\n//#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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///131\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZWZpbmVkLmpzP2U3NjgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjEgUmVxdWlyZU9iamVjdENvZXJjaWJsZShhcmd1bWVudClcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIGlmIChpdCA9PSB1bmRlZmluZWQpIHRocm93IFR5cGVFcnJvcihcIkNhbid0IGNhbGwgbWV0aG9kIG9uICBcIiArIGl0KTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZWZpbmVkLmpzXG4vLyBtb2R1bGUgaWQgPSAxMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///132\n')},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(134);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1sZW5ndGguanM/NDExMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMTUgVG9MZW5ndGhcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXQgPiAwID8gbWluKHRvSW50ZWdlcihpdCksIDB4MWZmZmZmZmZmZmZmZmYpIDogMDsgLy8gcG93KDIsIDUzKSAtIDEgPT0gOTAwNzE5OTI1NDc0MDk5MVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1sZW5ndGguanNcbi8vIG1vZHVsZSBpZCA9IDEzM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///133\n")},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzPzUyZTEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4xLjQgVG9JbnRlZ2VyXG52YXIgY2VpbCA9IE1hdGguY2VpbDtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXNOYU4oaXQgPSAraXQpID8gMCA6IChpdCA+IDAgPyBmbG9vciA6IGNlaWwpKGl0KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8taW50ZWdlci5qc1xuLy8gbW9kdWxlIGlkID0gMTM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///134\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(136)('keys');\nvar uid = __webpack_require__(98);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzPzZiMWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHNoYXJlZCA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpKCdrZXlzJyk7XG52YXIgdWlkID0gcmVxdWlyZSgnLi9fdWlkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgcmV0dXJuIHNoYXJlZFtrZXldIHx8IChzaGFyZWRba2V5XSA9IHVpZChrZXkpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2hhcmVkLWtleS5qc1xuLy8gbW9kdWxlIGlkID0gMTM1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///135\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(11);\nvar global = __webpack_require__(21);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(78) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQuanM/N2JjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBTSEFSRUQgPSAnX19jb3JlLWpzX3NoYXJlZF9fJztcbnZhciBzdG9yZSA9IGdsb2JhbFtTSEFSRURdIHx8IChnbG9iYWxbU0hBUkVEXSA9IHt9KTtcblxuKG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIHN0b3JlW2tleV0gfHwgKHN0b3JlW2tleV0gPSB2YWx1ZSAhPT0gdW5kZWZpbmVkID8gdmFsdWUgOiB7fSk7XG59KSgndmVyc2lvbnMnLCBbXSkucHVzaCh7XG4gIHZlcnNpb246IGNvcmUudmVyc2lvbixcbiAgbW9kZTogcmVxdWlyZSgnLi9fbGlicmFyeScpID8gJ3B1cmUnIDogJ2dsb2JhbCcsXG4gIGNvcHlyaWdodDogJ8KpIDIwMTggRGVuaXMgUHVzaGthcmV2ICh6bG9pcm9jay5ydSknXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQuanNcbi8vIG1vZHVsZSBpZCA9IDEzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///136\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzP2M2NzciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gSUUgOC0gZG9uJ3QgZW51bSBidWcga2V5c1xubW9kdWxlLmV4cG9ydHMgPSAoXG4gICdjb25zdHJ1Y3RvcixoYXNPd25Qcm9wZXJ0eSxpc1Byb3RvdHlwZU9mLHByb3BlcnR5SXNFbnVtZXJhYmxlLHRvTG9jYWxlU3RyaW5nLHRvU3RyaW5nLHZhbHVlT2YnXG4pLnNwbGl0KCcsJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZW51bS1idWcta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTM3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///137\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(26);\nvar core = __webpack_require__(11);\nvar fails = __webpack_require__(70);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzP2JhYTUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gbW9zdCBPYmplY3QgbWV0aG9kcyBieSBFUzYgc2hvdWxkIGFjY2VwdCBwcmltaXRpdmVzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZLCBleGVjKSB7XG4gIHZhciBmbiA9IChjb3JlLk9iamVjdCB8fCB7fSlbS0VZXSB8fCBPYmplY3RbS0VZXTtcbiAgdmFyIGV4cCA9IHt9O1xuICBleHBbS0VZXSA9IGV4ZWMoZm4pO1xuICAkZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIGZhaWxzKGZ1bmN0aW9uICgpIHsgZm4oMSk7IH0pLCAnT2JqZWN0JywgZXhwKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LXNhcC5qc1xuLy8gbW9kdWxlIGlkID0gMTM4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///138\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(45);\nvar document = __webpack_require__(21).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzPzM4ZGQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbi8vIHR5cGVvZiBkb2N1bWVudC5jcmVhdGVFbGVtZW50IGlzICdvYmplY3QnIGluIG9sZCBJRVxudmFyIGlzID0gaXNPYmplY3QoZG9jdW1lbnQpICYmIGlzT2JqZWN0KGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGlzID8gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChpdCkgOiB7fTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZG9tLWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///139\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(45);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1wcmltaXRpdmUuanM/MzI2MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMSBUb1ByaW1pdGl2ZShpbnB1dCBbLCBQcmVmZXJyZWRUeXBlXSlcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuLy8gaW5zdGVhZCBvZiB0aGUgRVM2IHNwZWMgdmVyc2lvbiwgd2UgZGlkbid0IGltcGxlbWVudCBAQHRvUHJpbWl0aXZlIGNhc2Vcbi8vIGFuZCB0aGUgc2Vjb25kIGFyZ3VtZW50IC0gZmxhZyAtIHByZWZlcnJlZCB0eXBlIGlzIGEgc3RyaW5nXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgUykge1xuICBpZiAoIWlzT2JqZWN0KGl0KSkgcmV0dXJuIGl0O1xuICB2YXIgZm4sIHZhbDtcbiAgaWYgKFMgJiYgdHlwZW9mIChmbiA9IGl0LnRvU3RyaW5nKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIGlmICh0eXBlb2YgKGZuID0gaXQudmFsdWVPZikgPT0gJ2Z1bmN0aW9uJyAmJiAhaXNPYmplY3QodmFsID0gZm4uY2FsbChpdCkpKSByZXR1cm4gdmFsO1xuICBpZiAoIVMgJiYgdHlwZW9mIChmbiA9IGl0LnRvU3RyaW5nKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIHRocm93IFR5cGVFcnJvcihcIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZVwiKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tcHJpbWl0aXZlLmpzXG4vLyBtb2R1bGUgaWQgPSAxNDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///140\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(41);\nvar dPs = __webpack_require__(433);\nvar enumBugKeys = __webpack_require__(137);\nvar IE_PROTO = __webpack_require__(135)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(139)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(195).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtY3JlYXRlLmpzPzYyODYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjIgLyAxNS4yLjMuNSBPYmplY3QuY3JlYXRlKE8gWywgUHJvcGVydGllc10pXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBkUHMgPSByZXF1aXJlKCcuL19vYmplY3QtZHBzJyk7XG52YXIgZW51bUJ1Z0tleXMgPSByZXF1aXJlKCcuL19lbnVtLWJ1Zy1rZXlzJyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgRW1wdHkgPSBmdW5jdGlvbiAoKSB7IC8qIGVtcHR5ICovIH07XG52YXIgUFJPVE9UWVBFID0gJ3Byb3RvdHlwZSc7XG5cbi8vIENyZWF0ZSBvYmplY3Qgd2l0aCBmYWtlIGBudWxsYCBwcm90b3R5cGU6IHVzZSBpZnJhbWUgT2JqZWN0IHdpdGggY2xlYXJlZCBwcm90b3R5cGVcbnZhciBjcmVhdGVEaWN0ID0gZnVuY3Rpb24gKCkge1xuICAvLyBUaHJhc2gsIHdhc3RlIGFuZCBzb2RvbXk6IElFIEdDIGJ1Z1xuICB2YXIgaWZyYW1lID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EVdID0gYW5PYmplY3QoTyk7XG4gICAgcmVzdWx0ID0gbmV3IEVtcHR5KCk7XG4gICAgRW1wdHlbUFJPVE9UWVBFXSA9IG51bGw7XG4gICAgLy8gYWRkIFwiX19wcm90b19fXCIgZm9yIE9iamVjdC5nZXRQcm90b3R5cGVPZiBwb2x5ZmlsbFxuICAgIHJlc3VsdFtJRV9QUk9UT10gPSBPO1xuICB9IGVsc2UgcmVzdWx0ID0gY3JlYXRlRGljdCgpO1xuICByZXR1cm4gUHJvcGVydGllcyA9PT0gdW5kZWZpbmVkID8gcmVzdWx0IDogZFBzKHJlc3VsdCwgUHJvcGVydGllcyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDE0MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///141\n")},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(77);\nvar TAG = __webpack_require__(22)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jbGFzc29mLmpzPzQ1OGYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZ2V0dGluZyB0YWcgZnJvbSAxOS4xLjMuNiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nKClcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbnZhciBUQUcgPSByZXF1aXJlKCcuL193a3MnKSgndG9TdHJpbmdUYWcnKTtcbi8vIEVTMyB3cm9uZyBoZXJlXG52YXIgQVJHID0gY29mKGZ1bmN0aW9uICgpIHsgcmV0dXJuIGFyZ3VtZW50czsgfSgpKSA9PSAnQXJndW1lbnRzJztcblxuLy8gZmFsbGJhY2sgZm9yIElFMTEgU2NyaXB0IEFjY2VzcyBEZW5pZWQgZXJyb3JcbnZhciB0cnlHZXQgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICB0cnkge1xuICAgIHJldHVybiBpdFtrZXldO1xuICB9IGNhdGNoIChlKSB7IC8qIGVtcHR5ICovIH1cbn07XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHZhciBPLCBULCBCO1xuICByZXR1cm4gaXQgPT09IHVuZGVmaW5lZCA/ICdVbmRlZmluZWQnIDogaXQgPT09IG51bGwgPyAnTnVsbCdcbiAgICAvLyBAQHRvU3RyaW5nVGFnIGNhc2VcbiAgICA6IHR5cGVvZiAoVCA9IHRyeUdldChPID0gT2JqZWN0KGl0KSwgVEFHKSkgPT0gJ3N0cmluZycgPyBUXG4gICAgLy8gYnVpbHRpblRhZyBjYXNlXG4gICAgOiBBUkcgPyBjb2YoTylcbiAgICAvLyBFUzMgYXJndW1lbnRzIGZhbGxiYWNrXG4gICAgOiAoQiA9IGNvZihPKSkgPT0gJ09iamVjdCcgJiYgdHlwZW9mIE8uY2FsbGVlID09ICdmdW5jdGlvbicgPyAnQXJndW1lbnRzJyA6IEI7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NsYXNzb2YuanNcbi8vIG1vZHVsZSBpZCA9IDE0MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///142\n")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(142);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar Iterators = __webpack_require__(71);\nmodule.exports = __webpack_require__(11).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuZ2V0LWl0ZXJhdG9yLW1ldGhvZC5qcz9kZGZiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjbGFzc29mID0gcmVxdWlyZSgnLi9fY2xhc3NvZicpO1xudmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2NvcmUnKS5nZXRJdGVyYXRvck1ldGhvZCA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoaXQgIT0gdW5kZWZpbmVkKSByZXR1cm4gaXRbSVRFUkFUT1JdXG4gICAgfHwgaXRbJ0BAaXRlcmF0b3InXVxuICAgIHx8IEl0ZXJhdG9yc1tjbGFzc29mKGl0KV07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kLmpzXG4vLyBtb2R1bGUgaWQgPSAxNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///143\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = __webpack_require__(99);\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19uZXctcHJvbWlzZS1jYXBhYmlsaXR5LmpzP2E4MDQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gMjUuNC4xLjUgTmV3UHJvbWlzZUNhcGFiaWxpdHkoQylcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG5cbmZ1bmN0aW9uIFByb21pc2VDYXBhYmlsaXR5KEMpIHtcbiAgdmFyIHJlc29sdmUsIHJlamVjdDtcbiAgdGhpcy5wcm9taXNlID0gbmV3IEMoZnVuY3Rpb24gKCQkcmVzb2x2ZSwgJCRyZWplY3QpIHtcbiAgICBpZiAocmVzb2x2ZSAhPT0gdW5kZWZpbmVkIHx8IHJlamVjdCAhPT0gdW5kZWZpbmVkKSB0aHJvdyBUeXBlRXJyb3IoJ0JhZCBQcm9taXNlIGNvbnN0cnVjdG9yJyk7XG4gICAgcmVzb2x2ZSA9ICQkcmVzb2x2ZTtcbiAgICByZWplY3QgPSAkJHJlamVjdDtcbiAgfSk7XG4gIHRoaXMucmVzb2x2ZSA9IGFGdW5jdGlvbihyZXNvbHZlKTtcbiAgdGhpcy5yZWplY3QgPSBhRnVuY3Rpb24ocmVqZWN0KTtcbn1cblxubW9kdWxlLmV4cG9ydHMuZiA9IGZ1bmN0aW9uIChDKSB7XG4gIHJldHVybiBuZXcgUHJvbWlzZUNhcGFiaWxpdHkoQyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX25ldy1wcm9taXNlLWNhcGFiaWxpdHkuanNcbi8vIG1vZHVsZSBpZCA9IDE0NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///144\n")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qcz9kNjQ0Il0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMuZiA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcHMuanNcbi8vIG1vZHVsZSBpZCA9IDE0NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///145\n")},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(22);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZXh0LmpzPzJhMWUiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fd2tzJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gMTQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///146\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar core = __webpack_require__(11);\nvar LIBRARY = __webpack_require__(78);\nvar wksExt = __webpack_require__(146);\nvar defineProperty = __webpack_require__(44).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZGVmaW5lLmpzPzcyYjkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgTElCUkFSWSA9IHJlcXVpcmUoJy4vX2xpYnJhcnknKTtcbnZhciB3a3NFeHQgPSByZXF1aXJlKCcuL193a3MtZXh0Jyk7XG52YXIgZGVmaW5lUHJvcGVydHkgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAobmFtZSkge1xuICB2YXIgJFN5bWJvbCA9IGNvcmUuU3ltYm9sIHx8IChjb3JlLlN5bWJvbCA9IExJQlJBUlkgPyB7fSA6IGdsb2JhbC5TeW1ib2wgfHwge30pO1xuICBpZiAobmFtZS5jaGFyQXQoMCkgIT0gJ18nICYmICEobmFtZSBpbiAkU3ltYm9sKSkgZGVmaW5lUHJvcGVydHkoJFN5bWJvbCwgbmFtZSwgeyB2YWx1ZTogd2tzRXh0LmYobmFtZSkgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1kZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDE0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///147\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(81);\nvar createDesc = __webpack_require__(79);\nvar toIObject = __webpack_require__(50);\nvar toPrimitive = __webpack_require__(140);\nvar has = __webpack_require__(62);\nvar IE8_DOM_DEFINE = __webpack_require__(191);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(51) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8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ZHVsZXMvX29iamVjdC1nb3BkLmpzXG4vLyBtb2R1bGUgaWQgPSAxNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///148\n")},function(module,exports){eval('// proxy-observe v0.0.18\r\n// Copyright (c) 2015, 2016 Simon Y. Blackwell, AnyWhichWay\r\n// MIT License - http://opensource.org/licenses/mit-license.php\r\n(function() {\r\n\t"use strict";\r\n\t// Creates and returns a Proxy wrapping a target so that all changes can be trapped and forwarded to\r\n\t// a callback. The callback takes an array of changes just like the traditional original Chrome Object.observe\r\n\t// {object:,name:,type:add|update|delete|reconfigure|preventExtensions|setPrototype,oldValue:}\r\n\t// The acceptlist can be add|update|delete|reconfigure|preventExtensions|setPrototype.\r\n\t// v 0.0.10 to support pausing and restarting observation two additional constructor arguments are available to Object.observe:\r\n\t// pausable - create the Observer so it can be paused\r\n\t// pause - create observer in paused state\r\n\t// if pausable is true then an additional method deliver(ignorePrevious) is available to start delivery\r\n\t// to pause delivery set a property called pause on the function deliver to true\r\n\t// pausable is optional to reduce the chance of shadowing a property or method on any existing code called deliver\r\n\tif(!Object.observe && typeof(Proxy)==="function") {\r\n\t\tfunction Observer(target,callback,acceptlist,pausable,pause,delay) {\r\n\t \tvar me = this, proxy;\r\n\t \tfunction deliver(ignorePrevious,delay) {\r\n\t \t\tdeliver.delay = delay;\r\n\t \t\tif(!deliver.pause) {\r\n\t \t\tif(me.changeset.length>0) {\r\n\t \t\t\tif(!ignorePrevious) {\r\n\t\t \t \t\tvar changes = me.changeset.filter(function(change) { return !acceptlist || acceptlist.indexOf(change.type)>=0; });\r\n\t\t \t\t\tif(changes.length>0) {\r\n\t\t \t\t\t\tcallback(changes);\r\n\t\t \t\t\t}\r\n\t \t\t\t}\r\n\t \t\t\tme.changeset = [];\r\n\t \t\t}\r\n\t \t\t}\r\n\t \t}\r\n\t \tdeliver.pause = pause;\r\n\t \tdeliver.delay = delay;\r\n\t\t me.get = function(target, property) {\r\n\t\t \tif(property==="__observer__") {\r\n\t\t \t\treturn me;\r\n\t\t \t}\r\n\t\t \tif(property==="unobserve") {\r\n\t\t \t\treturn function() {\r\n\t\t \t\t\tObject.unobserve(target);\r\n\t\t \t\t\treturn target;\r\n\t\t \t\t};\r\n\t\t \t}\r\n\t\t \tif(property==="deliver") {\r\n\t\t \t\treturn deliver;\r\n\t\t \t}\r\n\t\t \treturn target[property];\r\n\t\t }\r\n\t \tme.target = target;\r\n\t \tme.changeset = [];\r\n\t \tif(!me.target.__observerCallbacks__) {\r\n\t \t\t// __observerCallbacks__ is used as an index to get at the proxy which is the observer, so we can unobserve\r\n\t \t\tObject.defineProperty(target,"__observerCallbacks__",{enumerable:false,configurable:true,writable:false,value:[]});\r\n\t \t\tObject.defineProperty(target,"__observers__",{enumerable:false,configurable:true,writable:false,value:[]});\r\n\t \t}\r\n\t \tme.target.__observerCallbacks__.push(callback);\r\n\t \tme.target.__observers__.push(this);\r\n\t \tproxy = new Proxy(target,me);\r\n\t \tdeliver(false,delay);\r\n\t \treturn proxy;\r\n\t }\r\n\t\tObserver.prototype.deliver = function() {\r\n\t\t\treturn this.get(null,"deliver");\r\n\t\t}\r\n\t Observer.prototype.set = function(target, property, value) { // , receiver\r\n\t \tvar oldvalue = target[property];\r\n\t \tvar type = (oldvalue===undefined ? "add" : "update");\r\n\t \ttarget[property] = value;\r\n\t \tif(target.__observers__.indexOf(this)>=0 && (!this.acceptlist || this.acceptlist.indexOf(type)>=0)) {\r\n\t \tvar change = {object:target,name:property,type:type},\r\n\t \t\tstart = this.changeset.length === 0,\r\n\t \t\tdeliver = this.deliver();\r\n\t \tif(type==="update") {\r\n\t \t\tchange.oldValue = oldvalue;\r\n\t \t}\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.deleteProperty = function(target, property) {\r\n\t \tvar oldvalue = target[property];\r\n\t \t//if(typeof(oldvalue)!=="undefined") {\r\n\t\t \tdelete target[property];\r\n\t\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("delete")>=0) {\r\n\t\t \tvar change = {object:target,name:property,type:"delete",oldValue:oldvalue},\r\n\t\t \t\tstart = this.changeset.length === 0,\r\n\t\t \t\tdeliver = this.deliver();\r\n\t\t \tthis.changeset.push(change);\r\n\t\t \tif(start) {\r\n\t\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t\t \t}\r\n\t\t \t}\r\n\t \t//}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.defineProperty = function(target, property, descriptor) {\r\n\t \tObject.defineProperty(target, property, descriptor);\r\n\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("reconfigure")>=0) {\r\n\t \tvar change = {object:target,name:property,type:"reconfigure"},\r\n \t\t\tstart = this.changeset.length === 0,\r\n \t\t\tdeliver = this.deliver();\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.setPrototypeOf = function(target, prototype) {\r\n\t \tvar oldvalue = Object.getPrototypeOf(target);\r\n\t \tObject.setPrototypeOf(target, prototype);\r\n\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("setPrototype")>=0) {\r\n\t \tvar change = {object:target,name:"__proto__",type:"setPrototype",oldValue:oldvalue},\r\n \t\t\t\tstart = this.changeset.length === 0,\r\n \t\t\t\tdeliver = this.deliver();\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.preventExtensions = function(target) {\r\n\t Object.preventExtensions(target);\r\n\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("preventExtensions")>=0) {\r\n\t \tvar change = {object:target,type:"preventExtensions"},\r\n\t\t\t\t\tstart = this.changeset.length === 0,\r\n\t\t\t\t\tdeliver = this.deliver();\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Object.observe = function(object,callback,acceptlist,pausable,pause,delay) {\r\n\t \treturn new Observer(object,callback,acceptlist,pausable,pause,delay);\r\n\t };\r\n\t Object.unobserve = function(object,callback) {\r\n\t \tif(object.__observerCallbacks__) {\r\n\t \t\tif(!callback) {\r\n\t \t\t\tobject.__observerCallbacks__.splice(0,object.__observerCallbacks__.length);\r\n\t \t\t\tobject.__observers__.splice(0,object.__observers__.length);\r\n\t \t\t\treturn;\r\n\t \t\t}\r\n\t \t\tobject.__observerCallbacks__.forEach(function(observercallback,i) {\r\n\t \t\t\tif(callback===observercallback) {\r\n\t \t\t\t\tobject.__observerCallbacks__.splice(i,1);\r\n\t \t\t\t\tdelete object.__observers__[i].callback;\r\n\t \t\t\t\tobject.__observers__.splice(i,1);\r\n\t \t\t\t}\r\n\t \t\t});\r\n\t \t}\r\n\t };\r\n\t Array.observe = function(object,callback,acceptlist,pausable,pause,delay) {\r\n\t \tif(!(object instanceof Array) && !Array.isArray(object)) {\r\n\t \t\tthrow new TypeError("First argument to Array.observer is not an Array");\r\n\t \t}\r\n \tacceptlist = acceptlist || ["add", "update", "delete", "splice"];\r\n\t \tvar arrayproxy = new Proxy(object,{get: function(target,property) {\r\n\t \t\tif(property==="unobserve") {\r\n\t\t \t\treturn function(callback) {\r\n\t\t \t\t\tif(callback) {\r\n\t\t \t\t\t\treturn Object.unobserve(target,callback);\r\n\t\t \t\t\t}\r\n\t\t \t\t\treturn target.unobserve();\r\n\t\t \t\t};\r\n\t\t \t}\r\n\t \t\tif(property==="splice") {\r\n\t \t\t\treturn function(start,end) {\r\n\t \t\t\t\tif(typeof(start)!=="number" || typeof(end)!=="number") {\r\n\t \t\t\t\t\tthrow new TypeError("First two arguments to Array splice are not number, number");\r\n\t \t\t\t\t}\r\n\t \t \t\tvar removed = this.slice(start,start+end),\r\n\t \t \t\t\taddedCount = (arguments.length > 1 ? arguments.length-2 : 0),\r\n\t \t \t\t\tchange = {object:object,type:"splice",index:start,removed:removed,addedCount:addedCount};\r\n\t \t \t\ttarget.splice.apply(target,arguments);\r\n\t \t \t\tif(acceptlist.indexOf("splice")>=0) {\r\n\t \t \t\t\tvar start = proxy.__observer__.changeset.length === 0,\r\n\t \t \t\t\tdeliver = proxy.__observer__.deliver();\r\n\t \t \t\t\tproxy.__observer__.changeset.push(change);\r\n\t \t \t\t\tif(start) {\r\n\t \t\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t\t \t}\r\n\t \t \t\t}\r\n\t \t \t}\r\n\t \t\t}\r\n\t \t\tif(property==="push") {\r\n\t \t\t\t return function(item) {\r\n\t \t\t \treturn this.splice(this.length,0,item);\r\n\t \t\t }\r\n\t \t\t}\r\n\t \t\tif(property==="pop") {\r\n\t \t\t\t return function() {\r\n\t \t\t \treturn this.splice(this.length-1,1);\r\n\t \t\t }\r\n\t \t\t}\r\n\t \t\tif(property==="unshift") {\r\n\t \t\t\t return function(item) {\r\n \t\t \t\treturn this.splice(0,0,item);\r\n \t\t \t}\r\n\t \t\t}\r\n\t \t\tif(property==="shift") {\r\n\t \t\t\treturn function() {\r\n\t \t \t\treturn this.splice(0,1);\r\n\t \t \t}\r\n\t \t\t}\r\n\t \t\treturn target[property];\r\n\t \t}});\r\n\t \tvar proxy = Object.observe(arrayproxy,function(changeset) { \r\n\t \t\tvar changes = changeset.filter(function(change) { return change.name!=="length" && change.name!=="add" && (!acceptlist || acceptlist.indexOf(change.type)>=0); });\r\n\t \t\tif(changes.length>0) {\r\n\t \t\t\tcallback(changes);\r\n\t \t\t}\r\n\t \t},acceptlist,pausable,pause,delay);\r\n\t \treturn proxy;\r\n\t };\r\n\t Array.unobserve = function(object,callback) {\r\n\t\t return object.unobserve(callback);\r\n\t }\r\n\t}\r\n\tObject.deepObserve = function(object,callback,parts) {\r\n\r\n\t\tparts = (parts ? parts : []);\r\n\r\n\t\tvar toTypeName = function(obj) {\r\n\t\t\treturn ({}).toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\r\n\t\t}\r\n\r\n\t\tfunction reobserve(value, parts) {\r\n\t\t\tvar keys = Object.keys(value);\r\n\t\t\tkeys.forEach(function(key) {\r\n\t\t\t\tif((toTypeName(value[key]) === \'object\' || toTypeName(value[key]) === \'array\') && !value[key].hasOwnProperty(\'__observers__\')) {\r\n\t\t\t\t\tvar newparts = parts.slice(0);\r\n\t\t\t\t\tnewparts.push(key);\r\n\t\t\t\t\tvalue[key] = Object.deepObserve(value[key],callback,newparts);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treobserve(object, parts);\r\n\r\n\t\tvar observed = Object.observe(object,function(changeset) {\r\n\t\t\tvar changes = [];\r\n\t\t\tfunction recurse(name,rootObject,oldObject,newObject,path) {\r\n\t\t\t\tif(newObject instanceof Object) {\r\n\t\t\t\t\tvar newkeys = Object.keys(newObject);\r\n\t\t\t\t\tnewkeys.forEach(function(key) {\r\n\t\t\t\t\t\tif(!oldObject || (oldObject[key]!==newObject[key])) {\r\n\t\t\t\t\t\t\tvar oldvalue = (oldObject && oldObject[key]!==undefined ? oldObject[key] : undefined),\r\n\t\t\t\t\t\t\t\tchange = (oldvalue===undefined ? "add" : "update"),\r\n\t\t\t\t\t\t\t\tkeypath = path + "." + key;\r\n\r\n\t\t\t\t\t\t\tchanges.push({name:name,object:rootObject,type:change,oldValue:oldvalue,newValue:newObject[key],keypath:keypath});\r\n\t\t\t\t\t\t\trecurse(name,rootObject,oldvalue,newObject[key],keypath);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t} else if(oldObject instanceof Object) {\r\n\t\t\t\t\tvar oldkeys = Object.keys(oldObject);\r\n\t\t\t\t\toldkeys.forEach(function(key) {\r\n\t\t\t\t\t\tvar change = (newObject===null ? "update" : "delete"),\r\n\t\t\t\t\t\t\tkeypath = path + "." + key;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tchanges.push({name:name,object:rootObject,type:change,oldValue:oldObject[key],newValue:newObject,keypath:keypath});\r\n\t\t\t\t\t\trecurse(name,rootObject,oldObject[key],undefined,keypath);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchangeset.forEach(function(change) {\r\n\t\t\t\tvar keypath = (parts.length>0 ? parts.join(".") + "." : "") + change.name;\r\n\r\n\t\t\t\tif (change.type === "update" || change.type === "add") { \r\n\t\t\t\t\treobserve(change.object, parts);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchanges.push({name:change.name,object:change.object,type:change.type,oldValue:change.oldValue,newValue:change.object[change.name],keypath:keypath});\r\n\t\t\t\trecurse(change.name,change.object,change.oldValue,change.object[change.name],keypath);\r\n\t\t\t});\r\n\t\t\tcallback(changes);\r\n\t\t});\r\n\t\treturn observed;\r\n\t};\r\n})();\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL3Byb3h5LW9ic2VydmUvaW5kZXguanM/MTIwYi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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///149\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('RegistrationStatus'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* The RegistrationStatus lib allows to monitor registration status of an Hyperty or Data Object\n*\n*/\nvar RegistrationStatus = function () {\n\n /**\n * @param {URL} url URL address of the entity to be monitored\n * @param {URL} runtimeURL the current URL of the Runtime Instance used\n * @param {HypertyURL} owner the URL of the Hyperty instance that is using this lib\n * @param {MiniBus} owner the URL of the Hyperty instance that is using this lib\n *\n */\n\n function RegistrationStatus(url, runtimeURL, owner, msgBus) {\n (0, _classCallCheck3.default)(this, RegistrationStatus);\n\n this._registryObjectURL = url;\n this._runtimeURL = runtimeURL;\n this._domain = (0, _utils.divideURL)(runtimeURL).domain;\n this._discoveredObjectURL = owner;\n this._messageBus = msgBus;\n this._subscriptionSet = false;\n this._subscribers = {\n live: {},\n disconnected: {}\n };\n }\n\n (0, _createClass3.default)(RegistrationStatus, [{\n key: 'onLive',\n value: function onLive(subscriber, callback) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._subscriptionSet) {\n _this._subscribe().then(function () {\n _this._subscribers.live[subscriber] = callback;\n resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n _this._subscribers.live[subscriber] = callback;\n resolve();\n }\n });\n }\n }, {\n key: 'onDisconnected',\n value: function onDisconnected(subscriber, callback) {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this2._subscriptionSet) {\n _this2._subscribe().then(function () {\n _this2._subscribers.disconnected[subscriber] = callback;\n resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n _this2._subscribers.disconnected[subscriber] = callback;\n resolve();\n }\n });\n }\n }, {\n key: '_subscribe',\n value: function _subscribe() {\n var _this3 = this;\n\n var msg = {\n type: 'subscribe',\n from: this._discoveredObjectURL,\n to: this._runtimeURL + '/subscriptions',\n body: {\n resources: [this._registryObjectURL + '/registration']\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3._messageBus.postMessage(msg, function (reply) {\n log.log('[DiscoveredObject.subscribe] ' + _this3._registryObjectURL + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n _this3._generateListener(_this3._registryObjectURL + '/registration');\n _this3._subscriptionSet = true;\n resolve();\n } else {\n log.error('Error subscribing ', _this3._registryObjectURL);\n reject('Error subscribing ' + _this3._registryObjectURL);\n }\n });\n });\n }\n }, {\n key: '_generateListener',\n value: function _generateListener(notificationURL) {\n var _this4 = this;\n\n this._messageBus.addListener(notificationURL, function (msg) {\n log.log('[DiscoveredObject.notification] ' + _this4._registryObjectURL + ': ', msg);\n _this4._processNotification(msg);\n });\n }\n }, {\n key: '_processNotification',\n value: function _processNotification(msg) {\n var _this5 = this;\n\n var status = msg.body.value;\n\n setTimeout(function () {\n\n // Hack to give time for onLive Hyperties to get ready. To be removed when Hyperty State machaine is implemented\n (0, _keys2.default)(_this5._subscribers[status]).forEach(function (subscriber) {\n return _this5._subscribers[status][subscriber]();\n });\n }, 5000);\n }\n }, {\n key: '_unsubscribe',\n value: function _unsubscribe() {\n var _this6 = this;\n\n var msg = {\n type: 'unsubscribe',\n from: this._discoveredObjectURL,\n to: this._runtimeURL + '/subscriptions',\n body: {\n resource: this._registryObjectURL + '/registration'\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this6._messageBus.postMessage(msg, function (reply) {\n log.log('[DiscoveredObject.unsubscribe] ' + _this6._registryObjectURL + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n resolve();\n } else {\n log.error('Error unsubscribing ', _this6._registryObjectURL);\n reject('Error unsubscribing ' + _this6._registryObjectURL);\n }\n });\n });\n }\n }, {\n key: 'unsubscribeLive',\n value: function unsubscribeLive(subscriber) {\n var _this7 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (subscriber in _this7._subscribers.live) {\n\n //TODO: unsubscribe outside this condition\n delete _this7._subscribers.live[subscriber];\n }\n\n if (_this7._areSubscriptionsEmpty()) {\n _this7._unsubscribe().then(function () {\n return resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n resolve();\n }\n\n /* } else {\n reject(`${subscriber} doesn't subscribe onLive for ${this._registryObjectURL}`);\n }*/\n });\n }\n }, {\n key: 'unsubscribeDisconnected',\n value: function unsubscribeDisconnected(subscriber) {\n var _this8 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (subscriber in _this8._subscribers.disconnected) {\n delete _this8._subscribers.disconnected[subscriber];\n\n if (_this8._areSubscriptionsEmpty()) {\n _this8._unsubscribe().then(function () {\n return resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n resolve();\n }\n } else {\n reject(subscriber + ' doesn\\'t subscribe onDisconnected for ' + _this8._registryObjectURL);\n }\n });\n }\n }, {\n key: '_areSubscriptionsEmpty',\n value: function _areSubscriptionsEmpty() {\n return (0, _keys2.default)(this._subscribers.live).length === 0 && (0, _keys2.default)(this._subscribers.disconnected).length === 0;\n }\n }]);\n return RegistrationStatus;\n}();\n\nexports.default = RegistrationStatus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvUmVnaXN0cmF0aW9uU3RhdHVzLmpzPzIyMjAiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyM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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFKQTtBQUNBO0FBUUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFHQTtBQUVBOzs7QUFHQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFEQTtBQUpBO0FBQ0E7QUFRQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBR0E7QUFDQTs7O0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFFQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///150\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar runtimeConfiguration = exports.runtimeConfiguration = {\n\n // TODO this should be changed with the definition used for indexeddb\n // look at: https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore\n // Now we are using the definition for Dexie; (http://dexie.org/docs/Version/Version.stores())\n storageSchemas: {\n capabilities: {\n capabilities: 'key,version,value'\n },\n subscriptions: {\n subscriptions: 'key,version,value'\n },\n runtime: {\n 'runtime:URL': 'key,version,value',\n 'p2pHandler:URL': 'key,version,value'\n },\n registry: {\n 'registry:DataObjectURLs': 'key,version,value',\n 'registry:HypertyURLs': 'key,version,value'\n },\n cryptoManager: {\n userAsymmetricKey: 'key,version,value',\n dataObjectSessionKeys: 'key,version,value'\n },\n identity: {\n accessTokens: 'key,version,value',\n identities: 'userURL, userProfile.email, userProfile.userURL, userProfile.name'\n },\n runtimeCatalogue: {\n runtimeCatalogue: '&cguid, accessControlPolicy, constraints, dataObjects, hypertyType, objectName, sourcePackage, version'\n },\n policy: {\n 'rethink:activePolicy': 'key,version,value',\n 'rethink:groups': 'key,version,value',\n 'rethink:userPolicies': 'key,version,value',\n 'rethink:spPolicies': 'key,version,value'\n },\n syncherManager: {\n 'syncherManager:ObjectURLs': 'key,version,value',\n 'remotes': 'key,version,value'\n },\n hypertyResources: {\n hypertyResources: '&resourceURL, name, contentUrl, content, created, reporter, resourceType'\n }\n },\n\n runtimeURLS: {\n registry: {\n prefix: 'hyperty-runtime://',\n suffix: 'registry'\n },\n identityModule: {\n prefix: 'hyperty-runtime://',\n suffix: '/idm'\n },\n runtimeUA: {\n prefix: 'hyperty-runtime://',\n suffix: '/ua'\n },\n catalogue: {\n prefix: 'hyperty-runtime://',\n suffix: '/catalogue'\n },\n graphConnector: {\n prefix: 'hyperty-runtime://',\n suffix: '/graph'\n },\n syncManager: {\n prefix: 'hyperty-runtime://',\n suffix: '/sm'\n }\n },\n catalogueURLs: {\n protocolstub: {\n prefix: 'hyperty-catalogue://catalogue.',\n suffix: '/.well-known/protocolstub/',\n fallback: 'hyperty-catalogue://catalogue.%domain%/.well-known/protocolstub/'\n },\n idpProxy: {\n prefix: 'hyperty-catalogue://catalogue.',\n suffix: '/.well-known/idp-proxy/',\n fallback: 'hyperty-catalogue://catalogue.%domain%/.well-known/idp-proxy/'\n }\n },\n msgNodeURL: {\n prefix: 'domain://msg-node.',\n suffix: '',\n hypertyAddressAllocation: '/hyperty-address-allocation',\n objectAddressAllocation: '/object-address-allocation',\n subscriptionManagement: '/sm'\n },\n domainRegistryURL: {\n prefix: 'domain://registry.',\n suffix: ''\n },\n globalRegistryURL: 'global://registry.',\n remoteStorage: 'https://hysmart.rethink.ptinovacao.pt/backup/'\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL3J1bnRpbWVDb25maWd1cmF0aW9uLmpzPzZiMWIiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IHJ1bnRpbWVDb25maWd1cmF0aW9uID0ge1xuXG4gIC8vIFRPRE8gdGhpcyBzaG91bGQgYmUgY2hhbmdlZCB3aXRoIHRoZSBkZWZpbml0aW9uIHVzZWQgZm9yIGluZGV4ZWRkYlxuICAvLyBsb29rIGF0OiBodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi1VUy9kb2NzL1dlYi9BUEkvSURCT2JqZWN0U3RvcmVcbiAgLy8gTm93IHdlIGFyZSB1c2luZyB0aGUgZGVmaW5pdGlvbiBmb3IgRGV4aWU7IChodHRwOi8vZGV4aWUub3JnL2RvY3MvVmVyc2lvbi9WZXJzaW9uLnN0b3JlcygpKVxuICBzdG9yYWdlU2NoZW1hczoge1xuICAgIGNhcGFiaWxpdGllczoge1xuICAgICAgY2FwYWJpbGl0aWVzOiAna2V5LHZlcnNpb24sdmFsdWUnXG4gICAgfSxcbiAgICBzdWJzY3JpcHRpb25zOiB7XG4gICAgICBzdWJzY3JpcHRpb25zOiAna2V5LHZlcnNpb24sdmFsdWUnXG4g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eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Operators = function () {\n function Operators() {\n (0, _classCallCheck3.default)(this, Operators);\n }\n\n (0, _createClass3.default)(Operators, [{\n key: 'and',\n value: function and(params) {\n return params[0] && params[1];\n }\n }, {\n key: 'between',\n value: function between(params) {\n var start = parseInt(params[0][0]);\n var end = parseInt(params[0][1]);\n var now = params[1];\n\n if (end < start) {\n now = now < start ? now += 2400 : now;\n end += 2400;\n }\n\n return now > start && now < end;\n }\n }, {\n key: 'equals',\n value: function equals(params) {\n return String(params[0]) === '*' || String(params[0]) === String(params[1]);\n }\n }, {\n key: 'greaterThan',\n value: function greaterThan(params) {\n return params[1] > params[0];\n }\n }, {\n key: 'in',\n value: function _in(params) {\n return params[0].indexOf(params[1]) > -1;\n }\n }, {\n key: 'lessThan',\n value: function lessThan(params) {\n return params[1] < params[0];\n }\n }, {\n key: 'not',\n value: function not(params) {\n return !params[0];\n }\n }, {\n key: 'or',\n value: function or(params) {\n return params[0] || params[1];\n }\n }]);\n return Operators;\n}();\n\nexports.default = Operators;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvT3BlcmF0b3JzLmpzPzFjNDIiXSwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgT3BlcmF0b3JzIHtcblxuICBhbmQocGFyYW1zKSB7XG4gICAgcmV0dXJuIHBhcmFtc1swXSAmJiBwYXJhbXNbMV07XG4gIH1cblxuICBiZXR3ZWVuKHBhcmF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0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///152\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(152);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a condition and evaluate its applicability.\n*/\nvar Condition = function () {\n\n /**\n * Creates a new Condition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function Condition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, Condition);\n\n this.attribute = attribute;\n this.operator = operator;\n this.params = params;\n this.operators = new _Operators2.default();\n }\n\n /**\n * Verifies if the condition is applicable to the message. First, the system value that corresponds to the attribute is retrieved; then, that value is compared with the parameter specified in the condition by executing the operator implementation. If the operator is 'in' and the name of a group is given, then the array holding the members of the group is retrieved before the comparison.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(Condition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n context[this.attribute] = { message: message };\n var value = context[this.attribute];\n var tempParam = void 0;\n\n if (this.operator === 'in') {\n if (!Array.isArray(this.params)) {\n tempParam = context.getGroup(this.params, message.to);\n return this.operators[this.operator]([tempParam, value]);\n }\n }\n\n return this.operators[this.operator]([this.params, value]);\n }\n }]);\n return Condition;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = Condition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9Db25kaXRpb24uanM/MmUzMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5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QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBL0RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQW1FQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///153\n")},function(module,exports){eval('var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function("return this")() || (1,eval)("this");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === "object")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it\'s\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLyh3ZWJwYWNrKS9idWlsZGluL2dsb2JhbC5qcz8zNjk4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBnO1xyXG5cclxuLy8gVGhpcyB3b3JrcyBpbiBub24tc3RyaWN0IG1vZGVcclxuZyA9IChmdW5jdGlvbigpIHtcclxuXHRyZXR1cm4gdGhpcztcclxufSkoKTtcclxuXHJcbnRyeSB7XHJcblx0Ly8gVGhpcyB3b3JrcyBpZiBldmFsIGlzIGFsbG93ZWQgKHNlZSBDU1ApXHJcblx0ZyA9IGcgfHwgRnVuY3Rpb24oXCJyZXR1cm4gdGhpc1wiKSgpIHx8ICgxLGV2YWwpKFwidGhpc1wiKTtcclxufSBjYXRjaChlKSB7XHJcblx0Ly8gVGhpcyB3b3JrcyBpZiB0aGUgd2luZG93IHJlZmVyZW5jZSBpcyBhdmFpbGFibGVcclxuXHRpZih0eXBlb2Ygd2luZG93ID09PSBcIm9iamVjdFwiKVxyXG5cdFx0ZyA9IHdpbmRvdztcclxufVxyXG5cclxuLy8gZyBjYW4gc3RpbGwgYmUgdW5kZWZpbmVkLCBidXQgbm90aGluZyB0byBkbyBhYm91dCBpdC4uLlxyXG4vLyBXZSByZXR1cm4gdW5kZWZpbmVkLCBpbnN0ZWFkIG9mIG5vdGhpbmcgaGVyZSwgc28gaXQnc1xyXG4vLyBlYXNpZXIgdG8gaGFuZGxlIHRoaXMgY2FzZS4gaWYoIWdsb2JhbCkgeyAuLi59XHJcblxyXG5tb2R1bGUuZXhwb3J0cyA9IGc7XHJcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vICh3ZWJwYWNrKS9idWlsZGluL2dsb2JhbC5qc1xuLy8gbW9kdWxlIGlkID0gMTU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///154\n')},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(12) && !__webpack_require__(8)(function () {\n return Object.defineProperty(__webpack_require__(106)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faWU4LWRvbS1kZWZpbmUuanM/YzU5NiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShyZXF1aXJlKCcuL19kb20tY3JlYXRlJykoJ2RpdicpLCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMTU1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///155\n")},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(10);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fd2tzLWV4dC5qcz8zM2M1Il0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX3drcycpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL193a3MtZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAxNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///156\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(27);\nvar toIObject = __webpack_require__(28);\nvar arrayIndexOf = __webpack_require__(84)(false);\nvar IE_PROTO = __webpack_require__(108)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanM/NDVlMSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIGFycmF5SW5kZXhPZiA9IHJlcXVpcmUoJy4vX2FycmF5LWluY2x1ZGVzJykoZmFsc2UpO1xudmFyIElFX1BST1RPID0gcmVxdWlyZSgnLi9fc2hhcmVkLWtleScpKCdJRV9QUk9UTycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvYmplY3QsIG5hbWVzKSB7XG4gIHZhciBPID0gdG9JT2JqZWN0KG9iamVjdCk7XG4gIHZhciBpID0gMDtcbiAgdmFyIHJlc3VsdCA9IFtdO1xuICB2YXIga2V5O1xuICBmb3IgKGtleSBpbiBPKSBpZiAoa2V5ICE9IElFX1BST1RPKSBoYXMoTywga2V5KSAmJiByZXN1bHQucHVzaChrZXkpO1xuICAvLyBEb24ndCBlbnVtIGJ1ZyAmIGhpZGRlbiBrZXlzXG4gIHdoaWxlIChuYW1lcy5sZW5ndGggPiBpKSBpZiAoaGFzKE8sIGtleSA9IG5hbWVzW2krK10pKSB7XG4gICAgfmFycmF5SW5kZXhPZihyZXN1bHQsIGtleSkgfHwgcmVzdWx0LnB1c2goa2V5KTtcbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDE1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///157\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(13);\nvar anObject = __webpack_require__(5);\nvar getKeys = __webpack_require__(54);\n\nmodule.exports = __webpack_require__(12) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qcz9iNzBjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzIDogZnVuY3Rpb24gZGVmaW5lUHJvcGVydGllcyhPLCBQcm9wZXJ0aWVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICB2YXIga2V5cyA9IGdldEtleXMoUHJvcGVydGllcyk7XG4gIHZhciBsZW5ndGggPSBrZXlzLmxlbmd0aDtcbiAgdmFyIGkgPSAwO1xuICB2YXIgUDtcbiAgd2hpbGUgKGxlbmd0aCA+IGkpIGRQLmYoTywgUCA9IGtleXNbaSsrXSwgUHJvcGVydGllc1tQXSk7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gMTU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///158\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(28);\nvar gOPN = __webpack_require__(57).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWdvcG4tZXh0LmpzPzZjNmYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsbGJhY2sgZm9yIElFMTEgYnVnZ3kgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMgd2l0aCBpZnJhbWUgYW5kIHdpbmRvd1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBnT1BOID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4nKS5mO1xudmFyIHRvU3RyaW5nID0ge30udG9TdHJpbmc7XG5cbnZhciB3aW5kb3dOYW1lcyA9IHR5cGVvZiB3aW5kb3cgPT0gJ29iamVjdCcgJiYgd2luZG93ICYmIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzXG4gID8gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMod2luZG93KSA6IFtdO1xuXG52YXIgZ2V0V2luZG93TmFtZXMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgdHJ5IHtcbiAgICByZXR1cm4gZ09QTihpdCk7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICByZXR1cm4gd2luZG93TmFtZXMuc2xpY2UoKTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMuZiA9IGZ1bmN0aW9uIGdldE93blByb3BlcnR5TmFtZXMoaXQpIHtcbiAgcmV0dXJuIHdpbmRvd05hbWVzICYmIHRvU3RyaW5nLmNhbGwoaXQpID09ICdbb2JqZWN0IFdpbmRvd10nID8gZ2V0V2luZG93TmFtZXMoaXQpIDogZ09QTih0b0lPYmplY3QoaXQpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gMTU5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///159\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(54);\nvar gOPS = __webpack_require__(85);\nvar pIE = __webpack_require__(74);\nvar toObject = __webpack_require__(19);\nvar IObject = __webpack_require__(73);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(8)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWFzc2lnbi5qcz9hMTg3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDE5LjEuMi4xIE9iamVjdC5hc3NpZ24odGFyZ2V0LCBzb3VyY2UsIC4uLilcbnZhciBnZXRLZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcbnZhciBnT1BTID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcHMnKTtcbnZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgdG9PYmplY3QgPSByZXF1aXJlKCcuL190by1vYmplY3QnKTtcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyICRhc3NpZ24gPSBPYmplY3QuYXNzaWduO1xuXG4vLyBzaG91bGQgd29yayB3aXRoIHN5bWJvbHMgYW5kIHNob3VsZCBoYXZlIGRldGVybWluaXN0aWMgcHJvcGVydHkgb3JkZXIgKFY4IGJ1Zylcbm1vZHVsZS5leHBvcnRzID0gISRhc3NpZ24gfHwgcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHZhciBBID0ge307XG4gIHZhciBCID0ge307XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby11bmRlZlxuICB2YXIgUyA9IFN5bWJvbCgpO1xuICB2YXIgSyA9ICdhYmNkZWZnaGlqa2xtbm9wcXJzdCc7XG4gIEFbU10gPSA3O1xuICBLLnNwbGl0KCcnKS5mb3JFYWNoKGZ1bmN0aW9uIChrKSB7IEJba10gPSBrOyB9KTtcbiAgcmV0dXJuICRh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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///160\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar aFunction = __webpack_require__(20);\nvar isObject = __webpack_require__(9);\nvar invoke = __webpack_require__(162);\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYmluZC5qcz82NmRjIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBpbnZva2UgPSByZXF1aXJlKCcuL19pbnZva2UnKTtcbnZhciBhcnJheVNsaWNlID0gW10uc2xpY2U7XG52YXIgZmFjd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jb3JlLWpzL21vZHVsZXMvX2JpbmQuanNcbi8vIG1vZHVsZSBpZCA9IDE2MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///161\n")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faW52b2tlLmpzPzNjNzAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFzdCBhcHBseSwgaHR0cDovL2pzcGVyZi5sbmtpdC5jb20vZmFzdC1hcHBseS81XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChmbiwgYXJncywgdGhhdCkge1xuICB2YXIgdW4gPSB0aGF0ID09PSB1bmRlZmluZWQ7XG4gIHN3aXRjaCAoYXJncy5sZW5ndGgpIHtcbiAgICBjYXNl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module,exports,__webpack_require__){eval("var $parseInt = __webpack_require__(7).parseInt;\nvar $trim = __webpack_require__(65).trim;\nvar ws = __webpack_require__(112);\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcGFyc2UtaW50LmpzPzNhMDQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRwYXJzZUludCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLnBhcnNlSW50O1xudmFyICR0cmltID0gcmVxdWlyZSgnLi9fc3RyaW5nLXRyaW0nKS50cmltO1xudmFyIHdzID0gcmVxdWlyZSgnLi9fc3RyaW5nLXdzJyk7XG52YXIgaGV4ID0gL15bLStdPzBbeFhdLztcblxubW9kdWxlLmV4cG9ydHMgPSAkcGFyc2VJbnQod3MgKyAnMDgnKSAhPT0gOCB8fCAkcGFyc2VJbnQod3MgKyAnMHgxNicpICE9PSAyMiA/IGZ1bmN0aW9uIHBhcnNlSW50KHN0ciwgcmFkaXgpIHtcbiAgdmFyIHN0cmluZyA9ICR0cmltKFN0cmluZyhzdHIpLCAzKTtcbiAgcmV0dXJuICRwYXJzZUludChzdHJpbmcsIChyYWRpeCA+Pj4gMCkgfHwgKGhleC50ZXN0KHN0cmluZykgPyAxNiA6IDEwKSk7XG59IDogJHBhcnNlSW50O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wYXJzZS1pbnQuanNcbi8vIG1vZHVsZSBpZCA9IDE2M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///163\n")},function(module,exports,__webpack_require__){eval("var $parseFloat = __webpack_require__(7).parseFloat;\nvar $trim = __webpack_require__(65).trim;\n\nmodule.exports = 1 / $parseFloat(__webpack_require__(112) + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcGFyc2UtZmxvYXQuanM/ZjJkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJHBhcnNlRmxvYXQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5wYXJzZUZsb2F0O1xudmFyICR0cmltID0gcmVxdWlyZSgnLi9fc3RyaW5nLXRyaW0nKS50cmltO1xuXG5tb2R1bGUuZXhwb3J0cyA9IDEgLyAkcGFyc2VGbG9hdChyZXF1aXJlKCcuL19zdHJpbmctd3MnKSArICctMCcpICE9PSAtSW5maW5pdHkgPyBmdW5jdGlvbiBwYXJzZUZsb2F0KHN0cikge1xuICB2YXIgc3RyaW5nID0gJHRyaW0oU3RyaW5nKHN0ciksIDMpO1xuICB2YXIgcmVzdWx0ID0gJHBhcnNlRmxvYXQoc3RyaW5nKTtcbiAgcmV0dXJuIHJlc3VsdCA9PT0gMCAmJiBzdHJpbmcuY2hhckF0KDApID09ICctJyA/IC0wIDogcmVzdWx0O1xufSA6ICRwYXJzZUZsb2F0O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wYXJzZS1mbG9hdC5qc1xuLy8gbW9kdWxlIGlkID0gMTY0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///164\n")},function(module,exports,__webpack_require__){eval("var cof = __webpack_require__(33);\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYS1udW1iZXItdmFsdWUuanM/N2QyZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgbXNnKSB7XG4gIGlmICh0eXBlb2YgaXQgIT0gJ251bWJlcicgJiYgY29mKGl0KSAhPSAnTnVtYmVyJykgdGhyb3cgVHlwZUVycm9yKG1zZyk7XG4gIHJldHVybiAraXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hLW51bWJlci12YWx1ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///165\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(9);\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXMtaW50ZWdlci5qcz85ZmRmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi4zIE51bWJlci5pc0ludGVnZXIobnVtYmVyKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZmxvb3IgPSBNYXRoLmZsb29yO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBpc0ludGVnZXIoaXQpIHtcbiAgcmV0dXJuICFpc09iamVjdChpdCkgJiYgaXNGaW5pdGUoaXQpICYmIGZsb29yKGl0KSA9PT0gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAxNjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///166\n")},function(module,exports){eval("// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1sb2cxcC5qcz80NzNkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4yMCBNYXRoLmxvZzFwKHgpXG5tb2R1bGUuZXhwb3J0cyA9IE1hdGgubG9nMXAgfHwgZnVuY3Rpb24gbG9nMXAoeCkge1xuICByZXR1cm4gKHggPSAreCkgPiAtMWUtOCAmJiB4IDwgMWUtOCA/IHggLSB4ICogeCAvIDIgOiBNYXRoLmxvZygxICsgeCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tYXRoLWxvZzFwLmpzXG4vLyBtb2R1bGUgaWQgPSAxNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///167\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.16 Math.fround(x)\nvar sign = __webpack_require__(115);\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1mcm91bmQuanM/ODNmOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4yLjIuMTYgTWF0aC5mcm91bmQoeClcbnZhciBzaWduID0gcmVxdWlyZSgnLi9fbWF0aC1zaWduJyk7XG52YXIgcG93ID0gTWF0aC5wb3c7XG52YXIgRVBTSUxPTiA9IHBvdygyLCAtNTIpO1xudmFyIEVQU0lMT04zMiA9IHBvdygyLCAtMjMpO1xudmFyIE1BWDMyID0gcG93KDIsIDEyNykgKiAoMiAtIEVQU0lMT04zMik7XG52YXIgTUlOMzIgPSBwb3coMiwgLTEyNik7XG5cbnZhciByb3VuZFRpZXNUb0V2ZW4gPSBmdW5jdGlvbiAobikge1xuICByZXR1cm4gbiArIDEgLyBFUFNJTE9OIC0gMSAvIEVQU0lMT047XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IE1hdGguZnJvdW5kIHx8IGZ1bmN0aW9uIGZyb3VuZCh4KSB7XG4gIHZhciAkYWJzID0gTWF0aC5hYnMoeCk7XG4gIHZhciAkc2lnbiA9IHNpZ24oeCk7XG4gIHZhciBhLCByZXN1bHQ7XG4gIGlmICgkYWJzIDwgTUlOMzIpIHJldHVybiAkc2lnbiAqIHJvdW5kVGllc1RvRXZlbigkYWJzIC8gTUlOMzIgLyBFUFNJTE9OMzIpICogTUlOMzIgKiBFUFNJTE9OMzI7XG4gIGEgPSAoMSArIEVQU0lMT04zMiAvIEVQU0lMT04pICogJGFicztcbiAgcmVzdWx0ID0gYSAtIChhIC0gJGFicyk7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgaWYgKHJlc3VsdCA+IE1BWDMyIHx8IHJlc3VsdCAhPSByZXN1bHQpIHJldHVybiAkc2lnbiAqIEluZmluaXR5O1xuICByZXR1cm4gJHNpZ24gKiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tYXRoLWZyb3VuZC5qc1xuLy8gbW9kdWxlIGlkID0gMTY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///168\n")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(5);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1jYWxsLmpzPzVlZjUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gY2FsbCBzb21ldGhpbmcgb24gaXRlcmF0b3Igc3RlcCB3aXRoIHNhZmUgY2xvc2luZyBvbiBlcnJvclxudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdGVyYXRvciwgZm4sIHZhbHVlLCBlbnRyaWVzKSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGVudHJpZXMgPyBmbihhbk9iamVjdCh2YWx1ZSlbMF0sIHZhbHVlWzFdKSA6IGZuKHZhbHVlKTtcbiAgLy8gNy40LjYgSXRlcmF0b3JDbG9zZShpdGVyYXRvciwgY29tcGxldGlvbilcbiAgfSBjYXRjaCAoZSkge1xuICAgIHZhciByZXQgPSBpdGVyYXRvclsncmV0dXJuJ107XG4gICAgaWYgKHJldCAhPT0gdW5kZWZpbmVkKSBhbk9iamVjdChyZXQuY2FsbChpdGVyYXRvcikpO1xuICAgIHRocm93IGU7XG4gIH1cbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2l0ZXItY2FsbC5qc1xuLy8gbW9kdWxlIGlkID0gMTY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///169\n")},function(module,exports,__webpack_require__){eval("var aFunction = __webpack_require__(20);\nvar toObject = __webpack_require__(19);\nvar IObject = __webpack_require__(73);\nvar toLength = __webpack_require__(14);\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktcmVkdWNlLmpzPzE2NDIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGhhdCwgY2FsbGJhY2tmbiwgYUxlbiwgbWVtbywgaXNSaWdodCkge1xuICBhRnVuY3Rpb24oY2FsbGJhY2tmbik7XG4gIHZhciBPID0gdG9PYmplY3QodGhhdCk7XG4gIHZhciBzZWxmID0gSU9iamVjdChPKTtcbiAgdmFyIGxlbmd0aCA9IHRvTGVuZ3RoKE8ubGVuZ3RoKTtcbiAgdmFyIGluZGV4ID0gaXNSaWdodCA/IGxlbmd0aCAtIDEgOiAwO1xuICB2YXIgaSA9IGlzUmlnaHQgPyAtMSA6IDE7XG4gIGlmIChhTGVuIDwgMikgZm9yICg7Oykge1xuICAgIGlmIChpbmRleCBpbiBzZWxmKSB7XG4gICAgICBtZW1vID0gc2VsZltpbmRleF07XG4gICAgICBpbmRleCArPSBpO1xuICAgICAgYnJlYWs7XG4gICAgfVxuICAgIGluZGV4ICs9IGk7XG4gICAgaWYgKGlzUmlnaHQgPyBpbmRleCA8IDAgOiBsZW5ndGggPD0gaW5kZXgpIHtcbiAgICAgIHRocm93IFR5cGVFcnJvcignUmVkdWNlIG9mIGVtcHR5IGFycmF5IHdpdGggbm8gaW5pdGlhbCB2YWx1ZScpO1xuICAgIH1cbiAgfVxuICBmb3IgKDtpc1JpZ2h0ID8gaW5kZXggPj0gMCA6IGxlbmd0aCA+IGluZGV4OyBpbmRleCArPSBpKSBpZiAoaW5kZXggaW4gc2VsZikge1xuICAgIG1lbW8gPSBjYWxsYmFja2ZuKG1lbW8sIHNlbGZbaW5kZXhdLCBpbmRleCwgTyk7XG4gIH1cbiAgcmV0dXJuIG1lbW87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1yZWR1Y2UuanNcbi8vIG1vZHVsZSBpZCA9IDE3MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///170\n")},function(module,exports,__webpack_require__){"use strict";eval("// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n\nvar toObject = __webpack_require__(19);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktY29weS13aXRoaW4uanM/MGNmYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjMuMyBBcnJheS5wcm90b3R5cGUuY29weVdpdGhpbih0YXJnZXQsIHN0YXJ0LCBlbmQgPSB0aGlzLmxlbmd0aClcbid1c2Ugc3RyaWN0JztcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIHRvQWJzb2x1dGVJbmRleCA9IHJlcXVpcmUoJy4vX3RvLWFic29sdXRlLWluZGV4Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBbXS5jb3B5V2l0aGluIHx8IGZ1bmN0aW9uIGNvcHlXaXRoaW4odGFyZ2V0IC8qID0gMCAqLywgc3RhcnQgLyogPSAwLCBlbmQgPSBAbGVuZ3RoICovKSB7XG4gIHZhciBPID0gdG9PYmplY3QodGhpcyk7XG4gIHZhciBsZW4gPSB0b0xlbmd0aChPLmxlbmd0aCk7XG4gIHZhciB0byA9IHRvQWJzb2x1dGVJbmRleCh0YXJnZXQsIGxlbik7XG4gIHZhciBmcm9tID0gdG9BYnNvbHV0ZUluZGV4KHN0YXJ0LCBsZW4pO1xuICB2YXIgZW5kID0gYXJndW1lbnRzLmxlbmd0aCA+IDIgPyBhcmd1bWVudHNbMl0gOiB1bmRlZmluZWQ7XG4gIHZhciBjb3VudCA9IE1hdGgubWluKChlbmQgPT09IHVuZGVmaW5lZCA/IGxlbiA6IHRvQWJzb2x1dGVJbmRleChlbmQsIGxlbikpIC0gZnJvbSwgbGVuIC0gdG8pO1xuICB2YXIgaW5jID0gMTtcbiAgaWYgKGZyb20gPCB0byAmJiB0byA8IGZyb20gKyBjb3VudCkge1xuICAgIGluYyA9IC0xO1xuICAgIGZyb20gKz0gY291bnQgLSAxO1xuICAgIHRvICs9IGNvdW50IC0gMTtcbiAgfVxuICB3aGlsZSAoY291bnQtLSA+IDApIHtcbiAgICBpZiAoZnJvbSBpbiBPKSBPW3RvXSA9IE9bZnJvbV07XG4gICAgZWxzZSBkZWxldGUgT1t0b107XG4gICAgdG8gKz0gaW5jO1xuICAgIGZyb20gKz0gaW5jO1xuICB9IHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktY29weS13aXRoaW4uanNcbi8vIG1vZHVsZSBpZCA9IDE3MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///171\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1zdGVwLmpzPzI4MWQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZG9uZSwgdmFsdWUpIHtcbiAgcmV0dXJuIHsgdmFsdWU6IHZhbHVlLCBkb25lOiAhIWRvbmUgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2l0ZXItc3RlcC5qc1xuLy8gbW9kdWxlIGlkID0gMTcyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///172\n")},function(module,exports,__webpack_require__){eval("// 21.2.5.3 get RegExp.prototype.flags()\nif (__webpack_require__(12) && /./g.flags != 'g') __webpack_require__(13).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(89)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmZsYWdzLmpzP2E1ZGYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMi41LjMgZ2V0IFJlZ0V4cC5wcm90b3R5cGUuZmxhZ3MoKVxuaWYgKHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgLy4vZy5mbGFncyAhPSAnZycpIHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYoUmVnRXhwLnByb3RvdHlwZSwgJ2ZsYWdzJywge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogcmVxdWlyZSgnLi9fZmxhZ3MnKVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gMTczXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///173\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcGVyZm9ybS5qcz80ODM1Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGV4ZWMpIHtcbiAgdHJ5IHtcbiAgICByZXR1cm4geyBlOiBmYWxzZSwgdjogZXhlYygpIH07XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICByZXR1cm4geyBlOiB0cnVlLCB2OiBlIH07XG4gIH1cbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3BlcmZvcm0uanNcbi8vIG1vZHVsZSBpZCA9IDE3NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///174\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar newPromiseCapability = __webpack_require__(130);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvbWlzZS1yZXNvbHZlLmpzPzllOTgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBuZXdQcm9taXNlQ2FwYWJpbGl0eSA9IHJlcXVpcmUoJy4vX25ldy1wcm9taXNlLWNhcGFiaWxpdHknKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoQywgeCkge1xuICBhbk9iamVjdChDKTtcbiAgaWYgKGlzT2JqZWN0KHgpICYmIHguY29uc3RydWN0b3IgPT09IEMpIHJldHVybiB4O1xuICB2YXIgcHJvbWlzZUNhcGFiaWxpdHkgPSBuZXdQcm9taXNlQ2FwYWJpbGl0eS5mKEMpO1xuICB2YXIgcmVzb2x2ZSA9IHByb21pc2VDYXBhYmlsaXR5LnJlc29sdmU7XG4gIHJlc29sdmUoeCk7XG4gIHJldHVybiBwcm9taXNlQ2FwYWJpbGl0eS5wcm9taXNlO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvbWlzZS1yZXNvbHZlLmpzXG4vLyBtb2R1bGUgaWQgPSAxNzVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///175\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar strong = __webpack_require__(177);\nvar validate = __webpack_require__(67);\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = __webpack_require__(93)(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWFwLmpzPzMyY2IiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIHN0cm9uZyA9IHJlcXVpcmUoJy4vX2NvbGxlY3Rpb24tc3Ryb25nJyk7XG52YXIgdmFsaWRhdGUgPSByZXF1aXJlKCcuL192YWxpZGF0ZS1jb2xsZWN0aW9uJyk7XG52YXIgTUFQID0gJ01hcCc7XG5cbi8v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ack-internal:///176\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar dP = __webpack_require__(13).f;\nvar create = __webpack_require__(56);\nvar redefineAll = __webpack_require__(61);\nvar ctx = __webpack_require__(32);\nvar anInstance = __webpack_require__(59);\nvar forOf = __webpack_require__(60);\nvar $iterDefine = __webpack_require__(118);\nvar step = __webpack_require__(172);\nvar setSpecies = __webpack_require__(58);\nvar DESCRIPTORS = __webpack_require__(12);\nvar fastKey = __webpack_require__(47).fastKey;\nvar validate = __webpack_require__(67);\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi1zdHJvbmcuanM/MGUwOCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIGFuSW5zdGFuY2UgPSByZXF1aXJlKCcuL19hbi1pbnN0YW5jZScpO1xudmFyIGZvck9mID0gcmVxdWlyZSgnLi9fZm9yLW9mJyk7XG52YXIgJGl0ZXJEZWZpbmUgPSByZXF1aXJlKCcuL19pdGVyLWRlZmluZScpO1xudmFyIHN0ZXAgPSByZXF1aXJlKCcuL19pdGVyLXN0ZXAnKTtcbnZhciBzZXRTcGVjaWVzID0gcmVxdWlyZSgnLi9fc2V0LXNwZWNpZXMnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgZmFzdEtleSA9IHJlcXVpcmUoJy4vX21ldGEnKS5mYXN0S2V5O1xudmFyIHZhbGlkYXRlID0gcmVxdWlyZSgnLi9fdmFsaWRhdGUtY29sbGVjdGlvbicpO1xudmFyIFNJWkUgPSBERVNDUklQVE9SUyA/ICdfcycgOiAnc2l6ZSc7XG5cbnZhciBnZXRFbnRyeSA9IGZ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AgIHJldHVybiAhIWdldEVudHJ5KHZhbGlkYXRlKHRoaXMsIE5BTUUpLCBrZXkpO1xuICAgICAgfVxuICAgIH0pO1xuICAgIGlmIChERVNDUklQVE9SUykgZFAoQy5wcm90b3R5cGUsICdzaXplJywge1xuICAgICAgZ2V0OiBmdW5jdGlvbiAoKSB7XG4gICAgICAgIHJldHVybiB2YWxpZGF0ZSh0aGlzLCBOQU1FKVtTSVpFXTtcbiAgICAgIH1cbiAgICB9KTtcbiAgICByZXR1cm4gQztcbiAgfSxcbiAgZGVmOiBmdW5jdGlvbiAodGhhdCwga2V5LCB2YWx1ZSkge1xuICAgIHZhciBlbnRyeSA9IGdldEVudHJ5KHRoYXQsIGtleSk7XG4gICAgdmFyIHByZXYsIGluZGV4O1xuICAgIC8vIGNoYW5nZSBleGlzdGluZyBlbnRyeVxuICAgIGlmIChlbnRyeSkge1xuICAgICAgZW50cnkudiA9IHZhbHVlO1xuICAgIC8vIGNyZWF0ZSBuZXcgZW50cnlcbiAgICB9IGVsc2Uge1xuICAgICAgdGhhdC5fbCA9IGVudHJ5ID0ge1xuICAgICAgICBpOiBpbmRleCA9IGZhc3RLZXkoa2V5LCB0cnVlKSwgLy8gPC0gaW5kZXhcbiAgICAgICAgazoga2V5LCAgICAgICAgICAgICAgICAgICAgICAgIC8vIDwtIGtleVxuICAgICAgICB2OiB2YWx1ZSwgICAgICAgICAgICAgICAgICAgICAgLy8gPC0gdmFsdWVcbiAgICAgICAgcDogcHJldiA9IHRoYXQuX2wsICAgICAgICAgICAgIC8vIDwtIHByZXZpb3VzIGVudHJ5XG4gICAgICAgIG46IHVuZGVmaW5lZCwgICAgICAgICAgICAgICAgICAvLyA8LSBuZXh0IGVudHJ5XG4gICAgICAgIHI6IGZhbHNlICAgICAgICAgICAgICAgICAgICAgICAvLyA8LSByZW1vdmVkXG4gICAgICB9O1xuICAgICAgaWYgKCF0aGF0Ll9mKSB0aGF0Ll9mID0gZW50cnk7XG4gICAgICBpZiAocHJldikgc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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///177\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar strong = __webpack_require__(177);\nvar validate = __webpack_require__(67);\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = __webpack_require__(93)(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n//# sourceUR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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///178\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar each = __webpack_require__(40)(0);\nvar redefine = __webpack_require__(24);\nvar meta = __webpack_require__(47);\nvar assign = __webpack_require__(160);\nvar weak = __webpack_require__(180);\nvar isObject = __webpack_require__(9);\nvar fails = __webpack_require__(8);\nvar validate = __webpack_require__(67);\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = __webpack_require__(93)(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYud2Vhay1tYXAuanM/NjQzNSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgZWFjaCA9IHJlcXVpcmUoJy4vX2FycmF5LW1ldGhvZHMnKSgwKTtcbnZhciByZWRlZmluZSA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lJyk7XG52YXIgbWV0YSA9IHJlcXVpcmUoJy4vX21ldGEnKTtcbnZhciBhc3NpZ24gPSByZXF1aXJlKCcuL19vYmplY3QtYXNzaWduJyk7XG52YXIgd2VhayA9IHJlcXVpcmUoJy4vX2NvbGxlY3Rpb24td2VhaycpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIHZhbGlkYXRlID0gcmVxdWlyZSgnLi9fdmFsaWRhdGUtY29sbGVjdGlvbicpO1xudmFyIFdFQUtfTUFQID0gJ1dlYWtNYXAnO1xudmFyIGdldFdlYWsgPSBtZXRhLmdldFdlYWs7XG52YXIgaXNFeHRlbnNpYmxlID0gT2JqZWN0LmlzRXh0ZW5zaWJsZTtcbnZhciB1bmNhdWdodEZyb3plblN0b3JlID0gd2Vhay51ZnN0b3JlO1xudmFyIHRtcCA9IHt9O1xudmFyIEludGVybmFsTWFwO1xuXG52YXIgd3JhcHBlciA9IGZ1bmN0aW9uIChnZXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFdlYWtNYXAoKSB7XG4gICAgcmV0dXJuIGdldCh0aGlzLCBhcmd1bWVudHMubGVuZ3RoID4gMC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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///179\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar redefineAll = __webpack_require__(61);\nvar getWeak = __webpack_require__(47).getWeak;\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar anInstance = __webpack_require__(59);\nvar forOf = __webpack_require__(60);\nvar createArrayMethod = __webpack_require__(40);\nvar $has = __webpack_require__(27);\nvar validate = __webpack_require__(67);\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi13ZWFrLmpzPzdjOTQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIHJlZGVmaW5lQWxsID0gcmVxdWlyZSgnLi9fcmVkZWZpbmUtYWxsJyk7XG52YXIgZ2V0V2VhayA9IHJlcXVpcmUoJy4vX21ldGEnKS5nZXRXZWFrO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///180\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = __webpack_require__(38);\nvar toLength = __webpack_require__(14);\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8taW5kZXguanM/ZjAzZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL2VjbWEyNjIvI3NlYy10b2luZGV4XG52YXIgdG9JbnRlZ2VyID0gcmVxdWlyZSgnLi9fdG8taW50ZWdlcicpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoaXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIDA7XG4gIHZhciBudW1iZXIgPSB0b0ludGVnZXIoaXQpO1xuICB2YXIgbGVuZ3RoID0gdG9MZW5ndGgobnVtYmVyKTtcbiAgaWYgKG51bWJlciAhPT0gbGVuZ3RoKSB0aHJvdyBSYW5nZUVycm9yKCdXcm9uZyBsZW5ndGghJyk7XG4gIHJldHVybiBsZW5ndGg7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gMTgxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///181\n")},function(module,exports,__webpack_require__){eval("// all object keys, includes non-enumerable and symbols\nvar gOPN = __webpack_require__(57);\nvar gOPS = __webpack_require__(85);\nvar anObject = __webpack_require__(5);\nvar Reflect = __webpack_require__(7).Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb3duLWtleXMuanM/NjE0YSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBhbGwgb2JqZWN0IGtleXMsIGluY2x1ZGVzIG5vbi1lbnVtZXJhYmxlIGFuZCBzeW1ib2xzXG52YXIgZ09QTiA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BuJyk7XG52YXIgZ09QUyA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BzJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBSZWZsZWN0ID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuUmVmbGVjdDtcbm1vZHVsZS5leHBvcnRzID0gUmVmbGVjdCAmJiBSZWZsZWN0Lm93bktleXMgfHwgZnVuY3Rpb24gb3duS2V5cyhpdCkge1xuICB2YXIga2V5cyA9IGdPUE4uZihhbk9iamVjdChpdCkpO1xuICB2YXIgZ2V0U3ltYm9scyA9IGdPUFMuZjtcbiAgcmV0dXJuIGdldFN5bWJvbHMgPyBrZXlzLmNvbmNhdChnZXRTeW1ib2xzKGl0KSkgOiBrZXlzO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb3duLWtleXMuanNcbi8vIG1vZHVsZSBpZCA9IDE4MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///182\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = __webpack_require__(86);\nvar isObject = __webpack_require__(9);\nvar toLength = __webpack_require__(14);\nvar ctx = __webpack_require__(32);\nvar IS_CONCAT_SPREADABLE = __webpack_require__(10)('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZmxhdHRlbi1pbnRvLWFycmF5LmpzPzIwNWEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1mbGF0TWFwLyNzZWMtRmxhdHRlbkludG9BcnJheVxudmFyIGlzQXJyYXkgPSByZXF1aXJlKCcuL19pcy1hcnJheScpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBJU19DT05DQVRfU1BSRUFEQUJMRSA9IHJlcXVpcmUoJy4vX3drcycpKCdpc0NvbmNhdFNwcmVhZGFibGUnKTtcblxuZnVuY3Rpb24gZmxhdHRlbkludG9BcnJheSh0YXJnZXQsIG9yaWdpbmFsLCBzb3VyY2UsIHNvdXJjZUxlbiwgc3RhcnQsIGRlcHRoLCBtYXBwZXIsIHRoaXNBcmcpIHtcbiAgdmFyIHRhcmdldEluZGV4ID0gc3RhcnQ7XG4gIHZhciBzb3VyY2VJbmRleCA9IDA7XG4gIHZhciBtYXBGbiA9IG1hcHBlciA/IGN0eChtYXBwZXIsIHRoaXNBcmcsIDMpIDogZmFsc2U7XG4gIHZhciBlbGVtZW50LCBzcHJlYWRhYmxlO1xuXG4gIHdoaWxlIChzb3VyY2VJbmRleCA8IHNvdXJjZUxlbikge1xuICAgIGlmIChzb3VyY2VJbmRleCBpbiBzb3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50by1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMTgzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///183\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = __webpack_require__(14);\nvar repeat = __webpack_require__(114);\nvar defined = __webpack_require__(37);\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringFiller;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXBhZC5qcz9kOTU0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLXN0cmluZy1wYWQtc3RhcnQtZW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bi8vIG1vZHVsZSBpZCA9IDE4NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///184\n")},function(module,exports,__webpack_require__){eval("var getKeys = __webpack_require__(54);\nvar toIObject = __webpack_require__(28);\nvar isEnum = __webpack_require__(74).f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LXRvLWFycmF5LmpzPzk0YTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBpc0VudW0gPSByZXF1aXJlKCcuL19vYmplY3QtcGllJykuZjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGlzRW50cmllcykge1xuICByZXR1cm4gZnVuY3Rpb24gKGl0KSB7XG4gICAgdmFyIE8gPSB0b0lPYmplY3QoaXQpO1xuICAgIHZhciBrZXlzID0gZ2V0S2V5cyhPKTtcbiAgICB2YXIgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG4gICAgdmFyIGkgPSAwO1xuICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICB2YXIga2V5O1xuICAgIHdoaWxlIChsZW5ndGggPiBpKSBpZiAoaXNFbnVtLmNhbGwoTywga2V5ID0ga2V5c1tpKytdKSkge1xuICAgICAgcmVzdWx0LnB1c2goaXNFbnRyaWVzID8gW2tleSwgT1trZXldXSA6IE9ba2V5XSk7XG4gICAgfSByZXR1cm4gcmVzdWx0O1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LXRvLWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSAxODVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///185\n")},function(module,exports,__webpack_require__){eval('// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = __webpack_require__(75);\nvar from = __webpack_require__(187);\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn\'t generic");\n return from(this);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi10by1qc29uLmpzPzVkNzAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL0RhdmlkQnJ1YW50L01hcC1TZXQucHJvdG90eXBlLnRvSlNPTlxudmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgZnJvbSA9IHJlcXVpcmUoJy4vX2FycmF5LWZyb20taXRlcmFibGUnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKE5BTUUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIHRvSlNPTigpIHtcbiAgICBpZiAoY2xhc3NvZih0aGlzKSAhPSBOQU1FKSB0aHJvdyBUeXBlRXJyb3IoTkFNRSArIFwiI3RvSlNPTiBpc24ndCBnZW5lcmljXCIpO1xuICAgIHJldHVybiBmcm9tKHRoaXMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi10by1qc29uLmpzXG4vLyBtb2R1bGUgaWQgPSAxODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///186\n')},function(module,exports,__webpack_require__){eval("var forOf = __webpack_require__(60);\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktZnJvbS1pdGVyYWJsZS5qcz80MDZlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBmb3JPZiA9IHJlcXVpcmUoJy4vX2Zvci1vZicpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdGVyLCBJVEVSQVRPUikge1xuICB2YXIgcmVzdWx0ID0gW107XG4gIGZvck9mKGl0ZXIsIGZhbHNlLCByZXN1bHQucHVzaCwgcmVzdWx0LCBJVEVSQVRPUik7XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1mcm9tLWl0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSAxODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///187\n")},function(module,exports){eval("// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zY2FsZS5qcz81OThmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1h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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///188\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(62);\nvar toIObject = __webpack_require__(50);\nvar arrayIndexOf = __webpack_require__(428)(false);\nvar IE_PROTO = __webpack_require__(135)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy1pbnRlcm5hbC5qcz8yMWI4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgYXJyYXlJbmRleE9mID0gcmVxdWlyZSgnLi9fYXJyYXktaW5jbHVkZXMnKShmYWxzZSk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG9iamVjdCwgbmFtZXMpIHtcbiAgdmFyIE8gPSB0b0lPYmplY3Qob2JqZWN0KTtcbiAgdmFyIGkgPSAwO1xuICB2YXIgcmVzdWx0ID0gW107XG4gIHZhciBrZXk7XG4gIGZvciAoa2V5IGluIE8pIGlmIChrZXkgIT0gSUVfUFJPVE8pIGhhcyhPLCBrZXkpICYmIHJlc3VsdC5wdXNoKGtleSk7XG4gIC8vIERvbid0IGVudW0gYnVnICYgaGlkZGVuIGtleXNcbiAgd2hpbGUgKG5hbWVzLmxlbmd0aCA+IGkpIGlmIChoYXMoTywga2V5ID0gbmFtZXNbaSsrXSkpIHtcbiAgICB+YXJyYXlJbmRleE9mKHJlc3VsdCwga2V5KSB8fCByZXN1bHQucHVzaChrZXkpO1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzXG4vLyBtb2R1bGUgaWQgPSAxODlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///189\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(77);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pb2JqZWN0LmpzPzMxNGUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsbGJhY2sgZm9yIG5vbi1hcnJheS1saWtlIEVTMyBhbmQgbm9uLWVudW1lcmFibGUgb2xkIFY4IHN0cmluZ3NcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wcm90b3R5cGUtYnVpbHRpbnNcbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0KCd6JykucHJvcGVydHlJc0VudW1lcmFibGUoMCkgPyBPYmplY3QgOiBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGNvZihpdCkgPT0gJ1N0cmluZycgPyBpdC5zcGxpdCgnJykgOiBPYmplY3QoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSAxOTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///190\n")},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(51) && !__webpack_require__(70)(function () {\n return Object.defineProperty(__webpack_require__(139)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qcz80OWYwIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHJlcXVpcmUoJy4vX2RvbS1jcmVhdGUnKSgnZGl2JyksICdhJywgeyBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIDc7IH0gfSkuYSAhPSA3O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faWU4LWRvbS1kZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDE5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///191\n")},function(module,exports){eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkyLmpzIiwic291cmNlcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///192\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(78);\nvar $export = __webpack_require__(26);\nvar redefine = __webpack_require__(194);\nvar hide = __webpack_require__(63);\nvar Iterators = __webpack_require__(71);\nvar $iterCreate = __webpack_require__(432);\nvar setToStringTag = __webpack_require__(100);\nvar getPrototypeOf = __webpack_require__(196);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJ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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///193\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(63);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19yZWRlZmluZS5qcz9mM2NkIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9faGlkZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLmpzXG4vLyBtb2R1bGUgaWQgPSAxOTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///194\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(21).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19odG1sLmpzPzQ0ZjIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRvY3VtZW50ID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuZG9jdW1lbnQ7XG5tb2R1bGUuZXhwb3J0cyA9IGRvY3VtZW50ICYmIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudDtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19odG1sLmpzXG4vLyBtb2R1bGUgaWQgPSAxOTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///195\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(62);\nvar toObject = __webpack_require__(76);\nvar IE_PROTO = __webpack_require__(135)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ3BvLmpzPzNmM2MiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjkgLyAxNS4yLjMuMiBPYmplY3QuZ2V0UHJvdG90eXBlT2YoTylcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElFX1BST1RPID0gcmVxdWlyZSgnLi9fc2hhcmVkLWtleScpKCdJRV9QUk9UTycpO1xudmFyIE9iamVjdFByb3RvID0gT2JqZWN0LnByb3RvdHlwZTtcblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuZ2V0UHJvdG90eXBlT2YgfHwgZnVuY3Rpb24gKE8pIHtcbiAgTyA9IHRvT2JqZWN0KE8pO1xuICBpZiAoaGFzKE8sIElFX1BST1RPKSkgcmV0dXJuIE9bSUVfUFJPVE9dO1xuICBpZiAodHlwZW9mIE8uY29uc3RydWN0b3IgPT0gJ2Z1bmN0aW9uJyAmJiBPIGluc3RhbmNlb2YgTy5jb25zdHJ1Y3Rvcikge1xuICAgIHJldHVybiBPLmNvbnN0cnVjdG9yLnByb3RvdHlwZTtcbiAgfSByZXR1cm4gTyBpbnN0YW5jZW9mIE9iamVjdCA/IE9iamVjdFByb3RvIDogbnVsbDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdwby5qc1xuLy8gbW9kdWxlIGlkID0gMTk2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///196\n")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(41);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWNhbGwuanM/OWFjNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBjYWxsIHNvbWV0aGluZyBvbiBpdGVyYXRvciBzdGVwIHdpdGggc2FmZSBjbG9zaW5nIG9uIGVycm9yXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0ZXJhdG9yLCBmbiwgdmFsdWUsIGVudHJpZXMpIHtcbiAgdHJ5IHtcbiAgICByZXR1cm4gZW50cmllcyA/IGZuKGFuT2JqZWN0KHZhbHVlKVswXSwgdmFsdWVbMV0pIDogZm4odmFsdWUpO1xuICAvLyA3LjQuNiBJdGVyYXRvckNsb3NlKGl0ZXJhdG9yLCBjb21wbGV0aW9uKVxuICB9IGNhdGNoIChlKSB7XG4gICAgdmFyIHJldCA9IGl0ZXJhdG9yWydyZXR1cm4nXTtcbiAgICBpZiAocmV0ICE9PSB1bmRlZmluZWQpIGFuT2JqZWN0KHJldC5jYWxsKGl0ZXJhdG9yKSk7XG4gICAgdGhyb3cgZTtcbiAgfVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWNhbGwuanNcbi8vIG1vZHVsZSBpZCA9IDE5N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///197\n")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(71);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1hcnJheS1pdGVyLmpzPzMyMWMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gY2hlY2sgb24gZGVmYXVsdCBBcnJheSBpdGVyYXRvclxudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xudmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgQXJyYXlQcm90byA9IEFycmF5LnByb3RvdHlwZTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGl0ICE9PSB1bmRlZmluZWQgJiYgKEl0ZXJhdG9ycy5BcnJheSA9PT0gaXQgfHwgQXJyYXlQcm90b1tJVEVSQVRPUl0gPT09IGl0KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtYXJyYXktaXRlci5qc1xuLy8gbW9kdWxlIGlkID0gMTk4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///198\n")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(41);\nvar aFunction = __webpack_require__(99);\nvar SPECIES = __webpack_require__(22)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zcGVjaWVzLWNvbnN0cnVjdG9yLmpzP2I3Y2MiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4zLjIwIFNwZWNpZXNDb25zdHJ1Y3RvcihPLCBkZWZhdWx0Q29uc3RydWN0b3IpXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgU1BFQ0lFUyA9IHJlcXVpcmUoJy4vX3drcycpKCdzcGVjaWVzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChPLCBEKSB7XG4gIHZhciBDID0gYW5PYmplY3QoTykuY29uc3RydWN0b3I7XG4gIHZhciBTO1xuICByZXR1cm4gQyA9PT0gdW5kZWZpbmVkIHx8IChTID0gYW5PYmplY3QoQylbU1BFQ0lFU10pID09IHVuZGVmaW5lZCA/IEQgOiBhRnVuY3Rpb24oUyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NwZWNpZXMtY29uc3RydWN0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDE5OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///199\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(69);\nvar invoke = __webpack_require__(440);\nvar html = __webpack_require__(195);\nvar cel = __webpack_require__(139);\nvar global = __webpack_require__(21);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(77)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190YXNrLmpzPzJmOGQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIGludm9rZSA9IHJlcXVpcmUoJy4vX2ludm9rZScpO1xudmFyIGh0bWwgPSByZXF1aXJlKCcuL19odG1sJyk7XG52YXIgY2VsID0gcmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIHByb2Nlc3MgPSBnbG9iYWwucHJvY2VzcztcbnZhciBzZXRUYXNrID0gZ2xvYmFsLnNldEltbWVkaWF0ZTtcbnZhciBjbGVhclRhc2sgPSBnbG9iYW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pZCA9IDIwMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///200\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19wZXJmb3JtLmpzPzc0ZDAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiB7IGU6IGZhbHNlLCB2OiBleGVjKCkgfTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB7IGU6IHRydWUsIHY6IGUgfTtcbiAgfVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19wZXJmb3JtLmpzXG4vLyBtb2R1bGUgaWQgPSAyMDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///201\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(41);\nvar isObject = __webpack_require__(45);\nvar newPromiseCapability = __webpack_require__(144);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19wcm9taXNlLXJlc29sdmUuanM/N2M5NSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG5ld1Byb21pc2VDYXBhYmlsaXR5ID0gcmVxdWlyZSgnLi9fbmV3LXByb21pc2UtY2FwYWJpbGl0eScpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChDLCB4KSB7XG4gIGFuT2JqZWN0KEMpO1xuICBpZiAoaXNPYmplY3QoeCkgJiYgeC5jb25zdHJ1Y3RvciA9PT0gQykgcmV0dXJuIHg7XG4gIHZhciBwcm9taXNlQ2FwYWJpbGl0eSA9IG5ld1Byb21pc2VDYXBhYmlsaXR5LmYoQyk7XG4gIHZhciByZXNvbHZlID0gcHJvbWlzZUNhcGFiaWxpdHkucmVzb2x2ZTtcbiAgcmVzb2x2ZSh4KTtcbiAgcmV0dXJuIHByb21pc2VDYXBhYmlsaXR5LnByb21pc2U7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb21pc2UtcmVzb2x2ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///202\n")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(22)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ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vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlci1kZXRlY3QuanNcbi8vIG1vZHVsZSBpZCA9IDIwM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///203\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(450), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzPzBiODMiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHlcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2RlZmluZS1wcm9wZXJ0eS5qc1xuLy8gbW9kdWxlIGlkID0gMjA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///204\n')},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(189);\nvar hiddenKeys = __webpack_require__(137).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi5qcz85ZjQ0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi43IC8gMTUuMi4zLjQgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMoTylcbnZhciAka2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzLWludGVybmFsJyk7XG52YXIgaGlkZGVuS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKS5jb25jYXQoJ2xlbmd0aCcsICdwcm90b3R5cGUnKTtcblxuZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMgfHwgZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlOYW1lcyhPKSB7XG4gIHJldHVybiAka2V5cyhPLCBoaWRkZW5LZXlzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcG4uanNcbi8vIG1vZHVsZSBpZCA9IDIwNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///205\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ProxyObject = __webpack_require__(207);\n\nvar _ProxyObject2 = _interopRequireDefault(_ProxyObject);\n\nvar _DataObjectChild = __webpack_require__(208);\n\nvar _DataObjectChild2 = _interopRequireDefault(_DataObjectChild);\n\nvar _HeartBeat = __webpack_require__(483);\n\nvar _HeartBeat2 = _interopRequireDefault(_HeartBeat);\n\nvar _utils = __webpack_require__(6);\n\nvar _HypertyResourceFactory = __webpack_require__(484);\n\nvar _HypertyResourceFactory2 = _interopRequireDefault(_HypertyResourceFactory);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObject'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n * Main extension class for observers and reporters, with common properties and methods.\n * Children management is common for observers and reporters.\n */\nvar DataObject = function () {\n /* private\n _version: number\n _owner: HypertyURL\n _url: ObjectURL\n _schema: Schema\n _bus: MiniBus\n _status: on | paused\n _syncObj: SyncData\n _children: { id: DataObjectChild }\n _childrenListener: [MsgListener]\n ----event handlers----\n _onAddChildHandler: (event) => void\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the Syncher create or subscribe method's\n */\n\n function DataObject(input) {\n (0, _classCallCheck3.default)(this, DataObject);\n\n var _this = this;\n\n function throwMandatoryParmMissingError(par) {\n throw '[DataObject] ' + par + ' mandatory parameter is missing';\n }\n\n input.syncher ? _this._syncher = input.syncher : throwMandatoryParmMissingError('syncher');\n input.url ? _this._url = input.url : throwMandatoryParmMissingError('url');\n input.created ? _this._created = input.created : throwMandatoryParmMissingError('created');\n input.reporter ? _this._reporter = input.reporter : throwMandatoryParmMissingError('reporter');\n input.runtime ? _this._runtime = input.runtime : throwMandatoryParmMissingError('runtime');\n input.schema ? _this._schema = input.schema : throwMandatoryParmMissingError('schema');\n input.name ? _this._name = input.name : throwMandatoryParmMissingError('name');\n\n _this._status = input.status;\n\n if (input.data) {\n _this._syncObj = new _ProxyObject2.default(input.data);\n } else {\n _this._syncObj = new _ProxyObject2.default({});\n }\n _this._childrens = input.childrens;\n\n //TODO: For Further Study\n _this._mutual = input.mutual;\n\n _this._version = 0;\n _this._childId = 1;\n _this._childrenListener; //bus listener for children\n _this._onAddChildrenHandler; //Hyperty side handlers to process child objects created by remote Hyperties\n\n _this._resumed = input.resume;\n\n if (input.resume) {\n _this._version = input.version;\n }\n\n _this._owner = input.syncher._owner;\n _this._bus = input.syncher._bus;\n\n if (input.description) _this._description = input.description;\n if (input.tags) _this._tags = input.tags;\n if (input.resources) _this._resources = input.resources;\n if (input.observerStorage) _this._observerStorage = input.observerStorage;\n if (input.publicObservation) _this._publicObservation = input.publicObservation;\n\n _this._metadata = (0, _assign2.default)(input);\n\n if (!input.hasOwnProperty('resume') || input.hasOwnProperty('resume') && !input.resume) {\n _this._metadata.lastModified = _this._metadata.created;\n }\n\n delete _this._metadata.data;\n delete _this._metadata.syncher;\n delete _this._metadata.authorise;\n\n _this._hypertyResourceFactory = new _HypertyResourceFactory2.default();\n _this._childrenObjects = {};\n _this._sharedChilds = []; //childObjects that were not sent yet to Reporters\n\n if (input.backup && _this._childrens) {\n var lastHeartbeat = input.hasOwnProperty('childrenObjects') && input.childrenObjects.hasOwnProperty('heartbeat') ? input.childrenObjects.heartbeat : 0;\n _this._heartBeat = new _HeartBeat2.default(_this._bus, _this._owner, _this._syncher._runtimeUrl, this, 15, lastHeartbeat);\n if (!_this._resumed) _this._heartBeat.start(lastHeartbeat);\n }\n }\n\n (0, _createClass3.default)(DataObject, [{\n key: '_getLastChildId',\n value: function _getLastChildId() {\n var _this = this;\n\n var childIdInt = 0;\n var childIdString = _this._owner + '#' + childIdInt;\n\n (0, _keys2.default)(_this._childrens).filter(function (key) {\n if (_this._childrens[key].childId > childIdString) {\n childIdString = _this._childrens[key].childId;\n }\n });\n\n return childIdInt = Number(childIdString.split('#')[1]);\n }\n }, {\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this2 = this;\n\n var _this = this;\n\n var childBaseURL = _this._url + '/children/';\n log.log('[Data Object - AllocateListeners] - ', _this._childrens);\n if (_this._childrens) {\n // _this._childrens.forEach((child) => {\n var childURL = childBaseURL;\n var listener = _this._bus.addListener(childURL, function (msg) {\n //ignore msg sent by himself\n if (msg.from !== _this2._owner) {\n log.log('DataObject-Children-RCV: ', msg);\n switch (msg.type) {\n case 'create':\n _this._onChildCreate(msg);break;\n case 'delete':\n log.log(msg);break;\n default:\n _this._changeChildren(msg);break;\n }\n }\n // });\n\n _this._childrenListener = listener;\n });\n }\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n if (_this._childrenListener) {\n _this._childrenListener.remove();\n\n (0, _keys2.default)(_this._childrenObjects).forEach(function (child) {\n /* if (children === 'resources') {\n Object.keys(_this._childrenObjects[children]).forEach((child) => {\n _this._childrenObjects[children][child]._releaseListeners();\n });\n } else {*/\n _this._childrenObjects[child]._releaseListeners();\n // }\n });\n }\n }\n\n /**\n * Sync Data Object Observer with last version of Data Object Reporter. Useful for Resumes\n */\n\n }, {\n key: 'sync',\n value: function sync() {\n var _this3 = this;\n\n var _this = this;\n log.info('[DataObject.sync] synchronising ');\n\n return new _promise2.default(function (resolve, reject) {\n\n var criteria = {};\n\n if (_this3.metadata.backupRevision) criteria.backupRevision = _this3.metadata.backupRevision;\n\n _this._syncher.read(_this._metadata.url, criteria).then(function (value) {\n log.info('[DataObject.sync] value to sync: ', value);\n\n (0, _assign2.default)(_this.data, (0, _utils.deepClone)(value.data));\n\n _this._version = value.version;\n\n _this._metadata.lastModified = value.lastModified;\n\n //TODO: check first if there are new childrenObjects to avoid overhead\n\n if (value.childrenObjects) {\n _this.resumeChildrens(value.childrenObjects);\n _this._storeChildrens();\n resolve(true);\n } else resolve(true);\n\n /*if (value.version != _this._version) {\n log.info('[DataObject.sync] updating existing data: ', _this.data);\n Object.assign(_this.data || {}, deepClone(value.data));\n _this._metadata = deepClone(value);\n delete _this._metadata.data;\n _this._version = value.version;\n } else {\n log.info('[DataObject.sync] existing data is updated: ', value);\n }*/\n }).catch(function (reason) {\n log.info('[DataObject.sync] sync failed: ', reason);\n resolve(false);\n });\n });\n }\n /**\n *\n */\n\n }, {\n key: 'resumeChildrens',\n value: function resumeChildrens(childrens) {\n var _this4 = this;\n\n var _this = this;\n\n var childIdString = this._owner.split('/')[3] + '#' + this._childId;\n\n //setup childrens data from subscription\n // Object.keys(childrens).forEach((childrenResource) => {\n // let children = childrens[childrenResource];\n var children = childrens;\n\n //_this._childrenObjects[childrenResource] = {};\n (0, _keys2.default)(children).forEach(function (childId) {\n var newChild = false;\n\n /* if (!_this._childrenObjects.hasOwnProperty(childrenResource))\n _this._childrenObjects[childrenResource] = {};*/\n\n // check if it is the last heartbeat\n\n if (childId === 'heartbeat') {\n // _this._heartBeat.onNewHeartbeat(children[childId].value);\n _this._heartBeat.start(children[childId]);\n } else if (children[childId].value.resourceType && !_this._childrenObjects.hasOwnProperty(childId)) {\n _this._childrenObjects[childId] = _this._resumeHypertyResource(children[childId]);\n newChild = true;\n } else if (!_this._childrenObjects.hasOwnProperty(childId)) {\n\n _this._childrenObjects[childId] = _this._resumeChild(children[childId]);\n log.log('[DataObject.resumeChildrens] new DataObjectChild: ', _this._childrenObjects[childId]);\n newChild = true;\n }\n\n if (newChild && childId > childIdString) {\n childIdString = childId;\n log.log('[DataObjectReporter.resumeChildrens] - resuming: ', _this4._childrenObjects[childId]);\n }\n });\n // });\n\n this._childId = Number(childIdString.split('#')[1]);\n }\n }, {\n key: '_resumeChild',\n value: function _resumeChild(input) {\n var _this = this;\n var childInput = input.value;\n childInput.parentObject = _this;\n childInput.parent = _this._url;\n\n var child = new _DataObjectChild2.default(childInput);\n\n child.identity = input.identity;\n\n var event = {\n type: 'create',\n from: child.reporter,\n url: child.parent,\n value: child.data,\n childId: child.url,\n identity: child.identity,\n child: child\n };\n\n if (child.resourceType) {\n event.resource = child;\n }\n\n if (_this._onAddChildrenHandler) _this._onAddChildrenHandler(event);\n\n return child;\n }\n }, {\n key: '_resumeHypertyResource',\n value: function _resumeHypertyResource(input) {\n var _this = this;\n var childInput = input.value;\n childInput.parentObject = _this;\n childInput.parent = _this._url;\n\n var hypertyResource = _this._hypertyResourceFactory.createHypertyResource(false, childInput.resourceType, childInput);\n\n hypertyResource.identity = input.identity;\n\n var event = {\n type: 'create',\n from: hypertyResource.reporter,\n url: hypertyResource.parent,\n value: hypertyResource.data,\n childId: hypertyResource.url,\n identity: hypertyResource.identity,\n child: hypertyResource\n };\n\n if (hypertyResource.resourceType) {\n event.resource = hypertyResource;\n }\n\n if (_this._onAddChildrenHandler) _this._onAddChildrenHandler(event);\n\n return hypertyResource;\n }\n\n /**\n * All Metadata about the Data Object\n * @type {Object} -\n */\n\n }, {\n key: 'pause',\n\n\n /**\n * @ignore\n */\n value: function pause() {\n //TODO: this feature needs more analise\n throw 'Not implemented';\n }\n\n /**\n * @ignore\n */\n\n }, {\n key: 'resume',\n value: function resume() {\n //TODO: this feature needs more analise\n throw 'Not implemented';\n }\n\n /**\n * @ignore\n */\n\n }, {\n key: 'stop',\n value: function stop() {\n //TODO: should remove the subscription and send message unsubscribe?\n throw 'Not implemented';\n }\n\n /**\n * Create and add a DataObjectChild to a children collection.\n * @param {JSON} initialData - Initial data of the child\n * @param {MessageBodyIdentity} identity - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @param {SyncChildMetadata} input - (optional) All additional metadata about the DataObjectChild.\n * @return {Promise} - Return Promise to a new DataObjectChild.\n */\n\n }, {\n key: 'addChild',\n value: function addChild(initialData, identity, input) {\n var _this = this;\n var newChild = void 0;\n\n //returns promise, in the future, the API may change to asynchronous call\n return new _promise2.default(function (resolve) {\n\n var msgChildPath = _this._url + '/children/';\n\n var childInput = _this._getChildInput(input);\n childInput.data = initialData;\n // childInput.children = children;\n newChild = new _DataObjectChild2.default(childInput);\n\n if (identity) newChild.identity = identity;\n\n newChild.share();\n\n log.log('[DataObject.addChild] added ', newChild);\n\n newChild.onChange(function (event) {\n _this._onChange(event, { path: msgChildPath, childId: childInput.url });\n });\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[childInput.url] = newChild;\n\n resolve(newChild);\n });\n }\n }, {\n key: '_deleteChildrens',\n value: function _deleteChildrens() {\n\n var _this = this;\n var deletePromises = [];\n\n return new _promise2.default(function (resolve) {\n if (_this.childrens) {\n log.log('[DataObject.deleteChildrens]', _this.childrens);\n var child = void 0;\n\n for (child in _this.childrens) {\n // let child;\n\n /* if (children === 'resources') {\n for (child in _this.childrens[children]) {\n let childObj = _this.childrens[children][child];\n log.log('[DataObject._deleteChildrens] child',childObj);\n if (childObj.metadata.hasOwnProperty('resourceType'))\n deletePromises.push(_this.childrens[children][child].delete());\n }\n } else {*/\n var childObj = _this.childrens[child];\n log.log('[DataObject._deleteChildrens] child', childObj);\n if (childObj.metadata.hasOwnProperty('resourceType')) deletePromises.push(_this.childrens[child].delete());\n }\n // }\n\n log.log('[DataObject._deleteChildrens] promises ', deletePromises);\n\n if (deletePromises.length > 0) {\n _promise2.default.all(deletePromises).then(function () {\n resolve('[DataObject._deleteChildrens] done');\n });\n } else resolve('[DataObject._deleteChildrens] nothing to delete');\n }\n });\n }\n }, {\n key: '_getChildInput',\n value: function _getChildInput(input) {\n var _this = this;\n var childInput = (0, _assign2.default)({}, input);\n\n _this._childId++;\n\n //removing domain from childId to avoid backup issues with '.'\n\n childInput.url = _this._owner.split('/')[3] + '#' + _this._childId;\n\n childInput.parentObject = _this;\n childInput.reporter = _this._owner;\n childInput.created = new Date().toISOString();\n childInput.runtime = _this._syncher._runtimeUrl;\n childInput.p2pHandler = _this._syncher._p2pHandler;\n childInput.p2pRequester = _this._syncher._p2pRequester;\n childInput.schema = _this._schema;\n childInput.parent = _this.url;\n\n return childInput;\n }\n }, {\n key: 'addHypertyResource',\n value: function addHypertyResource(type, resource, identity, input) {\n var _this = this;\n\n //returns promise, in the future, the API may change to asynchronous call\n return new _promise2.default(function (resolve) {\n\n var hypertyResource = void 0;\n var msgChildPath = _this._url + '/children/';\n\n var childInput = _this._getChildInput(input);\n // childInput.children = children;\n\n _this._hypertyResourceFactory.createHypertyResourceWithContent(true, type, resource, childInput).then(function (resource) {\n hypertyResource = resource;\n\n if (identity) hypertyResource.identity = identity;\n\n hypertyResource.share();\n\n log.log('[DataObject.addHypertyResource] added ', hypertyResource);\n\n hypertyResource.onChange(function (event) {\n _this._onChange(event, { path: msgChildPath, childId: hypertyResource.childId });\n });\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[hypertyResource.childId] = hypertyResource;\n\n resolve(hypertyResource);\n });\n });\n }\n\n /**\n * Setup the callback to process create and delete of childrens.\n * @param {function(event: MsgEvent)} callback\n * TODO: add childrenId to support different handlers per children\n */\n\n }, {\n key: 'onAddChild',\n value: function onAddChild(callback) {\n\n this._onAddChildrenHandler = callback;\n }\n\n //FLOW-IN: message received from a remote DataObject -> addChild\n\n }, {\n key: '_onChildCreate',\n value: function _onChildCreate(msg) {\n var _this = this;\n\n // console.log('[DataObject._onChildCreate] receivedBy ' + _this._owner + ' : ', msg);\n\n // if this is an heartbeat msg foward it to heatbeat handler\n\n if (msg.body.resource === 'heartbeat') {\n console.log('[DataObject._onChildCreate] new heartbeat received ' + msg);\n this._heartBeat.onNewHeartbeat(msg.body.value);\n } else {\n console.log('[DataObject._onChildCreate] new child receivedBy ' + _this._owner + ' : ', msg);\n var response = {\n from: msg.to,\n to: msg.from,\n type: 'response',\n id: msg.id,\n body: {\n code: 100\n }\n };\n\n _this._bus.postMessage(response);\n\n if (msg.body.value.resourceType) {\n _this._onHypertyResourceAdded(msg);\n } else _this._onChildAdded(msg);\n }\n }\n }, {\n key: '_onChildAdded',\n value: function _onChildAdded(msg) {\n var _this = this;\n var childInput = (0, _utils.deepClone)(msg.body.value);\n childInput.parentObject = _this;\n\n // let children = childInput.children;\n\n var newChild = new _DataObjectChild2.default(childInput);\n newChild.identity = msg.body.identity;\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[childInput.url] = newChild;\n\n if (msg.to === _this.metadata.url) newChild.store();\n\n _this._hypertyEvt(msg, newChild);\n }\n }, {\n key: '_onHypertyResourceAdded',\n value: function _onHypertyResourceAdded(msg) {\n var _this = this;\n var input = msg.body.value;\n var hypertyResource = void 0;\n\n // let children = input.children;\n\n input.parentObject = _this;\n\n hypertyResource = _this._hypertyResourceFactory.createHypertyResource(false, input.resourceType, input);\n hypertyResource.identity = msg.body.identity;\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[hypertyResource.childId] = hypertyResource;\n\n _this._hypertyEvt(msg, hypertyResource);\n\n // locally store messages that are directly sent to the hyperty\n // ie to sync with messages sent when offline\n\n if (msg.to === _this.metadata.url) hypertyResource.store();\n }\n }, {\n key: '_hypertyEvt',\n value: function _hypertyEvt(msg, child) {\n var _this = this;\n\n var event = {\n type: msg.type,\n from: msg.from,\n url: msg.to,\n value: child.data,\n childId: child.url,\n identity: msg.body.identity,\n child: child\n };\n\n if (child.resourceType) {\n event.resource = child;\n }\n\n if (_this._onAddChildrenHandler) _this._onAddChildrenHandler(event);\n }\n\n //send delta messages to subscriptions\n\n }, {\n key: '_onChange',\n value: function _onChange(event, childInfo) {\n var _this = this;\n\n _this._metadata.lastModified = new Date().toISOString();\n\n _this._version++;\n\n if (_this._status === 'live') {\n //FLOW-OUT: this message will be sent directly to a resource changes address: MessageBus\n var changeMsg = {\n type: 'update', from: _this._url, to: _this._url + '/changes',\n body: { version: _this._version, source: _this._owner, attribute: event.field, lastModified: _this._metadata.lastModified }\n };\n\n log.log('[DataObject - _onChange] - ', event, childInfo, changeMsg);\n\n if (event.oType === _ProxyObject.ObjectType.OBJECT) {\n if (event.cType !== _ProxyObject.ChangeType.REMOVE) {\n changeMsg.body.value = (0, _utils.deepClone)(event.data);\n }\n } else {\n changeMsg.body.attributeType = event.oType;\n changeMsg.body.value = event.data;\n if (event.cType !== _ProxyObject.ChangeType.UPDATE) {\n changeMsg.body.operation = event.cType;\n }\n }\n\n //childInfo must have (path, childId)\n if (childInfo) {\n changeMsg.to = childInfo.path;\n changeMsg.body.resource = childInfo.childId;\n }\n\n //TODO: For Further Study\n if (!_this.data._mutual) changeMsg.body.mutual = _this._mutual;\n\n _this._bus.postMessage(changeMsg);\n }\n }\n\n //FLOW-IN: delta message received from a remote DataObjectReporter or DataObjectChild when changing data\n\n }, {\n key: '_changeObject',\n value: function _changeObject(syncObj, msg) {\n var _this = this;\n\n //TODO: update version ?\n //how to handle an incorrect version ? Example: receive a version 3 when the observer is in version 1, where is the version 2 ?\n //will we need to confirm the reception ?\n if (_this._version + 1 <= msg.body.version) {\n _this._version = msg.body.version;\n var path = msg.body.attribute;\n var value = void 0;\n if ((0, _typeof3.default)(msg.body.value) === 'object') value = (0, _utils.deepClone)(msg.body.value);else value = msg.body.value;\n\n var findResult = syncObj.findBefore(path);\n\n if (msg.body.lastModified) {\n _this._metadata.lastModified = msg.body.lastModified;\n } else {\n _this._metadata.lastModified = new Date().toISOString();\n }\n\n if (msg.body.attributeType === _ProxyObject.ObjectType.ARRAY) {\n if (msg.body.operation === _ProxyObject.ChangeType.ADD) {\n var arr = findResult.obj;\n var index = findResult.last;\n Array.prototype.splice.apply(arr, [index, 0].concat(value));\n } else if (msg.body.operation === _ProxyObject.ChangeType.REMOVE) {\n var _arr = findResult.obj;\n var _index = findResult.last;\n _arr.splice(_index, value);\n } else {\n findResult.obj[findResult.last] = value; // UPDATE\n }\n } else {\n if (msg.body.hasOwnProperty('value')) {\n findResult.obj[findResult.last] = value; // UPDATE or ADD\n } else {\n delete findResult.obj[findResult.last]; // REMOVE\n }\n }\n } else {\n //TODO: how to handle unsynchronized versions?\n log.log('UNSYNCHRONIZED VERSION: (data => ' + _this._version + ', msg => ' + msg.body.version + ')');\n }\n }\n\n //FLOW-IN: message received from a remote DataObjectChild when changing data\n\n }, {\n key: '_changeChildren',\n value: function _changeChildren(msg) {\n var _this = this;\n var dividedURL = (0, _utils.divideURL)(msg.to);\n var identity = dividedURL.identity;\n // const resource = identity ? identity.substring(identity.lastIndexOf('/') + 1) : undefined;\n\n var childId = msg.body.resource;\n var children = _this._childrenObjects[childId];\n\n log.log('Change children: ', _this._owner, msg, resource);\n\n if (children) {\n _this._changeObject(children._syncObj, msg);\n } else {\n log.warn('No children found for: ', childId);\n }\n }\n }, {\n key: 'metadata',\n get: function get() {\n return this._metadata;\n }\n\n /**\n * Object URL of reporter or observer\n * @type {ObjectURL}\n */\n\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n\n /**\n * Object schema URL (this field is not yet stable, and is subsject to change)\n * @type {SchemaURL}\n */\n\n }, {\n key: 'schema',\n get: function get() {\n return this._schema;\n }\n\n /**\n * Status of the reporter or observer connection (this field is not yet stable, and is subsject to change)\n * @type {Status} - Enum of: on | paused\n */\n\n }, {\n key: 'status',\n get: function get() {\n return this._status;\n }\n\n /**\n * Data structure to be synchronized.\n * @type {JSON} - JSON structure that should follow the defined schema, if any.\n */\n\n }, {\n key: 'data',\n get: function get() {\n return this._syncObj.data;\n }\n\n /**\n * All created children's since the subscription, doesn't contain all children's since reporter creation.\n * @type {Object}\n */\n\n }, {\n key: 'childrens',\n get: function get() {\n return this._childrenObjects;\n }\n }]);\n return DataObject;\n}();\n\nexports.default = DataObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFPYmplY3QuanM/ZDAxOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWd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QTtBQUFBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUFBO0FBQUE7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQUE7QUFBQTs7Ozs7QUFpWUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///206\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ObjectType = exports.ChangeType = undefined;\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\n__webpack_require__(149);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar objectType = { ARRAY: '[object Array]', OBJECT: '[object Object]' };\n\n/**\n * @access private\n * Main class that maintains a JSON object, and observes changes in this object, recursively.\n * Internal objects and arrays are also observed.\n */\n\nvar SyncObject = function () {\n function SyncObject(initialData) {\n (0, _classCallCheck3.default)(this, SyncObject);\n\n var _this = this;\n\n _this._observers = [];\n _this._filters = {};\n\n this._data = initialData || {};\n\n this._internalObserve(this._data);\n }\n\n (0, _createClass3.default)(SyncObject, [{\n key: 'observe',\n value: function observe(callback) {\n this._observers.push(callback);\n }\n }, {\n key: 'find',\n value: function find(path) {\n var list = (0, _utils.parseAttributes)(path);\n\n return this._findWithSplit(list);\n }\n }, {\n key: 'findBefore',\n value: function findBefore(path) {\n var result = {};\n var list = (0, _utils.parseAttributes)(path);\n result.last = list.pop();\n result.obj = this._findWithSplit(list);\n\n return result;\n }\n }, {\n key: '_findWithSplit',\n value: function _findWithSplit(list) {\n var obj = this._data;\n list.forEach(function (value) {\n obj = obj[value];\n });\n\n return obj;\n }\n }, {\n key: '_internalObserve',\n value: function _internalObserve(object) {\n var _this2 = this;\n\n var handler = function handler(changeset) {\n\n changeset.every(function (change) {\n _this2._onChanges(change);\n });\n };\n\n this._data = Object.deepObserve(object, handler);\n }\n }, {\n key: '_fireEvent',\n value: function _fireEvent(event) {\n this._observers.forEach(function (callback) {\n callback(event);\n });\n }\n }, {\n key: '_onChanges',\n value: function _onChanges(change) {\n\n var obj = change.object;\n var objType = void 0;\n\n if (obj.constructor === Object) {\n objType = ObjectType.OBJECT;\n }\n\n if (obj.constructor === Array) {\n objType = ObjectType.ARRAY;\n }\n\n var fieldString = change.keypath;\n\n // console.log('Field:', fieldString);\n // console.log('type:', change.type);\n\n //let oldValue = change.oldValue;\n var newValue = obj[change.name];\n\n // console.info(change.type + ' | Field: ' + fieldString + ' | New Value:', JSON.stringify(newValue), fieldString.includes('length'));\n\n if (change.type === 'update' && !fieldString.includes('.length')) {\n this._fireEvent({\n cType: ChangeType.UPDATE,\n oType: objType,\n field: fieldString,\n data: newValue\n });\n }\n\n if (change.type === 'add') {\n this._fireEvent({\n cType: ChangeType.ADD,\n oType: objType,\n field: fieldString,\n data: newValue\n });\n }\n\n if (change.type === 'delete') {\n this._fireEvent({\n cType: ChangeType.REMOVE,\n oType: objType,\n field: fieldString\n });\n }\n }\n }, {\n key: 'data',\n get: function get() {\n return this._data;\n }\n }]);\n return SyncObject;\n}();\n\nvar ChangeType = exports.ChangeType = { UPDATE: 'update', ADD: 'add', REMOVE: 'remove' };\nvar ObjectType = exports.ObjectType = { OBJECT: 'object', ARRAY: 'array' };\nexports.default = SyncObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1Byb3h5T2JqZWN0LmpzP2EwZDIiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICd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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFKQTtBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFKQTtBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFLQTtBQUNBOzs7QUFsR0E7QUFBQTtBQUFBOzs7OztBQXNHQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///207\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ProxyObject = __webpack_require__(207);\n\nvar _ProxyObject2 = _interopRequireDefault(_ProxyObject);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectChild'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n// Log System\n\n/**\n * The class returned from the DataObject addChildren call or from onAddChildren if remotely created.\n */\nvar DataObjectChild /* implements SyncStatus */ = function () {\n /* private\n ----event handlers----\n _onResponseHandler: (event) => void\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the DataObject.addChild\n */\n function DataObjectChild(input) {\n (0, _classCallCheck3.default)(this, DataObjectChild);\n\n var _this = this;\n\n function throwMandatoryParmMissingError(par) {\n throw '[DataObjectChild] ' + par + ' mandatory parameter is missing';\n }\n\n input.parent ? _this._parent = input.parent : throwMandatoryParmMissingError('parent');\n input.url ? _this._url = input.url : throwMandatoryParmMissingError('url');\n input.created ? _this._created = input.created : throwMandatoryParmMissingError('created');\n input.reporter ? _this._reporter = input.reporter : throwMandatoryParmMissingError('reporter');\n input.runtime ? _this._runtime = input.runtime : throwMandatoryParmMissingError('runtime');\n input.schema ? _this._schema = input.schema : throwMandatoryParmMissingError('schema');\n input.parentObject ? _this._parentObject = input.parentObject : throwMandatoryParmMissingError('parentObject');\n\n if (input.name) _this._name = input.name;\n if (input.description) _this._description = input.description;\n if (input.tags) _this._tags = input.tags;\n if (input.resources) _this._resources = input.resources;\n if (input.observerStorage) _this._observerStorage = input.observerStorage;\n if (input.publicObservation) _this._publicObservation = input.publicObservation;\n\n _this._childId = input.url;\n\n if (input.data) {\n _this._syncObj = new _ProxyObject2.default(input.data);\n } else {\n _this._syncObj = new _ProxyObject2.default({});\n }\n\n log.log('[DataObjectChild - Constructor] - ', _this._syncObj);\n\n _this._bus = _this._parentObject._bus;\n _this._owner = _this._parentObject._owner;\n\n _this._allocateListeners();\n\n _this._metadata = input;\n\n // delete _this._metadata.data;\n delete _this._metadata.parentObject;\n\n _this._sharingStatus = false;\n }\n\n (0, _createClass3.default)(DataObjectChild, [{\n key: 'share',\n\n\n /**\n * This function is used to share the child Object among authorised Hyperties\n * @param {boolean} reporter If true the child object is only shared to Parent reporter\n * @return {Promise} It returns a promise with the sharing results.\n */\n\n value: function share(toReporter) {\n var _this = this;\n\n _this._sharingStatus = new _promise2.default(function (resolve, reject) {\n\n var to = void 0;\n var reporter = toReporter;\n\n if (reporter) {\n to = _this.metadata.parent;\n } else to = _this.metadata.parent + '/children/';\n\n var childValue = _this.metadata;\n childValue.data = _this.data;\n\n //FLOW-OUT: this message will be sent directly to a resource child address: MessageBus\n var requestMsg = {\n type: 'create', from: _this.metadata.reporter, to: to,\n body: { resource: childValue.url, value: childValue }\n };\n\n if (_this.identity) {\n requestMsg.body.identity = _this.identity;\n }\n\n //to be used to disable mutual authentication for legacy users\n\n if (_this._parentObject.data.hasOwnProperty('mutual')) requestMsg.body.mutual = _this._parentObject.data.mutual;\n\n if (_this._parentObject.metadata.reporter === _this.metadata.reporter) {\n _this._bus.postMessage((0, _utils.deepClone)(requestMsg));\n return resolve();\n } else {\n\n var callback = function callback(reply) {\n\n if (reply.to === _this._reporter) {\n _this._bus.removeResponseListener(requestMsg.from, reply.id);\n\n log.log('[Syncher.DataObjectChild.share] Parent reporter reply ', reply);\n\n var result = {\n code: reply.body && reply.body.code ? reply.body.code : 500,\n desc: reply.body && reply.body.desc ? reply.body.desc : 'Unknown'\n };\n\n if (reply.body.code < 300) {\n return resolve(result);\n } else return reject(result);\n }\n };\n\n var id = _this._bus.postMessage((0, _utils.deepClone)(requestMsg), callback, false);\n\n setTimeout(function () {\n\n // If Reporter does not reply the promise is rejected\n _this._bus.removeResponseListener(requestMsg.from, id);\n\n var result = {\n code: 408,\n desc: 'timout'\n };\n return reject(result);\n }, 3000);\n }\n });\n }\n\n /**\n * This function is used to share the child Object among authorised Hyperties\n * @param {boolean} reporter If true the child object is only shared to Parent reporter\n * @return {Promise} It returns a promise with the sharing results.\n */\n\n }, {\n key: 'store',\n value: function store() {\n var _this = this;\n\n var child = {};\n var key = _this.metadata.children + '.' + _this.metadata.url;\n\n child.value = _this.metadata;\n child.identity = _this.identity;\n\n var msg = {\n\n from: _this.metadata.reporter,\n to: _this._parentObject._syncher._subURL,\n type: 'create',\n body: {\n resource: _this.metadata.parent,\n attribute: key,\n value: child\n }\n };\n\n log.log('[DataObjectChild.store]:', msg);\n\n _this._bus.postMessage(msg);\n }\n }, {\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this = this;\n\n //this is only needed for children reporters\n if (_this._reporter === _this._owner) {\n _this._listener = _this._bus.addListener(_this._reporter, function (msg) {\n if (msg.type === 'response' && msg.id === _this._msgId) {\n log.log('DataObjectChild.onResponse:', msg);\n _this._onResponse(msg);\n }\n });\n }\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n if (_this._listener) {\n _this._listener.remove();\n }\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n _this._releaseListeners();\n\n //TODO: send delete message ?\n\n // nothing to be done\n // return new Promise((resolve) => {\n // log.log('[DataObjectChild.delete]');\n // resolve();\n // });\n }\n\n /**\n * All Metadata about the Child Data Object\n * @type {Object} -\n */\n\n }, {\n key: 'onChange',\n\n\n /**\n * Register the change listeners sent by the reporter child\n * @param {function(event: MsgEvent)} callback\n */\n value: function onChange(callback) {\n this._syncObj.observe(function (event) {\n log.log('[DataObjectChild - observer] - ', event);\n callback(event);\n });\n }\n\n /**\n * Setup the callback to process response notifications of the creates\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n this._onResponseHandler = callback;\n }\n\n //FLOW-IN: message received from a remote DataObject -> _onChildCreate\n\n }, {\n key: '_onResponse',\n value: function _onResponse(msg) {\n var _this = this;\n\n var event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n _this._onResponseHandler(event);\n }\n }\n }, {\n key: 'shareable',\n get: function get() {\n var shareable = this.metadata;\n shareable.data = this.data;\n\n return shareable;\n }\n }, {\n key: 'metadata',\n get: function get() {\n return this._metadata;\n }\n\n /**\n * Children ID generated on addChildren. Unique identifier\n * @type {URL} - URL of the format #\n */\n\n }, {\n key: 'childId',\n get: function get() {\n return this._childId;\n }\n\n /**\n * Data Structure to be synchronized.\n * @type {JSON} - JSON structure that should follow the defined schema, if any.\n */\n\n }, {\n key: 'sharingStatus',\n get: function get() {\n return this._sharingStatus;\n }\n\n /**\n * Data Structure to be synchronized.\n * @type {JSON} - JSON structure that should follow the defined schema, if any.\n */\n\n }, {\n key: 'data',\n get: function get() {\n return this._syncObj.data;\n }\n\n /**\n * Set for this dataObjectChild an identity\n * @method identity\n * @param {Identity} identity identity from who created the message\n */\n\n }, {\n key: 'identity',\n set: function set(identity) {\n this._identity = identity;\n }\n\n /**\n * Get for this dataObjectChild an identity\n * @method identity\n * @return {Identity} identity from who created the message\n */\n ,\n get: function get() {\n return this._identity;\n }\n }]);\n return DataObjectChild;\n}();\n\nexports.default = DataObjectChild;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFPYmplY3RDaGlsZC5qcz9hNzQ2Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0Fcbiog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2coJ1tTeW5jaGVyLkRhdGFPYmplY3RDaGlsZC5zaGFyZV0gUGFyZW50IHJlcG9ydGVyIHJlcGx5ICcsIHJlcGx5KTtcblxuICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICAgY29kZTogcmVwbHkuYm9keSAmJiByZXBseS5ib2R5LmNvZGUgPyByZXBseS5ib2R5LmNvZGUgOiA1MDAsXG4gICAgICAgICAgICAgIGRlc2M6IHJlcGx5LmJvZHkgJiYgcmVwbHkuYm9keS5kZXNjID8gcmVwbHkuYm9keS5kZXNjIDogJ1Vua25vd24nXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAocmVwbHkuYm9keS5jb2RlIDwgMzAwKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgICAgICB9IGVsc2UgcmV0dXJuIHJlamVjdChyZXN1bHQpO1xuXG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGxldCBpZCA9IF90aGlzLl9idXMucG9zdE1lc3NhZ2UoZGVlcENsb25lKHJlcXVlc3RNc2cpLCBjYWxsYmFjaywgZmFsc2UpO1xuXG4gICAgICAgIHNldFRpbWVvdXQoKCk9PiB7XG5cbiAgICAgICAgICAvLyBJZiBSZXBvcnRlciBkb2VzICBub3QgcmVwbHkgdGhlIHByb21pc2UgaXMgcmVqZWN0ZWRcbiAgICAgICAgICBfdGhpcy5fYnVzLnJlbW92ZVJlc3BvbnNlTGlzdGVuZXIocmVxdWVzdE1zZy5mcm9tLCBpZCk7XG5cbiAgICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgY29kZTogNDA4LFxuICAgICAgICAgICAgZGVzYzogJ3RpbW91dCdcbiAgICAgICAgICB9O1xuICAgICAgICAgIHJldHVybiByZWplY3QocmVzdWx0KTtcblxuICAgICAgICB9LCAzMDAwKTtcblxuICAgICAgfVxuICAgIH0pO1xuXG4gIH1cblxuIC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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7Ozs7QUEwQ0E7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBQ0E7QUFLQTtBQUNBO0FBQ0E7QUFDQTs7O0FBeE9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBNkpBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUFBO0FBQUE7QUFDQTtBQUNBOzs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUtBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7O0FBS0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7Ozs7O0FBS0E7QUFBQTtBQUFBOzs7OztBQXNDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///208\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the "License");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an "AS IS" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * EventEmitter\n * All classes which extends this, can have addEventListener and trigger events;\n */\nvar EventEmitter = function () {\n function EventEmitter() {\n (0, _classCallCheck3.default)(this, EventEmitter);\n }\n\n (0, _createClass3.default)(EventEmitter, [{\n key: "addEventListener",\n\n\n /**\n * addEventListener listen for an eventType\n * @param {string} eventType - listening for this type of event\n * @param {Function} cb - callback function will be executed when the event it is invoked\n */\n value: function addEventListener(eventType, cb) {\n var _this = this;\n _this[eventType] = cb;\n }\n\n /**\n * Invoke the eventType\n * @param {string} eventType - event will be invoked\n * @param {object} params - parameters will be passed to the addEventListener\n */\n\n }, {\n key: "trigger",\n value: function trigger(eventType, params) {\n var _this = this;\n\n if (_this[eventType]) {\n _this[eventType](params);\n }\n }\n }]);\n return EventEmitter;\n}();\n\nexports.default = EventEmitter;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9FdmVudEVtaXR0ZXIuanM/YzgzMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTF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mVudEVtaXR0ZXIuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXNCQTs7OztBQUlBOzs7Ozs7Ozs7QUFFQTs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///209\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _RegistrationStatus = __webpack_require__(150);\n\nvar _RegistrationStatus2 = _interopRequireDefault(_RegistrationStatus);\n\nvar _InvitationsHandler = __webpack_require__(501);\n\nvar _InvitationsHandler2 = _interopRequireDefault(_InvitationsHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* The Group Chat API is used to control a Group Chat instance.\n* @author Vitor Silva [vitor-t-silva@telecom.pt]\n* @version 0.1.0\n*/\n\n//import { UserInfo } from './UserInfo';\nvar ChatController = function () {\n function ChatController(syncher, discovery, domain, search, identity, manager) {\n (0, _classCallCheck3.default)(this, ChatController);\n\n\n if (!syncher) throw Error('Syncher is a necessary dependecy');\n if (!discovery) throw Error('Discover is a necessary dependecy');\n if (!domain) throw Error('Domain is a necessary dependecy');\n if (!search) throw Error('Search is a necessary dependecy');\n\n var _this = this;\n _this._syncher = syncher;\n _this.discovery = discovery;\n _this.search = search;\n _this.myIdentity = identity;\n _this.controllerMode = 'reporter';\n _this.child_cseq = 0;\n _this.domain = domain;\n\n _this._manager = manager;\n\n var hypertyURL = syncher.owner;\n\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + domain + '/.well-known/dataschema/Communication';\n\n _this._invitationsHandler = new _InvitationsHandler2.default(hypertyURL);\n }\n\n (0, _createClass3.default)(ChatController, [{\n key: '_setOnAddChildListener',\n value: function _setOnAddChildListener(dataObject) {\n\n var _this = this;\n\n dataObject.onAddChild(function (child) {\n _this.child_cseq += 1;\n console.info('[ChatManager.ChatController._setOnAddChildListener] new Child received: ', child);\n\n if (_this._onMessage) _this._onMessage(child);\n });\n }\n }, {\n key: '_onSubscribe',\n value: function _onSubscribe(event) {\n\n var dataObjectReporter = this._dataObjectReporter;\n\n event.accept();\n\n console.log('[ChatManager.ChatController.onSubscribe] event', event, dataObjectReporter.url);\n console.log('[ChatManager.ChatController.onSubscribe] New user has subscribe this object: ', dataObjectReporter.data, event.identity);\n\n var identity = JSON.parse((0, _stringify2.default)(event.identity));\n\n if (identity.hasOwnProperty('assertion')) {\n delete identity.assertion;\n }\n\n var userInfo = {\n hypertyURL: event.url,\n domain: event.domain,\n identity: identity\n };\n var userURL = event.identity.userProfile.guid;\n\n console.log('[ChatManager.ChatController.onSubscribe] new participant', userInfo);\n if (event.identity.legacy) {\n userInfo.legacy = event.identity.legacy;\n }\n\n dataObjectReporter.data.participants[userURL] = userInfo;\n\n console.log('[ChatManager.ChatController.onSubscribe] communicationObject OBJ chatcontroller', dataObjectReporter.data.participants);\n console.log('[ChatManager.ChatController.onSubscribe - onSubscription] ', userInfo);\n // console.log('[ChatManager.ChatController.onSubscribe - this._onUserAdded] ', this._onUserAdded);\n\n if (this._onUserAdded) this._onUserAdded(userInfo);\n }\n }, {\n key: '_onUnsubscribe',\n value: function _onUnsubscribe(event) {\n var dataObjectReporter = this._dataObjectReporter;\n\n console.log('[ChatManager.ChatController.onUnsubscribe] event', event, dataObjectReporter.url);\n\n var participant = event.identity.userProfile;\n\n console.log('[ChatManager.ChatController.onUnsubscribe] participant left', participant);\n if (event.identity.legacy) {\n participant.legacy = event.identity.legacy;\n }\n\n delete dataObjectReporter.data.participants[participant.userURL];\n\n console.log('[ChatManager.ChatController.onUnsubscribe - this._onUserRemoved] ', this.onUserRemoved);\n if (this._onUserRemoved) this._onUserRemoved(participant);\n }\n\n /**\n * This function is used to send a file.\n * @param {string} file Is the file to be sent.\n * @return {Promise} It returns the ChatMessage child object created by the Syncher as a Promise.\n */\n\n }, {\n key: 'sendFile',\n value: function sendFile(file) {\n\n var _this = this;\n var mode = _this.controllerMode;\n var dataObject = mode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n return new _promise2.default(function (resolve, reject) {\n\n var identity = {\n userProfile: _this.myIdentity\n };\n\n dataObject.addHypertyResource('resources', 'file', file, identity).then(function (resourceFile) {\n\n var identity = {\n userProfile: _this.myIdentity\n };\n var fileSentEvt = { value: resourceFile, identity: identity, resource: resourceFile };\n\n var reporterStatus = new _RegistrationStatus2.default(dataObject.url, _this._manager._runtimeURL, _this._manager._hypertyURL, _this._manager._bus);\n\n // recursive function to sync with chat reporter\n\n var share2Reporter = function share2Reporter(file, subscriber, evt, status) {\n var statusOfReporter = status;\n file.sharingStatus.then(resolve(evt)).catch(function (result) {\n console.log('[ChatManager.ChatController.sendFile] share failed: ', result);\n\n statusOfReporter.onLive(subscriber, function () {\n statusOfReporter.unsubscribeLive(subscriber);\n file.share(true);\n share2Reporter(file, subscriber, evt, statusOfReporter);\n });\n //TODO: subscribe to sync when reporter is live. New synched messages should trigger onMessage ie onChild\n });\n };\n\n share2Reporter(resourceFile, _this._manager._hypertyURL, fileSentEvt, reporterStatus);\n });\n }).catch(function (reason) {\n console.error('Reason:', reason);\n reject(reason);\n });\n }\n\n /**\n * This function is used to send a chat message.\n * @param {string} message Is the ChatMessage to be sent.\n * @return {Promise} It returns the ChatMessage child object created by the Syncher as a Promise.\n */\n\n }, {\n key: 'send',\n value: function send(message, identity) {\n\n var _this = this;\n var mode = _this.controllerMode;\n var dataObject = mode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n return new _promise2.default(function (resolve, reject) {\n\n // let _dataObjectChild;\n _this.child_cseq += 1;\n var msg = {\n\n /* url: dataObject.data.url,\n cseq: _this.child_cseq,\n reporter: dataObject.data.reporter,\n schema: dataObject.data.schema,\n name: dataObject.data.name,\n created : new Date().toJSON(),*/\n\n type: 'chat',\n content: message\n };\n\n var sender = identity ? identity : {\n userProfile: _this.myIdentity\n };\n\n // TODO: change chatmessages to resource - chat, file\n // TODO: change message to hypertyResource - https://github.com/reTHINK-project/dev-service-framework/tree/develop/docs/datamodel/data-objects/hyperty-resource\n // TODO: handle with multiple resources - if the \"message\" will be different for each type of resources\n dataObject.addChild(msg, sender).then(function (dataObjectChild) {\n console.log('[ChatManager.ChatController][addChild - Chat Message]: ', dataObjectChild);\n //resolve(dataObjectChild);\n\n //TODO: move to separate function\n\n\n var msg = {\n childId: dataObjectChild._childId,\n from: dataObjectChild._owner,\n value: dataObjectChild.data,\n type: 'create',\n identity: sender\n };\n\n var reporterStatus = new _RegistrationStatus2.default(dataObject.url, _this._manager._runtimeURL, _this._manager._hypertyURL, _this._manager._bus);\n\n // recursive function to sync with chat reporter\n\n var share2Reporter = function share2Reporter(child, subscriber, msg, status) {\n var statusOfReporter = status;\n child.sharingStatus.then(resolve(msg)).catch(function (result) {\n\n statusOfReporter.onLive(subscriber, function () {\n statusOfReporter.unsubscribeLive(subscriber);\n child.share(true);\n share2Reporter(child, subscriber, msg, statusOfReporter);\n });\n //TODO: subscribe to sync when reporter is live. New synched messages should trigger onMessage ie onChild\n });\n };\n\n share2Reporter(dataObjectChild, _this._manager._hypertyURL, msg, reporterStatus);\n }).catch(function (reason) {\n console.error('Reason:', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * [onChange description]\n * @param {Function} callback [description]\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onChange',\n value: function onChange(callback) {\n var _this = this;\n _this._onChange = callback;\n }\n\n /**\n * This function is used to receive new messages.\n * @param {Function} callback Function to handle with new messages\n * @return {Communication.ChatMessage} m\n */\n\n }, {\n key: 'onMessage',\n value: function onMessage(callback) {\n var _this = this;\n _this._onMessage = callback;\n }\n\n /**\n * [onUserAdded description]\n * @param {Function} callback [description]\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onUserAdded',\n value: function onUserAdded(callback) {\n var _this = this;\n _this._onUserAdded = callback;\n }\n\n /**\n * When the an user was removed\n * @param {Function} callback Function handle with the removed user\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onUserRemoved',\n value: function onUserRemoved(callback) {\n var _this = this;\n _this._onUserRemoved = callback;\n }\n\n /**\n * This function is used to receive requests to close the Group Chat instance.\n * @return {DeleteEvent} The DeleteEvent fired by the Syncher when the Chat is closed.\n */\n\n }, {\n key: 'onClose',\n value: function onClose(callback) {\n var _this = this;\n _this._onClose = callback;\n }\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n var _this = this;\n _this._onResponse = callback;\n }\n\n /**\n * This function is used to add / invite new user on an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @param {URL.UserURL} users User to be invited to join the Group Chat that is identified with reTHINK User URL.\n * @return {Promise} It returns as a Promise true if successfully invited or false otherwise.\n */\n\n }, {\n key: 'addUser',\n value: function addUser(users) {\n\n var _this = this;\n\n var haveEmptyElements = function haveEmptyElements(element) {\n console.log('Element:', element.length);\n return element.length !== 0;\n };\n\n var notFoundElements = function notFoundElements(element) {\n console.log('user not found: ', element);\n return !(element instanceof String);\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n if (users.filter(haveEmptyElements).length === 0) {\n return reject('Don\\'t have users to invite');\n }\n\n console.info('[ChatManager.ChatController.addUsers ]: ', users);\n\n /*_this.search.users(users, domains, ['comm'], ['chat'])\n .then((hypertiesIDs) => {\n if (hypertiesIDs.filter(notFoundElements).length === 0) {\n throw 'User(s) not found';\n }\n let selectedHyperties = hypertiesIDs.map((hyperty) => {\n return hyperty.hypertyID;\n });*/\n\n var usersDiscovery = [];\n var disconnected = [];\n var live = {};\n\n users.forEach(function (user) {\n var userDiscoveryPromise = _this.discovery.discoverHypertiesDO(user.user, ['comm'], ['chat'], user.domain);\n usersDiscovery.push(userDiscoveryPromise);\n });\n\n _promise2.default.all(usersDiscovery).then(function (userDiscoveryResults) {\n console.log('[ChatManager.ChatController.addUsers] Users Discovery Results->', userDiscoveryResults);\n\n var selectedHyperties = [];\n\n userDiscoveryResults.forEach(function (userDiscoveryResult) {\n\n userDiscoveryResult.forEach(function (discovered) {\n if (discovered.data.status === 'live') {\n selectedHyperties.push(discovered.data.hypertyID);\n live[discovered.data.hypertyID] = discovered;\n } else if (disconnected.length < 5) disconnected.push(discovered);\n });\n });\n\n console.info('[ChatManager.ChatController]------------------------ Syncher Create ---------------------- \\n');\n console.info('[ChatManager.ChatController]Selected Hyperties: !!! ', selectedHyperties);\n console.info('Have ' + selectedHyperties.length + ' users;');\n // console.info('[ChatManager] HypertiesIDs ', hypertiesIDs);\n\n var dataObject = _this.controllerMode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n if (disconnected.length > 0) _this._invitationsHandler.inviteDisconnectedHyperties(disconnected, dataObject);\n\n dataObject.inviteObservers(selectedHyperties);\n\n if (dataObject.invitations.length > 0) _this._invitationsHandler.processInvitations(live, dataObject);\n\n return;\n }).then(function () {\n console.info('[ChatManager.ChatController]Are invited with success ' + users.length + ' users;');\n resolve(true);\n }).catch(function (reason) {\n console.error('An error occurred when trying to invite users;\\n', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * This function is used to request the Reporter to add / invite new user on an existing Group Chat instance.\n * Only Observers are allowed to use this function.\n * @param {URL.UserURL} users User to be invited to join the Group Chat that is identified with reTHINK User URL.\n * @return {Promise} It returns as a Promise true if successfully invited or false otherwise.\n */\n\n }, {\n key: 'addUserReq',\n value: function addUserReq(users) {\n\n var _this = this;\n\n //check is Observer and invoke observer.execute() with new promise\n var haveEmptyElements = function haveEmptyElements(element) {\n console.log('Element:', element.length);\n return element.length !== 0;\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n if (users.filter(haveEmptyElements).length === 0) {\n return reject('[ChatManager.ChatController.addUserReq] Don\\'t have users to add');\n }\n if (!_this.controllerMode === 'observer') {\n return reject('[ChatManager.ChatController.addUserReq] only allowed to Chat Observer');\n\n var addUser = _this.addUser(users);\n\n if (_this._dataObjectObserver) {\n addUser = _this._dataObjectObserver.execute('addUser', users);\n }\n\n addUser.then(function () {\n console.info('[ChatManager.ChatController.addUserReq] Request accepted by Reporter ');\n resolve(true);\n }).catch(function (reason) {\n console.error('[ChatManager.ChatController.addUserReq] Request rejected by Reporter;\\n', reason);\n reject(reason);\n });\n }\n });\n }\n }, {\n key: 'onInvitationResponse',\n value: function onInvitationResponse(callback) {\n var _this = this;\n _this._onInvitationResponse = callback;\n _this._invitationsHandler.invitationResponse = callback;\n }\n\n /**\n * This function is used to remove a user from an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @return { boolean} Promise with the status\n */\n\n /**\n * This function is used to remove a user from an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @param {URL.UserURL} user User to be removed from the Group Chat that is identified with reTHINK User URL.\n * @return { boolean} It returns as a Promise true if successfully removed or false otherwise.\n */\n\n }, {\n key: 'removeUser',\n value: function removeUser(user) {\n\n // TODO: implement the removeUser;\n console.log('[ChatManager.ChatController]Not yet implemented: ', user);\n }\n\n /**\n * This function is used to close an existing Group Chat instance.\n * Only available to Chat Group Reporters i.e. the Hyperty instance that created the Group Chat.\n * @return {Boolean} It returns as a Promise true if successfully closed or false otherwise.\n */\n\n }, {\n key: 'close',\n value: function close() {\n var del = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n // TODO: the dataObjectReporter.delete should be a Promise;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.controllerMode === 'reporter') {\n // reporter\n _this._invitationsHandler.cleanInvitations(_this.dataObjectReporter).then(function () {\n if (!del) {\n _this._manager.communicationObject.status = 'closed';\n resolve(true);\n } else {\n\n try {\n\n delete _this._manager._reportersControllers[_this.dataObjectReporter.url];\n _this.dataObjectReporter.delete();\n resolve(true);\n if (_this._onClose) _this._onClose({\n code: 200,\n desc: 'deleted',\n url: _this.dataObjectReporter.url\n });\n } catch (e) {\n console.error(e);\n reject(false);\n }\n }\n });\n } else {\n // observer\n if (del) {\n try {\n delete _this._manager._observersControllers[_this.dataObjectObserver.url];\n _this.dataObjectObserver.unsubscribe();\n resolve(true);\n } catch (e) {\n console.error(e);\n reject(false);\n }\n } else {\n // TODO: send message \n resolve(true);\n }\n }\n });\n }\n }, {\n key: 'invitationsHandler',\n get: function get() {\n return this._invitationsHandler;\n }\n }, {\n key: 'url',\n get: function get() {\n return this.controllerMode === 'reporter' ? this.dataObjectReporter.url : this.dataObjectObserver.url;\n }\n }, {\n key: 'dataObjectReporter',\n set: function set(dataObjectReporter) {\n\n if (!dataObjectReporter) throw new Error('[ChatController] The data object reporter is necessary parameter ');\n var _this = this;\n\n _this.controllerMode = 'reporter';\n\n // Handler to process received files\n\n // dataObjectReporter.onResponse(function(event) {\n // console.log('[DataObjectReporter - onResponse]', event);\n // if (_this._onInvitationResponse) {\n // _this._onInvitationResponse(event);\n // }\n //\n // });\n\n dataObjectReporter.onSubscription(function (event) {\n\n switch (event.type) {\n case 'subscribe':\n _this._onSubscribe(event);break;\n case 'unsubscribe':\n _this._onUnsubscribe(event);break;\n }\n });\n\n _this._setOnAddChildListener(dataObjectReporter);\n\n dataObjectReporter.onRead(function (event) {\n event.accept();\n });\n\n dataObjectReporter.onExecute(function (event) {\n switch (event.method) {\n case 'addUser':\n _this.addUser(event.params[0]).then(function () {\n event.accept();\n }).catch(function (reason) {\n console.error('Reason:', reason);\n event.reject(reason);\n });\n break;\n case 'removeUser':\n _this.removeUser(event.params).then(function () {\n event.accept();\n }).catch(function (reason) {\n console.error('Reason:', reason);\n event.reject(reason);\n });\n break;\n default:\n event.reject('[ChatController.onExecute] Chat method execution not accepted by Reporter');\n break;\n }\n });\n\n _this._dataObjectReporter = dataObjectReporter;\n },\n get: function get() {\n var _this = this;\n return _this._dataObjectReporter;\n }\n }, {\n key: 'messages',\n get: function get() {\n\n return this.controllerMode === 'reporter' ? this._dataObjectReporter._childrenObjects : this._dataObjectObserver._childrenObjects;\n }\n }, {\n key: 'dataObjectObserver',\n set: function set(dataObjectObserver) {\n var _this = this;\n\n _this.controllerMode = 'observer';\n\n _this._dataObjectObserver = dataObjectObserver;\n\n dataObjectObserver.onChange('*', function (event) {\n console.info('[ChatManager.ChatController]Observer - onChange', event);\n\n if (event.field.includes('participants')) {\n switch (event.cType) {\n case 'add':\n if (_this._onUserAdded) _this._onUserAdded(event);\n break;\n\n case 'remove':\n if (_this._onUserRemoved) _this._onUserRemoved(event);\n break;\n }\n }\n\n if (_this._onChange) _this._onChange(event);\n });\n\n _this._setOnAddChildListener(dataObjectObserver);\n\n // let childrens = dataObjectObserver.childrens;\n // Object.keys(childrens).forEach((child) => {\n // if (_this._onMessage) _this._onMessage({\n // childId: child,\n // identity: childrens[child].identity,\n // value: childrens[child].data\n // });\n // })\n },\n get: function get() {\n var _this = this;\n return _this._dataObjectObserver;\n }\n }, {\n key: 'dataObject',\n get: function get() {\n return this.controllerMode === 'reporter' ? this.dataObjectReporter : this.dataObjectObserver;\n }\n }, {\n key: 'closeEvent',\n set: function set(event) {\n var _this = this;\n _this._closeEvent = event;\n\n if (_this._onClose) _this._onClose(event);\n },\n get: function get() {\n var _this = this;\n return _this._closeEvent;\n }\n }]);\n return ChatController;\n}();\n\nexports.default = ChatController;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9DaGF0Q29udHJvbGxlci5qcz81MDg3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxu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Rlci5kZWxldGUgc2hvdWxkIGJlIGEgUHJvbWlzZTtcblxuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgXG4gICAgICBpZiAoX3RoaXMuY29udHJvbGxlck1vZGUgPT09ICdyZXBvcnRlcicpIHtcbiAgICAgICAgLy8gcmVwb3J0ZXJcbiAgICAgICAgX3RoaXMuX2ludml0YXRpb25zSGFuZGxlci5jbGVhbkludml0YXRpb25zKF90aGlzLmRhdGFPYmplY3RSZXBvcnRlcikudGhlbigoKSA9PiB7XG4gICAgICAgICAgaWYgKCFkZWwpIHtcbiAgICAgICAgICAgIF90aGlzLl9tYW5hZ2VyLmNvbW11bmljYXRpb25PYmplY3Quc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICAgIHJlc29sdmUodHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNle1xuXG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgZGVsZXRlIF90aGlzLl9tYW5hZ2VyLl9yZXBvcnRlcnNDb250cm9sbGVyc1tfdGhpcy5kYXRhT2JqZWN0UmVwb3J0ZXIudXJsXTtcbiAgICAgICAgICAgICAgICBfdGhpcy5kYXRhT2JqZWN0UmVwb3J0ZXIuZGVsZXRlKCk7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh0cnVlKTtcbiAgICAgICAgICAgICAgICBpZiAoX3RoaXMuX29uQ2xvc2UpIF90aGlzLl9vbkNsb3NlKHtcbiAgICAgICAgICAgICAgICAgIGNvZGU6IDIwMCxcbiAgICAgICAgICAgICAgICAgIGRlc2M6ICdkZWxldGVkJyxcbiAgICAgICAgICAgICAgICAgIHVybDogX3RoaXMuZGF0YU9iamVjdFJlcG9ydGVyLnVybFxuICAgICAgICAgICAgICAgIH0pXG4gICA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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUZBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQWxCQTtBQW9CQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFQQTtBQVNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQWdCQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQXdkQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///210\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Bus');\n\n/**\n* @author micaelpedrosa@gmail.com\n* Minimal interface and implementation to send and receive messages. It can be reused in many type of components.\n* Components that need a message system should receive this class as a dependency or extend it.\n* Extensions should implement the following private methods: _onPostMessage and _registerExternalListener\n*/\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Log system\n\nvar Bus = function () {\n /* private\n _msgId: number;\n _subscriptions: \n _responseTimeOut: number\n _responseCallbacks: void>\n */\n\n function Bus() {\n (0, _classCallCheck3.default)(this, Bus);\n\n var _this = this;\n _this._msgId = 0;\n _this._subscriptions = {};\n\n _this._responseTimeOut = 15000; //default to 3s\n _this._responseCallbacks = {};\n\n _this._registerExternalListener();\n }\n\n /**\n * Register listener to receive message when \"msg.to === url\".\n * Special url \"*\" for default listener is accepted to intercept all messages.\n * @param {URL} url Address to intercept, tha is in the message \"to\"\n * @param {Listener} listener listener\n * @return {MsgListener} instance of MsgListener\n */\n\n\n (0, _createClass3.default)(Bus, [{\n key: 'addListener',\n value: function addListener(url, listener) {\n var _this = this;\n\n var item = new MsgListener(_this._subscriptions, url, listener);\n var itemList = _this._subscriptions[url];\n if (!itemList) {\n itemList = [];\n _this._subscriptions[url] = itemList;\n }\n\n itemList.push(item);\n return item;\n }\n\n /**\n * Manually add a response listener. Only one listener per message ID should exist.\n * ATENTION, there is no timeout for this listener.\n * The listener should be removed with a removeResponseListener, failing to do this will result in a unreleased memory problem.\n * @param {URL} url Origin address of the message sent, \"msg.from\".\n * @param {number} msgId Message ID that is returned from the postMessage.\n * @param {Function} responseListener Callback function for the response\n */\n\n }, {\n key: 'addResponseListener',\n value: function addResponseListener(url, msgId, responseListener) {\n this._responseCallbacks[url + msgId] = responseListener;\n }\n\n /**\n * Remove the response listener.\n * @param {URL} url Origin address of the message sent, \"msg.from\".\n * @param {number} msgId Message ID that is returned from the postMessage\n */\n\n }, {\n key: 'removeResponseListener',\n value: function removeResponseListener(url, msgId) {\n delete this._responseCallbacks[url + msgId];\n }\n\n /**\n * Remove all existent listeners for the URL\n * @param {URL} url Address registered\n */\n\n }, {\n key: 'removeAllListenersOf',\n value: function removeAllListenersOf(url) {\n delete this._subscriptions[url];\n }\n\n /**\n * Helper method to bind listeners (in both directions) into other MiniBus target.\n * @param {URL} outUrl Outbound URL, register listener for url in direction \"this -> target\"\n * @param {URL} inUrl Inbound URL, register listener for url in direction \"target -> this\"\n * @param {MiniBus} target The other target MiniBus\n * @return {Bound} an object that contains the properties [thisListener, targetListener] and the unbind method.\n */\n\n }, {\n key: 'bind',\n value: function bind(outUrl, inUrl, target) {\n var _this2 = this;\n\n var _this = this;\n\n var thisListn = _this.addListener(outUrl, function (msg) {\n target.postMessage(msg);\n });\n\n var targetListn = target.addListener(inUrl, function (msg) {\n _this.postMessage(msg);\n });\n\n return {\n thisListener: thisListn,\n targetListener: targetListn,\n unbind: function unbind() {\n _this2.thisListener.remove();\n _this2.targetListener.remove();\n }\n };\n }\n\n //publish on default listeners\n\n }, {\n key: '_publishOnDefault',\n value: function _publishOnDefault(msg) {\n //is there any \"*\" (default) listeners?\n var itemList = this._subscriptions['*'];\n if (itemList) {\n this._publishOn(itemList, msg);\n }\n }\n\n //publish on a subscription list.\n\n }, {\n key: '_publishOn',\n value: function _publishOn(itemList, msg) {\n itemList.forEach(function (sub) {\n sub._callback(msg);\n });\n }\n }, {\n key: '_responseCallback',\n value: function _responseCallback(inMsg, responseCallback) {\n var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _this = this;\n\n //automatic management of response handlers\n if (responseCallback) {\n var responseId = inMsg.from + inMsg.id;\n _this._responseCallbacks[responseId] = responseCallback;\n\n if (timeout) {\n setTimeout(function () {\n var responseFun = _this._responseCallbacks[responseId];\n delete _this._responseCallbacks[responseId];\n\n if (responseFun) {\n var errorMsg = {\n id: inMsg.id, type: 'response',\n body: { code: 408, desc: 'Response timeout!', value: inMsg }\n };\n\n responseFun(errorMsg);\n }\n }, _this._responseTimeOut);\n }\n }\n }\n\n //TODO: provisional responses should reset timeout\n\n }, {\n key: '_onResponse',\n value: function _onResponse(msg) {\n var _this = this;\n\n if (msg.type === 'response') {\n var responseId = msg.to + msg.id;\n var responseFun = _this._responseCallbacks[responseId];\n\n if (msg.body.code >= 200) {\n //if it's a provisional response, don't delete response listener\n delete _this._responseCallbacks[responseId];\n }\n\n if (responseFun) {\n responseFun(msg);\n return true;\n }\n }\n\n return false;\n }\n\n //receive messages from external interface\n\n }, {\n key: '_onMessage',\n value: function _onMessage(msg) {\n var _this = this;\n\n if (!_this._onResponse(msg)) {\n var itemList = _this._subscriptions[msg.to];\n if (itemList) {\n _this._publishOn(itemList, msg);\n } else {\n _this._publishOnDefault(msg);\n }\n }\n }\n }, {\n key: '_genId',\n value: function _genId(inMsg) {\n //TODO: how do we manage message ID's? Should it be a global runtime counter, or per URL address?\n //Global counter will not work, because there will be multiple MiniBus instances!\n //Per URL, can be a lot of data to maintain!\n //Maybe a counter per MiniBus instance. This is the assumed solution for now.\n if (!inMsg.id || inMsg.id === 0) {\n this._msgId++;\n inMsg.id = this._msgId;\n }\n }\n\n /**\n * Send messages to local listeners, or if not exists to external listeners.\n * It's has an optional mechanism for automatic management of response handlers.\n * The response handler will be unregistered after receiving the response, or after response timeout (default to 3s).\n * @param {Message} msg Message to send. Message ID is automatically added to the message.\n * @param {Function} responseCallback Optional parameter, if the developer what's automatic response management.\n * @return {number} Returns the message ID, in case it should be needed for manual management of the response handler.\n */\n\n }, {\n key: 'postMessage',\n value: function postMessage(inMsg, responseCallback) {}\n\n /**\n * Function to post messages with a number of retries in case timeouts occur.\n * @param {Message} msg Message to send. Message ID is automatically added to the message.\n * @param {Function} responseCallback Optional parameter, if the developer what's automatic response management.\n * @param {integer} retries number of retries when timeouts occur\n * @return {boolean} message delivery result;\n */\n\n }, {\n key: 'postMessageWithRetries',\n value: function postMessageWithRetries(msg, retries, callback) {\n\n var _this = this;\n\n var retry = 0;\n //let timeout = true;\n\n var sendMsg = function sendMsg() {\n\n return new _promise2.default(function (resolve, reject) {\n _this.postMessage(msg, function (reply) {\n if (reply.body.code === 408 || reply.body.code === 500) reject();else {\n log.info('[Bus.postMessageWithRetries] msg delivered: ', msg);\n callback(reply);\n resolve();\n }\n });\n });\n };\n\n var tryAgain = function tryAgain() {\n sendMsg().then(function () {\n //timeout = false;\n return;\n }, function () {\n log.warn('[Bus.postMessageWithRetries] Message Bounced (retry ' + retry + '): \\'', msg);\n if (retry++ < retries) {\n tryAgain();\n // setTimeout(() => { tryAgain(); }, 1000);\n } else {\n var error = '[Error] Message Bounced (delivery attempts ' + retries + '): \\'';\n throw new Error(error + msg);\n }\n });\n };\n tryAgain();\n }\n\n /**\n * Not public available, used by the class extension implementation, to process messages from the public \"postMessage\" without a registered listener.\n * Used to send the message to an external interface, like a WebWorker, IFrame, etc.\n * @param {Message.Message} msg Message\n */\n\n }, {\n key: '_onPostMessage',\n value: function _onPostMessage(msg) {} /*implementation will send message to external system*/\n\n /**\n * Not public available, used by the class extension implementation, to process all messages that enter the MiniBus from an external interface, like a WebWorker, IFrame, etc.\n * This method is called one time in the constructor to register external listeners.\n * The implementation will probably call the \"_onMessage\" method to publish in the local listeners.\n * DO NOT call \"postMessage\", there is a danger that the message enters in a cycle!\n */\n\n }, {\n key: '_registerExternalListener',\n value: function _registerExternalListener() {/*implementation will register external listener and call \"this._onMessage(msg)\" */}\n }]);\n return Bus;\n}();\n\nvar MsgListener = function () {\n /* private\n _subscriptions: ;\n _url: string;\n _callback: (msg) => void;\n */\n\n function MsgListener(subscriptions, url, callback) {\n (0, _classCallCheck3.default)(this, MsgListener);\n\n var _this = this;\n\n _this._subscriptions = subscriptions;\n _this._url = url;\n _this._callback = callback;\n }\n\n (0, _createClass3.default)(MsgListener, [{\n key: 'remove',\n\n\n /**\n * Remove this listener from the Bus\n */\n value: function remove() {\n var _this = this;\n\n var subs = _this._subscriptions[_this._url];\n if (subs) {\n var index = subs.indexOf(_this);\n subs.splice(index, 1);\n\n //if there are no listeners, remove the subscription entirely.\n if (subs.length === 0) {\n delete _this._subscriptions[_this._url];\n }\n }\n }\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n }]);\n return MsgListener;\n}();\n\nexports.default = Bus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9idXMvQnVzLmpzPzZkMTciXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTa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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBOzs7Ozs7Ozs7QUFNQTs7Ozs7QUFJQTtBQUNBOzs7Ozs7QUFNQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFHQTs7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBbEJBO0FBQUE7QUFBQTs7Ozs7QUFxQkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///211\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _RegistryDataModel2 = __webpack_require__(505);\n\nvar _RegistryDataModel3 = _interopRequireDefault(_RegistryDataModel2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author: Gil Dias (gil.dias@tecnico.ulisboa.pt)\n* HypertyInstance Data Model used to model instances of Hyperties running in devices and servers.\n*/\nvar HypertyInstance = function (_RegistryDataModel) {\n (0, _inherits3.default)(HypertyInstance, _RegistryDataModel);\n\n function HypertyInstance(id, url, descriptorURL, descriptor, hypertyURL, user, guid, runtime, context, p2pHandler, p2pRequester, dataSchemes, resources, startingTime, lastModified) {\n (0, _classCallCheck3.default)(this, HypertyInstance);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (HypertyInstance.__proto__ || (0, _getPrototypeOf2.default)(HypertyInstance)).call(this, id, url, descriptorURL, p2pRequester, startingTime, lastModified));\n\n var _this = _this2;\n _this._descriptor = descriptor;\n _this._hypertyURL = hypertyURL;\n _this._user = user;\n _this._guid = guid;\n _this._runtime = runtime;\n _this._context = context;\n _this._p2pHandler = p2pHandler;\n _this._dataSchemes = dataSchemes;\n _this._resources = resources;\n return _this2;\n }\n\n (0, _createClass3.default)(HypertyInstance, [{\n key: 'user',\n set: function set(identity) {\n var _this = this;\n _this.user = identity;\n },\n get: function get() {\n var _this = this;\n return _this._user;\n }\n }, {\n key: 'hypertyURL',\n get: function get() {\n var _this = this;\n return _this._hypertyURL;\n }\n }, {\n key: 'descriptor',\n get: function get() {\n var _this = this;\n return _this._descriptor;\n }\n }, {\n key: 'objectName',\n get: function get() {\n var _this = this;\n return _this._descriptor._objectName;\n }\n }, {\n key: 'p2pHandler',\n get: function get() {\n var _this = this;\n return _this._p2pHandler;\n }\n }, {\n key: 'dataSchemes',\n get: function get() {\n var _this = this;\n return _this._dataSchemes;\n }\n }, {\n key: 'resources',\n get: function get() {\n var _this = this;\n return _this._resources;\n }\n }, {\n key: 'runtimeURL',\n get: function get() {\n var _this = this;\n return _this._runtime;\n }\n }]);\n return HypertyInstance;\n}(_RegistryDataModel3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = HypertyInstance;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9IeXBlcnR5SW5zdGFuY2UuanM/Zjg1OSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaX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UNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUEzREE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQThEQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///212\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nexports.WatchingYou = undefined;\n\nvar _WatchingYou = __webpack_require__(508);\n\nvar _WatchingYou2 = _interopRequireDefault(_WatchingYou);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.WatchingYou = _WatchingYou2.default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9VdGlscy5qcz9hMmM0Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBXYXRjaGluZ1lvdSBmcm9tICcuL3V0aWxzL1dhdGNoaW5nWW91JztcblxuZXhwb3J0IHsgV2F0Y2hpbmdZb3UgfTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvVXRpbHMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTtBQUNBOzs7OztBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///213\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _isInteger = __webpack_require__(510);\n\nvar _isInteger2 = _interopRequireDefault(_isInteger);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Utils = __webpack_require__(213);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('IdentityModule'); // Log System\n\n/**\n* The Identity Data Model is used to model the reTHINK User entity. The Identity data model is handled by Identity Management functionality.\n*\n*/\nvar Identities = function () {\n function Identities(type, storageManager) {\n (0, _classCallCheck3.default)(this, Identities);\n\n var _this = this;\n\n _this._watchingYou = new _Utils.WatchingYou();\n\n _this._storageManager = storageManager;\n _this._guid;\n _this._type = type;\n _this._identities = {};\n _this._accessTokens = _this.watchingYou.watch('accessTokens', {}, true);\n }\n\n (0, _createClass3.default)(Identities, [{\n key: 'reset',\n value: function reset() {\n this._identities = {};\n console.log(this);\n this.currentIdentity = undefined;\n this.defaultIdentity = undefined;\n }\n }, {\n key: 'getIdentity',\n value: function getIdentity(identifier) {\n return (0, _assign2.default)({}, this._identities[identifier]);\n }\n }, {\n key: 'loadIdentities',\n value: function loadIdentities() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n\n _this._storageManager.get(null, null, 'identities').then(function (identities) {\n\n log.info('[Identities.Load Identities] identities: ', identities);\n\n if (identities) {\n _this._identities = identities;\n\n // let's set as default identity the one that expires later\n\n _this.identifiers.forEach(function (id) {\n var timeNow = (0, _utils.secondsSinceEpoch)();\n var identity = _this._identities[id];\n var expires = identity.expires;\n\n // if (!identity.hasOwnProperty('interworking')\n // || !identity.interworking) {\n _this.defaultIdentity = id;\n\n if (parseInt(expires) > timeNow) {\n _this.defaultIdentity.expires = parseInt(expires);\n _this.currentIdentity = id;\n }\n });\n }\n\n resolve();\n });\n });\n }\n }, {\n key: 'loadAccessTokens',\n value: function loadAccessTokens() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n\n _this._storageManager.get('accessTokens').then(function (accessTokens) {\n\n if (accessTokens) _this._accessTokens = accessTokens;\n resolve();\n });\n });\n }\n\n // to confirm if this function is required when the App constraints the identity selection\n\n }, {\n key: 'addIdentity',\n value: function addIdentity(identity) {\n var _this2 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (_this._isValid(identity)) {\n var id = identity.identifiers[0];\n (0, _assign2.default)(_this2._identities[id], identity);\n _this2._storeIdentity(identity).then(function () {\n _this2._identities[id].status = 'created';\n resolve();\n });\n } else {\n reject('[Identities.addIdentity] invalid IdAssertion');\n }\n });\n }\n }, {\n key: 'addAssertion',\n value: function addAssertion(assertion) {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (_this._isValid(assertion)) {\n assertion.userProfile.guid = _this._guid;\n var userUrl = assertion.userProfile.userURL;\n if (!_this.identities[userUrl]) _this._identities[userUrl] = assertion;else _this.identities[userUrl] = assertion;\n\n _this._store().then(function () {\n _this3._identities[userUrl].status = 'created';\n if (_this.defaultIdentity == false) {\n _this.defaultIdentity = userUrl;\n }\n resolve(assertion);\n });\n } else {\n reject('[Identities.addAssertion] invalid IdAssertion: ', assertion);\n }\n });\n }\n }, {\n key: 'removeIdentity',\n value: function removeIdentity(userUrl) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n delete _this.identities[userUrl];\n\n _this._store().then(function () {\n resolve();\n });\n });\n }\n }, {\n key: 'addAccessToken',\n value: function addAccessToken(accessToken) {\n var _this = this;\n log.info('[Identities.addAccessToken] ', accessToken);\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this._isValidAccessToken(accessToken)) {\n\n // let newAccessToken = deepClone(accessToken);\n\n _this._accessTokens[accessToken.domain] = accessToken;\n\n _this._storeAccessTokens().then(function () {\n _this._accessTokens[accessToken.domain].status = 'created';\n resolve(accessToken);\n });\n } else {\n reject('[Identities.addIdentity] invalid AccessToken: ', accessToken);\n }\n });\n }\n }, {\n key: 'setAccessTokenInProgress',\n value: function setAccessTokenInProgress(domain) {\n\n if (this._accessTokens[domain]) this._accessTokens[domain].status = 'in-progress';else this._accessTokens[domain] = { status: 'in-progress' };\n }\n }, {\n key: 'getAccessToken',\n value: function getAccessToken(domain, resources) {\n var accessToken = this._accessTokens[domain];\n\n if (!accessToken) {\n return undefined;\n } else if (resources.every(function (i) {\n return accessToken.resources.indexOf(i) != -1;\n })) {\n return this._accessTokens[domain];\n } else {\n return new Error('[Identities.getAccessToken] Not found for ', domain);\n }\n }\n }, {\n key: 'updateAssertion',\n value: function updateAssertion(assertion) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n var userUrl = assertion.userProfile.userURL;\n\n if (!_this.identities[userUrl]) {\n return reject('[Identities.updateAssertion] Identity not found for ', userUrl);\n } else {\n _this.identities[userUrl] = assertion;\n _this._store().then(function () {\n resolve();\n });\n }\n });\n }\n }, {\n key: 'updateAccessToken',\n value: function updateAccessToken(accessToken) {\n var _this = this;\n log.info('[Identities.updateAccessToken] ', accessToken);\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this._isValidAccessToken(accessToken)) {\n\n _this._accessTokens[accessToken.domain].expires = accessToken.expires;\n _this._accessTokens[accessToken.domain].accessToken = accessToken.accessToken;\n\n _this._storeAccessTokens().then(function () {\n _this._accessTokens[accessToken.domain].status = 'created';\n resolve(accessToken);\n });\n } else {\n reject('[Identities.updateAccessToken] invalid AccessToken: ', accessToken);\n }\n });\n }\n }, {\n key: 'addIdAssertion',\n value: function addIdAssertion(identifier, assertion, idp, scope) {\n var _this = this;\n\n var newIdAssertion = new IdAssertion(assertion, idp, scope);\n\n _this.idAssertionList.push(newIdAssertion);\n }\n\n //TODO: complete with more verifications. To be moved to Identity?\n\n }, {\n key: '_isValid',\n value: function _isValid(identity) {\n if (!identity.hasOwnProperty('assertion')) {\n return false;\n }\n\n var splitedAssertion = identity.assertion.split('.');\n var assertionParsed = void 0;\n\n //verify if the token contains the 3 components, or just the assertion\n try {\n if (splitedAssertion[1]) {\n assertionParsed = (0, _utils.decode)(splitedAssertion[1]);\n } else {\n assertionParsed = (0, _utils.decode)(identity.assertion);\n }\n } catch (err) {\n return false;\n }\n\n return true;\n }\n }, {\n key: '_isValidAccessToken',\n value: function _isValidAccessToken(accessToken) {\n\n if (!accessToken.hasOwnProperty('accessToken')) {\n return false;\n }\n\n if (!accessToken.hasOwnProperty('domain')) {\n return false;\n }\n\n if (!(accessToken.hasOwnProperty('resources') && Array.isArray(accessToken.resources))) {\n return false;\n }\n\n if (!(accessToken.hasOwnProperty('expires') && (0, _isInteger2.default)(accessToken.expires))) {\n return false;\n }\n\n if (!accessToken.hasOwnProperty('input')) {\n return false;\n }\n\n return true;\n }\n\n //TODO: add function to only set one new identity using the new indexed storage manager\n\n }, {\n key: '_store',\n value: function _store() {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var store = (0, _keys2.default)(_this4._identities).map(function (userURL) {\n return _this._storageManager.set(userURL, 0, _this4._identities[userURL], 'identities');\n });\n\n _promise2.default.all(store).then(function () {\n resolve();\n }).catch(function (err) {\n reject('On _sendReporterSessionKey from method storeIdentity error: ' + err);\n });\n });\n }\n }, {\n key: '_storeAccessTokens',\n value: function _storeAccessTokens() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var accessTokens = (0, _utils.deepClone)(_this._accessTokens);\n\n _this._storageManager.set('accessTokens', 0, accessTokens).then(function () {\n resolve();\n }).catch(function (err) {\n reject('On _sendReporterSessionKey from method storeIdentity error: ' + err);\n });\n });\n }\n }, {\n key: 'identities',\n get: function get() {\n return this._identities;\n }\n }, {\n key: 'accessTokens',\n get: function get() {\n return this._accessTokens;\n }\n }, {\n key: 'watchingYou',\n get: function get() {\n return this._watchingYou;\n }\n }, {\n key: 'guid',\n set: function set(guid) {\n this._guid = guid;\n },\n get: function get() {\n return this._guid;\n }\n }, {\n key: 'defaultIdentity',\n set: function set(identifier) {\n if (this.identities[identifier]) this._defaultIdentity = identifier;else throw new Error('[Identities.set defaultIdentity ] Error: identity does not exist here: ', identifier);\n },\n get: function get() {\n if (this._defaultIdentity) return (0, _assign2.default)({}, this.identities[this._defaultIdentity]);else return false;\n }\n }, {\n key: 'currentIdentity',\n set: function set(identifier) {\n if (this.identities[identifier]) this._currentIdentity = identifier;else throw '[Identities.set currentIdentity ] Error: identity does not exist here: ', identifier;\n },\n get: function get() {\n return (0, _assign2.default)({}, this.identities[this._currentIdentity]);\n }\n }, {\n key: 'identifiers',\n get: function get() {\n return (0, _keys2.default)(this._identities);\n }\n }]);\n return Identities;\n}();\n\n// move to Identity service framework?\n\nvar IdAssertion = function () {\n function IdAssertion(assertion, idp, userProfile) {\n (0, _classCallCheck3.default)(this, IdAssertion);\n\n var _this = this;\n\n _this._assertion = assertion;\n _this._idp = idp;\n _this._userProfile = userProfile;\n }\n\n (0, _createClass3.default)(IdAssertion, [{\n key: 'assertion',\n get: function get() {\n return this._assertion;\n }\n }, {\n key: 'idp',\n get: function get() {\n return this._idp;\n }\n }, {\n key: 'userProfile',\n get: function get() {\n return this._userProfile;\n }\n }]);\n return IdAssertion;\n}();\n\nvar IdValidation = function () {\n function IdValidation(identity, contents) {\n (0, _classCallCheck3.default)(this, IdValidation);\n\n var _this = this;\n _this.identity = identity;\n _this.contents = contents;\n }\n\n (0, _createClass3.default)(IdValidation, [{\n key: 'validates',\n value: function validates(identity, contents) {\n //TODO implement the logic\n\n }\n }]);\n return IdValidation;\n}();\n\nexports.default = Identities;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0aWVzLmpzPzM1NjQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdJZGVudGl0eU1vZHVsZScpO1xuXG5pbXBvcnQgeyBkZWNvZGUsIHNlY29uZHNTaW5jZUVwb2NoLCBkZWVwQ2xvbmUgfSBmcm9tICcuLi91dGlscy91dGlscy5qcyc7XG5pbXBvcnQgeyBXYXRjaGluZ1lvdSB9IGZyb20gJy4uL1V0aWxzJztcblxuXG4vKipcbiogVGhlIElkZW50aXR5IERhdGEgTW9kZWwgaXMgdXNlZCB0byBtb2RlbCB0aGUgcmVUSElOSyBVc2VyIGVudGl0eS4gVGhlIElkZW50aXR5IGRhdGEgbW9kZWwgaXMgaGFuZGxlZCBieSBJZGVudGl0eSBNYW5hZ2VtZW50IGZ1bmN0aW9uYWxpdHkuXG4qXG4qL1xuY2xhc3MgSWRlbnRpdGllcyB7XG5cbiAgY29uc3RydWN0b3IodHlwZSwgc3RvcmFnZU1hbmFnZXIpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgX3RoaXMuX3dhdGNoaW5nWW91ID0gbmV3IFdhdGNoaW5nWW91KCk7XG5cbiAgICBfdGhpcy5fc3RvcmFnZU1hbmFnZXIgPSBzdG9yYWdlTWFuYWdlcjtcbiAgICBfdGhpcy5fZ3VpZDtcbiAgICBfdGhpcy5fdHlwZSA9IHR5cGU7XG4gICAgX3RoaXMuX2lkZW50aXRpZXMgPSB7fTtcbiAgICBf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biAgICAgICAgaWYgKGlkZW50aXRpZXMpIHtcbiAgICAgICAgICBfdGhpcy5faWRlbnRpdGllcyA9IGlkZW50aXRpZXM7XG5cbiAgICAgICAgICAvLyBsZXQncyBzZXQgYXMgZGVmYXVsdCBpZGVudGl0eSB0aGUgb25lIHRoYXQgZXhwaXJlcyBsYXRlclxuXG4gICAgICAgICAgX3RoaXMuaWRlbnRpZmllcnMuZm9yRWFjaCgoaWQpID0+IHtcbiAgICAgICAgICAgIGxldCB0aW1lTm93ID0gc2Vjb25kc1NpbmNlRXBvY2goKTtcbiAgICAgICAgICAgIGxldCBpZGVudGl0eSA9IF90aGlzLl9pZGVudGl0aWVzW2lkXTtcbiAgICAgICAgICAgIGxldCBleHBpcmVzID0gaWRlbnRpdHkuZXhwaXJlcztcblxuICAgICAgICAgICAgLy8gICAgICAgICAgICBpZiAoIWlkZW50aXR5Lmhhc093blByb3BlcnR5KCdpbnRlcndvcmtpbmcnKVxuICAgICAgICAgICAgLy8gICAgICAgICAgICB8fCAhaWRlbnRpdHkuaW50ZXJ3b3JraW5nKSB7XG4gICAgICAgICAgICBfdGhpcy5kZWZhdWx0SWRlbnRpdHkgPSBpZDtcblxuICAgICAgICAgICAgaWYgKHBhcnNlSW50KGV4cGlyZXMpID4gdGltZU5vdykge1xuICAgICAgICAgICAgICBfdGhpcy5kZWZhdWx0SWRlbnRpdHkuZXhwaXJlcyA9IHBhcnNlSW50KGV4cGlyZXMpO1xuICAgICAgICAgICAgICBfdGhpcy5jdXJyZW50SWRlbnRpdHkgPSBpZDtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0pO1xuICAgICAgICB9XG5cbiAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgfSk7XG4gICAgfSk7XG4gIH1cblxuICBsb2FkQWNjZXNzVG9rZW5zKCkge1xuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlKSA9PiB7XG5cbiAgICAg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0E7Ozs7O0FBc1JBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7OztBQUlBO0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBR0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///214\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar AllowOverrides = function () {\n function AllowOverrides() {\n (0, _classCallCheck3.default)(this, AllowOverrides);\n }\n\n (0, _createClass3.default)(AllowOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorization decisions, prioritizes a positive one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return AllowOverrides;\n}();\n\nexports.default = AllowOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9BbGxvd092ZXJyaWRlcy5qcz80YzQ3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wIC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XG4gICogQHBhcmFtICAgIHtib29sZWFuW119ICAgZGVjaXNpb25zXG4gICogQHJldHVybnMgIHtib29sZWFufVxuICAqL1xuICBjb21iaW5lKGRlY2lzaW9ucykge1xuICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZih0cnVlKSAhPT0gLTEpIHtcbiAgICAgIHJldHVybiB0cnVlO1xuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoZGVjaXNpb25zLmluZGV4T2YoZmFsc2UpICE9PSAtMSkge1xuICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gJ05vdCBBcHBsaWNhYmxlJztcbiAgICAgIH1cbiAgICB9XG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBBbGxvd092ZXJyaWRlcztcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcG9saWN5L2NvbWJpbmluZ0FsZ29yaXRobXMvQWxsb3dPdmVycmlkZXMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///215\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar BlockOverrides = function () {\n function BlockOverrides() {\n (0, _classCallCheck3.default)(this, BlockOverrides);\n }\n\n (0, _createClass3.default)(BlockOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, prioritises a negative one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return BlockOverrides;\n}();\n\nexports.default = BlockOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9CbG9ja092ZXJyaWRlcy5qcz82MWM3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOn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Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///216\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar FirstApplicable = function () {\n function FirstApplicable() {\n (0, _classCallCheck3.default)(this, FirstApplicable);\n }\n\n (0, _createClass3.default)(FirstApplicable, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, returns the first one different from 'Not Applicable', either positive or negative.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n for (var i in decisions) {\n if (decisions[i] !== 'Not Applicable') {\n return decisions[i];\n }\n }\n return 'Not Applicable';\n }\n }]);\n return FirstApplicable;\n}();\n\nexports.default = FirstApplicable;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9GaXJzdEFwcGxpY2FibGUuanM/MzNkZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBM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SAgICAgZGVjaXNpb25zXG4gICogQHJldHVybnMgIHtib29sZWFufVxuICAqL1xuICBjb21iaW5lKGRlY2lzaW9ucykge1xuICAgIGZvciAobGV0IGkgaW4gZGVjaXNpb25zKSB7XG4gICAgICBpZiAoZGVjaXNpb25zW2ldICE9PSAnTm90IEFwcGxpY2FibGUnKSB7XG4gICAgICAgIHJldHVybiBkZWNpc2lvbnNbaV07XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiAnTm90IEFwcGxpY2FibGUnO1xuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgRmlyc3RBcHBsaWNhYmxlO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9GaXJzdEFwcGxpY2FibGUuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///217\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.storage = storage;\nexports.createSyncDB = createSyncDB;\n\nvar _runtimeConfiguration = __webpack_require__(151);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar storages = {};\n\nfunction storage(runtimeFactory, runtimeStatusUpdate) {\n if (!runtimeFactory) throw new Error('The runtime factory is a needed parameter');\n\n (0, _keys2.default)(_runtimeConfiguration.runtimeConfiguration.storageSchemas).forEach(function (key) {\n\n if (!storages.hasOwnProperty(key)) {\n storages[key] = runtimeFactory.storageManager(key, _runtimeConfiguration.runtimeConfiguration.storageSchemas[key], runtimeStatusUpdate);\n }\n });\n\n return storages;\n}\n\nfunction createSyncDB(key, runtimeFactory, schema, runtimeStatusUpdate) {\n var url = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n if (!runtimeFactory) throw new Error('The runtime factory is a needed parameter');\n\n var remote = url ? url : _runtimeConfiguration.runtimeConfiguration.remoteStorage;\n\n return runtimeFactory.storageManager(key, schema, runtimeStatusUpdate, remote);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL1N0b3JhZ2UuanM/ZTk0NyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBydW50aW1lQ29uZmlndXJhdGlvbiB9IGZyb20gJy4vcnVudGltZUNvbmZpZ3VyYXRpb24nO1xuXG5sZXQgc3RvcmFnZXMgPSB7fTtcblxuZXhwb3J0IGZ1bmN0aW9uIHN0b3JhZ2UocnVudGltZUZhY3RvcnksIHJ1bnRpbWVTdGF0dXNVcGRhdGUpIHtcbiAgaWYgKCFydW50aW1lRmFjdG9yeSkgdGhyb3cgbmV3IEVycm9yKCdUaGUgcnVudGltZSBmYWN0b3J5IGlzIGEgbmVlZGVkIHBhcmFtZXRlcicpO1xuXG4gIE9iamVjdC5rZXlzKHJ1bnRpbWVDb25maWd1cmF0aW9uLnN0b3JhZ2VTY2hlbWFzKS5mb3JFYWNoKChrZXkpID0+IHtcblxuICAgIGlmICghc3RvcmFnZXMuaGFzT3duUHJvcGVydHkoa2V5KSkge1xuICAgICAgc3RvcmFnZXNba2V5XSA9IHJ1bnRpbWVGYWN0b3J5LnN0b3JhZ2VNYW5hZ2VyKGtleSwgcnVudGltZUNvbmZpZ3VyYXRpb24uc3RvcmFnZVNjaGVtYXNba2V5XSwgcnVudGltZVN0YXR1c1VwZGF0ZSk7XG4gICAgfVxuXG4gIH0pO1xuXG4gIHJldHVybiBzdG9yYWdlcztcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGNyZWF0ZVN5bmNEQihrZXksIHJ1bnRpbWVGYWN0b3J5LCBzY2hlbWEsIHJ1bnRpbWVTdGF0dXNVcGRhdGUsIHVybCA9IGZhbHNlKSB7XG4gIGlmICghcnVudGltZUZhY3RvcnkpIHRocm93IG5ldyBFcnJvcignVGhlIHJ1bnRpbWUgZmFjdG9yeSBpcyBhIG5lZWRlZCBwYXJhbWV0ZXInKTtcblxuICBsZXQgcmVtb3RlID0gdXJsID8gdXJsIDogcnVudGltZUNvbmZpZ3VyYXRpb24ucmVtb3RlU3RvcmFnZTtcblxuICByZXR1cm4gcnVudGltZUZhY3Rvcnkuc3RvcmFnZU1hbmFnZXIoa2V5LCBzY2hlbWEsIHJ1bnRpbWVTdGF0dXNVcGRhdGUsIHJlbW90ZSk7XG5cbn1cblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcnVudGltZS9TdG9yYWdlLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBSUE7QUFjQTtBQUNBO0FBbkJBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///218\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(532), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9hcnJheS9mcm9tLmpzPzczZjQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2FycmF5L2Zyb21cIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvYXJyYXkvZnJvbS5qc1xuLy8gbW9kdWxlIGlkID0gMjE5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///219\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(539), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvdmFsdWVzLmpzPzgxMTEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC92YWx1ZXNcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L3ZhbHVlcy5qc1xuLy8gbW9kdWxlIGlkID0gMjIwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///220\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('SynSubscription'); // Log System\n\nvar Subscription = function () {\n function Subscription(bus, owner, url, isReporter) {\n (0, _classCallCheck3.default)(this, Subscription);\n\n var _this = this;\n var childBaseURL = url + '/children/';\n var changeURL = url + '/changes';\n\n //process delete message\n _this._deleteListener = bus.addListener(changeURL, function (msg) {\n if (msg.type === 'delete') {\n log.log('Subscription-DELETE: ', msg);\n\n //FLOW-OUT: message sent to all subscribers\n var deleteMessageToHyperty = {\n type: 'delete', from: msg.from, to: owner,\n body: { identity: msg.body.identity, resource: url }\n };\n\n //send delete to hyperty\n bus.postMessage(deleteMessageToHyperty, function (reply) {\n log.log('Subscription-DELETE-REPLY: ', reply);\n if (reply.body.code === 200) {\n _this._releaseListeners();\n }\n });\n }\n });\n\n //add change publish address or forward\n if (isReporter) {\n _this._changeListener = bus.addPublish(changeURL);\n } else {\n _this._changeListener = bus.addForward(changeURL, owner);\n }\n\n _this._childrenListeners = [];\n // log.log('[Subscription] - childID', childrens);\n // childrens.forEach((child) => {\n // let childId = childBaseURL + child;\n\n // log.log('[Subscription] - childID', childBaseURL);\n\n //add children publish address\n var childrenForward = bus.addPublish(childBaseURL);\n _this._childrenListeners.push(childrenForward);\n\n //add self forward if an observer\n if (!isReporter) {\n var selfForward = bus.addForward(childBaseURL, owner);\n _this._childrenListeners.push(selfForward);\n }\n // });\n }\n\n (0, _createClass3.default)(Subscription, [{\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._deleteListener.remove();\n\n _this._changeListener.remove();\n\n _this._childrenListeners.forEach(function (forward) {\n forward.remove();\n });\n }\n }]);\n return Subscription;\n}();\n\nexports.default = Subscription;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1N1YnNjcmlwdGlvbi5qcz8yZTg1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignU3luU3Vic2NyaXB0aW9uJyk7XG5cbmNsYXNzIFN1YnNjcmlwdGlvbiB7XG5cbiAgY29uc3RydWN0b3IoYnVzLCBvd25lciwgdXJsLCBpc1JlcG9ydGVyKSB7XG4gICAgbGV0IF90aGlzID0gdGhpcztcbiAgICBsZXQgY2hpbGRCYXNlVVJMID0gdXJsICsgJy9jaGlsZHJlbi8nO1xuICAgIGxldCBjaGFuZ2VVUkwgPSB1cmwgKyAnL2NoYW5nZXMnO1xuXG4gICAgLy9wcm9jZXNzIGRlbGV0ZSBtZXNzYWdlXG4gICAgX3RoaXMuX2RlbGV0ZUxpc3RlbmVyID0gYnVzLmFkZExpc3RlbmVyKGNoYW5nZVVSTCwgKG1zZykgPT4ge1xuICAgICAgaWYgKG1zZy50eXBlID09PSAnZGVsZX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9uO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9zeW5jaGVyL1N1YnNjcmlwdGlvbi5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7QUFDQTtBQUNBO0FBREE7QUFDQTs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFFQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///221\n")},function(e,n,t){t(223),e.exports=t(425)},function(module,exports,__webpack_require__){"use strict";eval('/* WEBPACK VAR INJECTION */(function(global) {\n\n__webpack_require__(224);\n\n__webpack_require__(421);\n\n__webpack_require__(422);\n\nif (global._babelPolyfill) {\n throw new Error("only one instance of babel-polyfill is allowed");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = "defineProperty";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, "padLeft", "".padStart);\ndefine(String.prototype, "padRight", "".padEnd);\n\n"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(154)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXBvbHlmaWxsL2xpYi9pbmRleC5qcz84ZjU4Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5yZXF1aXJlKFwiY29yZS1qcy9zaGltXCIpO1xuXG5yZXF1aXJlKFwicmVnZW5lcmF0b3ItcnVudGltZS9ydW50aW1lXCIpO1xuXG5yZXF1aXJlKFwiY29yZS1qcy9mbi9yZWdleHAvZXNjYXBlXCIpO1xuXG5pZiAoZ2xvYmFsLl9iYWJlbFBvbHlmaWxsKSB7XG4gIHRocm93IG5ldyBFcnJvcihcIm9ubHkgb25lIGluc3RhbmNlIG9mIGJhYmVsLXBvbHlmaWxsIGlzIGFsbG93ZWRcIik7XG59XG5nbG9iYWwuX2JhYmVsUG9seWZpbGwgPSB0cnVlO1xuXG52YXIgREVGSU5FX1BST1BFUlRZID0gXCJkZWZpbmVQcm9wZXJ0eVwiO1xuZnVuY3Rpb24gZGVmaW5lKE8sIGtleSwgdmFsdWUpIHtcbiAgT1trZXldIHx8IE9iamVjdFtERUZJTkVfUFJPUEVSVFldKE8sIGtleSwge1xuICAgIHdyaXRhYmxlOiB0cnVlLFxuICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICB2YWx1ZTogdmFsdWVcbiAgfSk7XG59XG5cbmRlZmluZShTdHJpbmcucHJvdG90eXBlLCBcInBhZExlZnRcIiwgXCJcIi5wYWRTdGFydCk7XG5kZWZpbmUoU3RyaW5nLnByb3RvdHlwZSwgXCJwYWRSaWdodFwiLCBcIlwiLnBhZEVuZCk7XG5cblwicG9wLHJldmVyc2Usc2hpZnQsa2V5cyx2YWx1ZXMsZW50cmllcyxpbmRleE9mLGV2ZXJ5LHNvbWUsZm9yRWFjaCxtYXAsZmlsdGVyLGZpbmQsZmluZEluZGV4LGluY2x1ZGVzLGpvaW4sc2xpY2UsY29uY2F0LHB1c2gsc3BsaWNlLHVuc2hpZnQsc29ydCxsYXN0SW5kZXhPZixyZWR1Y2UscmVkdWNlUmlnaHQsY29weVdpdGhpbixmaWxsXCIuc3BsaXQoXCIsXCIpLmZvckVhY2goZnVuY3Rpb24gKGtleSkge1xuICBbXVtrZXldICYmIGRlZmluZShBcnJheSwga2V5LCBGdW5jdGlvbi5jYWxsLmJpbmQoW11ba2V5XSkpO1xufSk7XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcG9seWZpbGwvbGliL2luZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSAyMjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///223\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(225);\n__webpack_require__(227);\n__webpack_require__(228);\n__webpack_require__(229);\n__webpack_require__(230);\n__webpack_require__(231);\n__webpack_require__(232);\n__webpack_require__(233);\n__webpack_require__(234);\n__webpack_require__(235);\n__webpack_require__(236);\n__webpack_require__(237);\n__webpack_require__(238);\n__webpack_require__(239);\n__webpack_require__(240);\n__webpack_require__(241);\n__webpack_require__(243);\n__webpack_require__(244);\n__webpack_require__(245);\n__webpack_require__(246);\n__webpack_require__(247);\n__webpack_require__(248);\n__webpack_require__(249);\n__webpack_require__(250);\n__webpack_require__(251);\n__webpack_require__(252);\n__webpack_require__(253);\n__webpack_require__(254);\n__webpack_require__(255);\n__webpack_require__(256);\n__webpack_require__(257);\n__webpack_require__(258);\n__webpack_require__(259);\n__webpack_require__(260);\n__webpack_require__(261);\n__webpack_require__(262);\n__webpack_require__(263);\n__webpack_require__(264);\n__webpack_require__(265);\n__webpack_require__(266);\n__webpack_require__(267);\n__webpack_require__(268);\n__webpack_require__(269);\n__webpack_require__(270);\n__webpack_require__(271);\n__webpack_require__(272);\n__webpack_require__(273);\n__webpack_require__(274);\n__webpack_require__(275);\n__webpack_require__(276);\n__webpack_require__(277);\n__webpack_require__(278);\n__webpack_require__(279);\n__webpack_require__(280);\n__webpack_require__(281);\n__webpack_require__(282);\n__webpack_require__(283);\n__webpack_require__(284);\n__webpack_require__(285);\n__webpack_require__(286);\n__webpack_require__(287);\n__webpack_require__(288);\n__webpack_require__(289);\n__webpack_require__(290);\n__webpack_require__(291);\n__webpack_require__(292);\n__webpack_require__(293);\n__webpack_require__(294);\n__webpack_require__(295);\n__webpack_require__(296);\n__webpack_require__(297);\n__webpack_require__(298);\n__webpack_require__(299);\n__webpack_require__(300);\n__webpack_require__(301);\n__webpack_require__(302);\n__webpack_require__(303);\n__webpack_require__(305);\n__webpack_require__(306);\n__webpack_require__(308);\n__webpack_require__(309);\n__webpack_require__(310);\n__webpack_require__(311);\n__webpack_require__(312);\n__webpack_require__(313);\n__webpack_require__(314);\n__webpack_require__(316);\n__webpack_require__(317);\n__webpack_require__(318);\n__webpack_require__(319);\n__webpack_require__(320);\n__webpack_require__(321);\n__webpack_require__(322);\n__webpack_require__(323);\n__webpack_require__(324);\n__webpack_require__(325);\n__webpack_require__(326);\n__webpack_require__(327);\n__webpack_require__(328);\n__webpack_require__(127);\n__webpack_require__(329);\n__webpack_require__(330);\n__webpack_require__(173);\n__webpack_require__(331);\n__webpack_require__(332);\n__webpack_require__(333);\n__webpack_require__(334);\n__webpack_require__(335);\n__webpack_require__(176);\n__webpack_require__(178);\n__webpack_require__(179);\n__webpack_require__(336);\n__webpack_require__(337);\n__webpack_require__(338);\n__webpack_require__(339);\n__webpack_require__(340);\n__webpack_require__(341);\n__webpack_require__(342);\n__webpack_require__(343);\n__webpack_require__(344);\n__webpack_require__(345);\n__webpack_require__(346);\n__webpack_require__(347);\n__webpack_require__(348);\n__webpack_require__(349);\n__webpack_require__(350);\n__webpack_require__(351);\n__webpack_require__(352);\n__webpack_require__(353);\n__webpack_require__(354);\n__webpack_require__(355);\n__webpack_require__(356);\n__webpack_require__(357);\n__webpack_require__(358);\n__webpack_require__(359);\n__webpack_require__(360);\n__webpack_require__(361);\n__webpack_require__(362);\n__webpack_require__(363);\n__webpack_require__(364);\n__webpack_require__(365);\n__webpack_require__(366);\n__webpack_require__(367);\n__webpack_require__(368);\n__webpack_require__(369);\n__webpack_require__(370);\n__webpack_require__(371);\n__webpack_require__(372);\n__webpack_require__(373);\n__webpack_require__(374);\n__webpack_require__(375);\n__webpack_require__(376);\n__webpack_require__(377);\n__webpack_require__(378);\n__webpack_require__(379);\n__webpack_require__(380);\n__webpack_require__(381);\n__webpack_require__(382);\n__webpack_require__(383);\n__webpack_require__(384);\n__webpack_require__(385);\n__webpack_require__(386);\n__webpack_require__(387);\n__webpack_require__(388);\n__webpack_require__(389);\n__webpack_require__(390);\n__webpack_require__(391);\n__webpack_require__(392);\n__webpack_require__(393);\n__webpack_require__(394);\n__webpack_require__(395);\n__webpack_require__(396);\n__webpack_require__(397);\n__webpack_require__(398);\n__webpack_require__(399);\n__webpack_require__(400);\n__webpack_require__(401);\n__webpack_require__(402);\n__webpack_require__(403);\n__webpack_require__(404);\n__webpack_require__(405);\n__webpack_require__(406);\n__webpack_require__(407);\n__webpack_require__(408);\n__webpack_require__(409);\n__webpack_require__(410);\n__webpack_require__(411);\n__webpack_require__(412);\n__webpack_require__(413);\n__webpack_require__(414);\n__webpack_require__(415);\n__webpack_require__(416);\n__webpack_require__(417);\n__webpack_require__(418);\n__webpack_require__(419);\n__webpack_require__(420);\nmodule.exports = __webpack_require__(31);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvc2hpbS5qcz9lMGNkIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vbW9kdWxlcy9lczYuc3ltYm9sJyk7XG5yZXF1aXJlKCcuL21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUnKTtcbnJlcXVpcmUoJy4vbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eScpO1xucmVxdWlyZSgnLi9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnRpZXMnKTtcbnJlcXVpcmUoJy4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvcicpO1xucmVxdWlyZSgnLi9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZicpO1xucmVxdWlyZSgnLi9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cycpO1xucmVxdWlyZSgnLi9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1uYW1lcycpO1xucmVxdWlyZSgnLi9tb2R1bGVzL2VzNi5vYmplY3QuZnJlZXplJyk7XG5yZXF1aXJlKCcuL21vZHVsZXMvZXM2Lm9iamVjdC5zZWFsJyk7XG5yZXF1aXJlKCcuL21vZHVsZXMvZXM2Lm9iamVjdC5wcmV2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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///224\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(7);\nvar has = __webpack_require__(27);\nvar DESCRIPTORS = __webpack_require__(12);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(24);\nvar META = __webpack_require__(47).KEY;\nvar $fails = __webpack_require__(8);\nvar shared = __webpack_require__(83);\nvar setToStringTag = __webpack_require__(64);\nvar uid = __webpack_require__(53);\nvar wks = __webpack_require__(10);\nvar wksExt = __webpack_require__(156);\nvar wksDefine = __webpack_require__(107);\nvar enumKeys = __webpack_require__(226);\nvar isArray = __webpack_require__(86);\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar toIObject = __webpack_require__(28);\nvar toPrimitive = __webpack_require__(36);\nvar createDesc = __webpack_require__(52);\nvar _create = __webpack_require__(56);\nvar gOPNExt = __webpack_require__(159);\nvar $GOPD = __webpack_require__(29);\nvar $DP = __webpack_require__(13);\nvar $keys = __webpack_require__(54);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(57).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(74).f = $propertyIsEnumerable;\n __webpack_require__(85).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(48)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(23)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2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TtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///225\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(54);\nvar gOPS = __webpack_require__(85);\nvar pIE = __webpack_require__(74);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZW51bS1rZXlzLmpzPzBiZTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gYWxsIGVudW1lcmFibGUgb2JqZWN0IGtleXMsIGluY2x1ZGVzIHN5bWJvbHNcbnZhciBnZXRLZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcbnZhciBnT1BTID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcHMnKTtcbnZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICB2YXIgcmVzdWx0ID0gZ2V0S2V5cyhpdCk7XG4gIHZhciBnZXRTeW1ib2xzID0gZ09QUy5mO1xuICBpZiAoZ2V0U3ltYm9scykge1xuICAgIHZhciBzeW1ib2xzID0gZ2V0U3ltYm9scyhpdCk7XG4gICAgdmFyIGlzRW51bSA9IHBJRS5mO1xuICAgIHZhciBpID0gMDtcbiAgICB2YXIga2V5O1xuICAgIHdoaWxlIChzeW1ib2xzLmxlbmd0aCA+IGkpIGlmIChpc0VudW0uY2FsbChpdCwga2V5ID0gc3ltYm9sc1tpKytdKSkgcmVzdWx0LnB1c2goa2V5KTtcbiAgfSByZXR1cm4gcmVzdWx0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZW51bS1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///226\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(56) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZS5qcz84YmFmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4vLyAxOS4xLjIuMiAvIDE1LjIuMy41IE9iamVjdC5jcmVhdGUoTyBbLCBQcm9wZXJ0aWVzXSlcbiRleHBvcnQoJGV4cG9ydC5TLCAnT2JqZWN0JywgeyBjcmVhdGU6IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjI3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///227\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(12), 'Object', { defineProperty: __webpack_require__(13).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eS5qcz80MzMyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4vLyAxOS4xLjIuNCAvIDE1LjIuMy42IE9iamVjdC5kZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSwgJ09iamVjdCcsIHsgZGVmaW5lUHJvcGVydHk6IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDIyOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///228\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !__webpack_require__(12), 'Object', { defineProperties: __webpack_require__(158) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzPzFlMTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4zIC8gMTUuMi4zLjcgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnRpZXM6IHJlcXVpcmUoJy4vX29iamVjdC1kcHMnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///229\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(28);\nvar $getOwnPropertyDescriptor = __webpack_require__(29).f;\n\n__webpack_require__(39)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qcz8wYmVlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi42IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoTywgUClcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgJGdldE93blByb3BlcnR5RGVzY3JpcHRvciA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJykuZjtcblxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3InLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSkge1xuICAgIHJldHVybiAkZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKHRvSU9iamVjdChpdCksIGtleSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gMjMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///230\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(19);\nvar $getPrototypeOf = __webpack_require__(30);\n\n__webpack_require__(39)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1wcm90b3R5cGUtb2YuanM/NWI4NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuOSBPYmplY3QuZ2V0UHJvdG90eXBlT2YoTylcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyICRnZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcblxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdnZXRQcm90b3R5cGVPZicsIGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGdldFByb3RvdHlwZU9mKGl0KSB7XG4gICAgcmV0dXJuICRnZXRQcm90b3R5cGVPZih0b09iamVjdChpdCkpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///231\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(19);\nvar $keys = __webpack_require__(54);\n\n__webpack_require__(39)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmtleXMuanM/YjQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMTQgT2JqZWN0LmtleXMoTylcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcblxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdrZXlzJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gZnVuY3Rpb24ga2V5cyhpdCkge1xuICAgIHJldHVybiAka2V5cyh0b09iamVjdChpdCkpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///232\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.7 Object.getOwnPropertyNames(O)\n__webpack_require__(39)('getOwnPropertyNames', function () {\n return __webpack_require__(159).f;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktbmFtZXMuanM/NzgyZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuNyBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhPKVxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdnZXRPd25Qcm9wZXJ0eU5hbWVzJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4tZXh0JykuZjtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1uYW1lcy5qc1xuLy8gbW9kdWxlIGlkID0gMjMzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///233\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.5 Object.freeze(O)\nvar isObject = __webpack_require__(9);\nvar meta = __webpack_require__(47).onFreeze;\n\n__webpack_require__(39)('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmZyZWV6ZS5qcz81NTM5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi41IE9iamVjdC5mcmVlemUoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG1ldGEgPSByZXF1aXJlKCcuL19tZXRhJykub25GcmVlemU7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnZnJlZXplJywgZnVuY3Rpb24gKCRmcmVlemUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGZyZWV6ZShpdCkge1xuICAgIHJldHVybiAkZnJlZXplICYmIGlzT2JqZWN0KGl0KSA/ICRmcmVlemUobWV0YShpdCkpIDogaXQ7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmZyZWV6ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///234\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.17 Object.seal(O)\nvar isObject = __webpack_require__(9);\nvar meta = __webpack_require__(47).onFreeze;\n\n__webpack_require__(39)('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnNlYWwuanM/NWJmMiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMTcgT2JqZWN0LnNlYWwoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG1ldGEgPSByZXF1aXJlKCcuL19tZXRhJykub25GcmVlemU7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnc2VhbCcsIGZ1bmN0aW9uICgkc2VhbCkge1xuICByZXR1cm4gZnVuY3Rpb24gc2VhbChpdCkge1xuICAgIHJldHVybiAkc2VhbCAmJiBpc09iamVjdChpdCkgPyAkc2VhbChtZXRhKGl0KSkgOiBpdDtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3Quc2VhbC5qc1xuLy8gbW9kdWxlIGlkID0gMjM1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///235\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = __webpack_require__(9);\nvar meta = __webpack_require__(47).onFreeze;\n\n__webpack_require__(39)('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnByZXZlbnQtZXh0ZW5zaW9ucy5qcz82Mzk3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNSBPYmplY3QucHJldmVudEV4dGVuc2lvbnMoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG1ldGEgPSByZXF1aXJlKCcuL19tZXRhJykub25GcmVlemU7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgncHJldmVudEV4dGVuc2lvbnMnLCBmdW5jdGlvbiAoJHByZXZlbnRFeHRlbnNpb25zKSB7XG4gIHJldHVybiBmdW5jdGlvbiBwcmV2ZW50RXh0ZW5zaW9ucyhpdCkge1xuICAgIHJldHVybiAkcHJldmVudEV4dGVuc2lvbnMgJiYgaXNPYmplY3QoaXQpID8gJHByZXZlbnRFeHRlbnNpb25zKG1ldGEoaXQpKSA6IGl0O1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5wcmV2ZW50LWV4dGVuc2lvbnMuanNcbi8vIG1vZHVsZSBpZCA9IDIzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///236\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.12 Object.isFrozen(O)\nvar isObject = __webpack_require__(9);\n\n__webpack_require__(39)('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLWZyb3plbi5qcz81YTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xMiBPYmplY3QuaXNGcm96ZW4oTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2lzRnJvemVuJywgZnVuY3Rpb24gKCRpc0Zyb3plbikge1xuICByZXR1cm4gZnVuY3Rpb24gaXNGcm96ZW4oaXQpIHtcbiAgICByZXR1cm4gaXNPYmplY3QoaXQpID8gJGlzRnJvemVuID8gJGlzRnJvemVuKGl0KSA6IGZhbHNlIDogdHJ1ZTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3QuaXMtZnJvemVuLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///237\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.13 Object.isSealed(O)\nvar isObject = __webpack_require__(9);\n\n__webpack_require__(39)('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLXNlYWxlZC5qcz9mYjI4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xMyBPYmplY3QuaXNTZWFsZWQoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2lzU2VhbGVkJywgZnVuY3Rpb24gKCRpc1NlYWxlZCkge1xuICByZXR1cm4gZnVuY3Rpb24gaXNTZWFsZWQoaXQpIHtcbiAgICByZXR1cm4gaXNPYmplY3QoaXQpID8gJGlzU2VhbGVkID8gJGlzU2VhbGVkKGl0KSA6IGZhbHNlIDogdHJ1ZTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3QuaXMtc2VhbGVkLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///238\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.11 Object.isExtensible(O)\nvar isObject = __webpack_require__(9);\n\n__webpack_require__(39)('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLWV4dGVuc2libGUuanM/ODBmYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMTEgT2JqZWN0LmlzRXh0ZW5zaWJsZShPKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnaXNFeHRlbnNpYmxlJywgZnVuY3Rpb24gKCRpc0V4dGVuc2libGUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGlzRXh0ZW5zaWJsZShpdCkge1xuICAgIHJldHVybiBpc09iamVjdChpdCkgPyAkaXNFeHRlbnNpYmxlID8gJGlzRXh0ZW5zaWJsZShpdCkgOiB0cnVlIDogZmFsc2U7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLWV4dGVuc2libGUuanNcbi8vIG1vZHVsZSBpZCA9IDIzOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///239\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(0);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(160) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmFzc2lnbi5qcz85ZjVkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMy4xIE9iamVjdC5hc3NpZ24odGFyZ2V0LCBzb3VyY2UpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiwgJ09iamVjdCcsIHsgYXNzaWduOiByZXF1aXJlKCcuL19vYmplY3QtYXNzaWduJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5hc3NpZ24uanNcbi8vIG1vZHVsZSBpZCA9IDI0MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///240\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.10 Object.is(value1, value2)\nvar $export = __webpack_require__(0);\n$export($export.S, 'Object', { is: __webpack_require__(242) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLmpzPzlkMWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4zLjEwIE9iamVjdC5pcyh2YWx1ZTEsIHZhbHVlMilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHsgaXM6IHJlcXVpcmUoJy4vX3NhbWUtdmFsdWUnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyNDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///241\n")},function(module,exports){eval("// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2FtZS12YWx1ZS5qcz9lMDg2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMi45IFNhbWVWYWx1ZSh4LCB5KVxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuaXMgfHwgZnVuY3Rpb24gaXMoeCwgeSkge1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gIHJldHVybiB4ID09PSB5ID8geCAhPT0gMCB8fCAxIC8geCA9PT0gMSAvIHkgOiB4ICE9IHggJiYgeSAhPSB5O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2FtZS12YWx1ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjQyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///242\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(0);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(111).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YuanM/OGViMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjMuMTkgT2JqZWN0LnNldFByb3RvdHlwZU9mKE8sIHByb3RvKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbiRleHBvcnQoJGV4cG9ydC5TLCAnT2JqZWN0JywgeyBzZXRQcm90b3R5cGVPZjogcmVxdWlyZSgnLi9fc2V0LXByb3RvJykuc2V0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gMjQzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///243\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.3.6 Object.prototype.toString()\nvar classof = __webpack_require__(75);\nvar test = {};\ntest[__webpack_require__(10)('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n __webpack_require__(24)(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZy5qcz84MTg2Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDE5LjEuMy42IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcoKVxudmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgdGVzdCA9IHt9O1xudGVzdFtyZXF1aXJlKCcuL193a3MnKSgndG9TdHJpbmdUYWcnKV0gPSAneic7XG5pZiAodGVzdCArICcnICE9ICdbb2JqZWN0IHpdJykge1xuICByZXF1aXJlKCcuL19yZWRlZmluZScpKE9iamVjdC5wcm90b3R5cGUsICd0b1N0cmluZycsIGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgIHJldHVybiAnW29iamVjdCAnICsgY2xhc3NvZih0aGlzKSArICddJztcbiAgfSwgdHJ1ZSk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC50by1zdHJpbmcuanNcbi8vIG1vZHVsZSBpZCA9IDI0NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///244\n")},function(module,exports,__webpack_require__){eval("// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Function', { bind: __webpack_require__(161) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24uYmluZC5qcz9kZDBhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjIuMy4yIC8gMTUuMy40LjUgRnVuY3Rpb24ucHJvdG90eXBlLmJpbmQodGhpc0FyZywgYXJncy4uLilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnRnVuY3Rpb24nLCB7IGJpbmQ6IHJlcXVpcmUoJy4vX2JpbmQnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24uYmluZC5qc1xuLy8gbW9kdWxlIGlkID0gMjQ1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///245\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(13).f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(12) && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qcz8xMmU1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgRlByb3RvID0gRnVuY3Rpb24ucHJvdG90eXBlO1xudmFyIG5hbWVSRSA9IC9eXFxzKmZ1bmN0aW9uIChbXiAoXSopLztcbnZhciBOQU1FID0gJ25hbWUnO1xuXG4vLyAxOS4yLjQuMiBuYW1lXG5OQU1FIGluIEZQcm90byB8fCByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmIGRQKEZQcm90bywgTkFNRSwge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogZnVuY3Rpb24gKCkge1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gKCcnICsgdGhpcykubWF0Y2gobmFtZVJFKVsxXTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gJyc7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qc1xuLy8gbW9kdWxlIGlkID0gMjQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///246\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar isObject = __webpack_require__(9);\nvar getPrototypeOf = __webpack_require__(30);\nvar HAS_INSTANCE = __webpack_require__(10)('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(13).f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24uaGFzLWluc3RhbmNlLmpzPzNkYjMiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgSEFTX0lOU1RBTkNFID0gcmVxdWlyZSgnLi9fd2tzJykoJ2hhc0luc3RhbmNlJyk7XG52YXIgRnVuY3Rpb25Qcm90byA9IEZ1bmN0aW9uLnByb3RvdHlwZTtcbi8vIDE5LjIuMy42IEZ1bmN0aW9uLnByb3RvdHlwZVtAQGhhc0luc3RhbmNlXShWKVxuaWYgKCEoSEFTX0lOU1RBTkNFIGluIEZ1bmN0aW9uUHJvdG8pKSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mKEZ1bmN0aW9uUHJvdG8sIEhBU19JTlNUQU5DRSwgeyB2YWx1ZTogZnVuY3Rpb24gKE8pIHtcbiAgaWYgKHR5cGVvZiB0aGlzICE9ICdmdW5jdGlvbicgfHwgIWlzT2JqZWN0KE8pKSByZXR1cm4gZmFsc2U7XG4gIGlmICghaXNPYmplY3QodGhpcy5wcm90b3R5cGUpKSByZXR1cm4gTyBpbnN0YW5jZW9mIHRoaXM7XG4gIC8vIGZvciBlbnZpcm9ubWVudCB3L28gbmF0aXZlIGBAQGhhc0luc3RhbmNlYCBsb2dpYyBlbm91Z2ggYGluc3RhbmNlb2ZgLCBidXQgYWRkIHRoaXM6XG4gIHdoaWxlIChPID0gZ2V0UHJvdG90eXBlT2YoTykpIGlmICh0aGlzLnByb3RvdHlwZSA9PT0gTykgcmV0dXJuIHRydWU7XG4gIHJldHVybiBmYWxzZTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmZ1bmN0aW9uLmhhcy1pbnN0YW5jZS5qc1xuLy8gbW9kdWxlIGlkID0gMjQ3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///247\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseInt = __webpack_require__(163);\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucGFyc2UtaW50LmpzPzRiZTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcGFyc2VJbnQgPSByZXF1aXJlKCcuL19wYXJzZS1pbnQnKTtcbi8vIDE4LjIuNSBwYXJzZUludChzdHJpbmcsIHJhZGl4KVxuJGV4cG9ydCgkZXhwb3J0LkcgKyAkZXhwb3J0LkYgKiAocGFyc2VJbnQgIT0gJHBhcnNlSW50KSwgeyBwYXJzZUludDogJHBhcnNlSW50IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5wYXJzZS1pbnQuanNcbi8vIG1vZHVsZSBpZCA9IDI0OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///248\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseFloat = __webpack_require__(164);\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucGFyc2UtZmxvYXQuanM/MTJmMSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRwYXJzZUZsb2F0ID0gcmVxdWlyZSgnLi9fcGFyc2UtZmxvYXQnKTtcbi8vIDE4LjIuNCBwYXJzZUZsb2F0KHN0cmluZylcbiRleHBvcnQoJGV4cG9ydC5HICsgJGV4cG9ydC5GICogKHBhcnNlRmxvYXQgIT0gJHBhcnNlRmxvYXQpLCB7IHBhcnNlRmxvYXQ6ICRwYXJzZUZsb2F0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5wYXJzZS1mbG9hdC5qc1xuLy8gbW9kdWxlIGlkID0gMjQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///249\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar has = __webpack_require__(27);\nvar cof = __webpack_require__(33);\nvar inheritIfRequired = __webpack_require__(113);\nvar toPrimitive = __webpack_require__(36);\nvar fails = __webpack_require__(8);\nvar gOPN = __webpack_require__(57).f;\nvar gOPD = __webpack_require__(29).f;\nvar dP = __webpack_require__(13).f;\nvar $trim = __webpack_require__(65).trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(__webpack_require__(56)(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = __webpack_require__(12) ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n __webpack_require__(24)(global, NUMBER, $Number);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmNvbnN0cnVjdG9yLmpzPzQwMWIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIGNvZiA9IHJlcXVp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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///250\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toInteger = __webpack_require__(38);\nvar aNumberValue = __webpack_require__(165);\nvar repeat = __webpack_require__(114);\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !__webpack_require__(8)(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnRvLWZpeGVkLmpzPzQxNjIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgYU51bWJlclZhbHVlID0gcmVxdWlyZSgnLi9fYS1udW1iZXItdmFsdWUnKTtcbnZhciByZXBlYXQgPSByZXF1aXJlKCcuL19zdHJpbmctcmVwZWF0Jyk7XG52YXIgJHRvRml4ZWQgPSAxLjAudG9GaXhlZDtcbnZh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IT0geCkgcmV0dXJuICdOYU4nO1xuICAgIGlmICh4IDw9IC0xZTIxIHx8IHggPj0gMWUyMSkgcmV0dXJuIFN0cmluZyh4KTtcbiAgICBpZiAoeCA8IDApIHtcbiAgICAgIHMgPSAnLSc7XG4gICAgICB4ID0gLXg7XG4gICAgfVxuICAgIGlmICh4ID4gMWUtMjEpIHtcbiAgICAgIGUgPSBsb2coeCAqIHBvdygyLCA2OSwgMSkpIC0gNjk7XG4gICAgICB6ID0gZSA8IDAgPyB4ICogcG93KDIsIC1lLCAxKSA6IHggLyBwb3coMiwgZSwgMSk7XG4gICAgICB6ICo9IDB4MTAwMDAwMDAwMDAwMDA7XG4gICAgICBlID0gNTIgLSBlO1xuICAgICAgaWYgKGUgPiAwKSB7XG4gICAgICAgIG11bHRpcGx5KDAsIHopO1xuICAgICAgICBqID0gZjtcbiAgICAgICAgd2hpbGUgKGogPj0gNykge1xuICAgICAgICAgIG11bHRpcGx5KDFlNywgMCk7XG4gICAgICAgICAgaiAtPSA3O1xuICAgICAgICB9XG4gICAgICAgIG11bHRpcGx5KHBvdygxMCwgaiwgMSksIDApO1xuICAgICAgICBqID0gZSAtIDE7XG4gICAgICAgIHdoaWxlIChqID49IDIzKSB7XG4gICAgICAgICAgZGl2aWRlKDEgPDwgMjMpO1xuICAgICAgICAgIGogLT0gMjM7XG4gICAgICAgIH1cbiAgICAgICAgZGl2aWRlKDEgPDwgaik7XG4gICAgICAgIG11bHRpcGx5KDEsIDEpO1xuICAgICAgICBkaXZpZGUoMik7XG4gICAgICAgIG0gPSBudW1Ub1N0cmluZygpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgbXVsdGlwbHkoMCwgeik7XG4gICAgICAgIG11bHRpcGx5KDEgPDwgLWUsIDApO1xuICAgICAgICBtID0gbnVtVG9TdHJpbmcoKSArIHJlcGVhdC5jYWxsKFpFUk8sIGYpO1xuICAgICAgfVxuICAgIH1cbiAgICBpZiAoZiA+IDApIHtcbiAgICAgIGsgPSBt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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///251\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $fails = __webpack_require__(8);\nvar aNumberValue = __webpack_require__(165);\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnRvLXByZWNpc2lvbi5qcz82NTEyIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBhTnVtYmVyVmFsdWUgPSByZXF1aXJlKCcuL19hLW51bWJlci12YWx1ZScpO1xudmFyICR0b1ByZWNpc2lvbiA9IDEuMC50b1ByZWNpc2lvbjtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAoJGZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgLy8gSUU3LVxuICByZXR1cm4gJHRvUHJlY2lzaW9uLmNhbGwoMSwgdW5kZWZpbmVkKSAhPT0gJzEnO1xufSkgfHwgISRmYWlscyhmdW5jdGlvbiAoKSB7XG4gIC8vIFY4IH4gQW5kcm9pZCA0LjMtXG4gICR0b1ByZWNpc2lvbi5jYWxsKHt9KTtcbn0pKSwgJ051bWJlcicsIHtcbiAgdG9QcmVjaXNpb246IGZ1bmN0aW9uIHRvUHJlY2lzaW9uKHByZWNpc2lvbikge1xuICAgIHZhciB0aGF0ID0gYU51bWJlclZhbHVlKHRoaXMsICdOdW1iZXIjdG9QcmVjaXNpb246IGluY29ycmVjdCBpbnZvY2F0aW9uIScpO1xuICAgIHJldHVybiBwcmVjaXNpb24gPT09IHVuZGVmaW5lZCA/ICR0b1ByZWNpc2lvbi5jYWxsKHRoYXQpIDogJHRvUHJlY2lzaW9uLmNhbGwodGhhdCwgcHJlY2lzaW9uKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci50by1wcmVjaXNpb24uanNcbi8vIG1vZHVsZSBpZCA9IDI1MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///252\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.1 Number.EPSILON\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmVwc2lsb24uanM/NGFkYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuMSBOdW1iZXIuRVBTSUxPTlxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdOdW1iZXInLCB7IEVQU0lMT046IE1hdGgucG93KDIsIC01MikgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5lcHNpbG9uLmpzXG4vLyBtb2R1bGUgaWQgPSAyNTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///253\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.2 Number.isFinite(number)\nvar $export = __webpack_require__(0);\nvar _isFinite = __webpack_require__(7).isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWZpbml0ZS5qcz9jYWU1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi4yIE51bWJlci5pc0Zpbml0ZShudW1iZXIpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIF9pc0Zpbml0ZSA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmlzRmluaXRlO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ051bWJlcicsIHtcbiAgaXNGaW5pdGU6IGZ1bmN0aW9uIGlzRmluaXRlKGl0KSB7XG4gICAgcmV0dXJuIHR5cGVvZiBpdCA9PSAnbnVtYmVyJyAmJiBfaXNGaW5pdGUoaXQpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWZpbml0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///254\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { isInteger: __webpack_require__(166) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWludGVnZXIuanM/NWVkOCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuMyBOdW1iZXIuaXNJbnRlZ2VyKG51bWJlcilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTnVtYmVyJywgeyBpc0ludGVnZXI6IHJlcXVpcmUoJy4vX2lzLWludGVnZXInKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDI1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///255\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.4 Number.isNaN(number)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLW5hbi5qcz8yYzZlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi40IE51bWJlci5pc05hTihudW1iZXIpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ051bWJlcicsIHtcbiAgaXNOYU46IGZ1bmN0aW9uIGlzTmFOKG51bWJlcikge1xuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICByZXR1cm4gbnVtYmVyICE9IG51bWJlcjtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5pcy1uYW4uanNcbi8vIG1vZHVsZSBpZCA9IDI1NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///256\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = __webpack_require__(0);\nvar isInteger = __webpack_require__(166);\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLXNhZmUtaW50ZWdlci5qcz8wMzU5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi41IE51bWJlci5pc1NhZmVJbnRlZ2VyKG51bWJlcilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgaXNJbnRlZ2VyID0gcmVxdWlyZSgnLi9faXMtaW50ZWdlcicpO1xudmFyIGFicyA9IE1hdGguYWJzO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ051bWJlcicsIHtcbiAgaXNTYWZlSW50ZWdlcjogZnVuY3Rpb24gaXNTYWZlSW50ZWdlcihudW1iZXIpIHtcbiAgICByZXR1cm4gaXNJbnRlZ2VyKG51bWJlcikgJiYgYWJzKG51bWJlcikgPD0gMHgxZmZmZmZmZmZmZmZmZjtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5pcy1zYWZlLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDI1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///257\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLm1heC1zYWZlLWludGVnZXIuanM/NWEyMiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuNiBOdW1iZXIuTUFYX1NBRkVfSU5URUdFUlxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdOdW1iZXInLCB7IE1BWF9TQUZFX0lOVEVHRVI6IDB4MWZmZmZmZmZmZmZmZmYgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5tYXgtc2FmZS1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAyNThcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///258\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLm1pbi1zYWZlLWludGVnZXIuanM/Njg5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuMTAgTnVtYmVyLk1JTl9TQUZFX0lOVEVHRVJcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTnVtYmVyJywgeyBNSU5fU0FGRV9JTlRFR0VSOiAtMHgxZmZmZmZmZmZmZmZmZiB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLm1pbi1zYWZlLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDI1OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///259\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseFloat = __webpack_require__(164);\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWZsb2F0LmpzPzZhNWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcGFyc2VGbG9hdCA9IHJlcXVpcmUoJy4vX3BhcnNlLWZsb2F0Jyk7XG4vLyAyMC4xLjIuMTIgTnVtYmVyLnBhcnNlRmxvYXQoc3RyaW5nKVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAoTnVtYmVyLnBhcnNlRmxvYXQgIT0gJHBhcnNlRmxvYXQpLCAnTnVtYmVyJywgeyBwYXJzZUZsb2F0OiAkcGFyc2VGbG9hdCB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWZsb2F0LmpzXG4vLyBtb2R1bGUgaWQgPSAyNjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///260\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseInt = __webpack_require__(163);\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWludC5qcz83NTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJHBhcnNlSW50ID0gcmVxdWlyZSgnLi9fcGFyc2UtaW50Jyk7XG4vLyAyMC4xLjIuMTMgTnVtYmVyLnBhcnNlSW50KHN0cmluZywgcmFkaXgpXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIChOdW1iZXIucGFyc2VJbnQgIT0gJHBhcnNlSW50KSwgJ051bWJlcicsIHsgcGFyc2VJbnQ6ICRwYXJzZUludCB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWludC5qc1xuLy8gbW9kdWxlIGlkID0gMjYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///261\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.3 Math.acosh(x)\nvar $export = __webpack_require__(0);\nvar log1p = __webpack_require__(167);\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n//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y9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGguYWNvc2guanNcbi8vIG1vZHVsZSBpZCA9IDI2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///262\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.5 Math.asinh(x)\nvar $export = __webpack_require__(0);\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5hc2luaC5qcz9lYzliIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi41IE1hdGguYXNpbmgoeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGFzaW5oID0gTWF0aC5hc2luaDtcblxuZnVuY3Rpb24gYXNpbmgoeCkge1xuICByZXR1cm4gIWlzRmluaXRlKHggPSAreCkgfHwgeCA9PSAwID8geCA6IHggPCAwID8gLWFzaW5oKC14KSA6IE1hdGgubG9nKHggKyBNYXRoLnNxcnQoeCAqIHggKyAxKSk7XG59XG5cbi8vIFRvciBCcm93c2VyIGJ1ZzogTWF0aC5hc2luaCgwKSAtPiAtMFxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAhKCRhc2luaCAmJiAxIC8gJGFzaW5oKDApID4gMCksICdNYXRoJywgeyBhc2luaDogYXNpbmggfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGguYXNpbmguanNcbi8vIG1vZHVsZSBpZCA9IDI2M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///263\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.7 Math.atanh(x)\nvar $export = __webpack_require__(0);\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5hdGFuaC5qcz85NzI4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi43IE1hdGguYXRhbmgoeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGF0YW5oID0gTWF0aC5hdGFuaDtcblxuLy8gVG9yIEJyb3dzZXIgYnVnOiBNYXRoLmF0YW5oKC0wKSAtPiAwXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqICEoJGF0YW5oICYmIDEgLyAkYXRhbmgoLTApIDwgMCksICdNYXRoJywge1xuICBhdGFuaDogZnVuY3Rpb24gYXRhbmgoeCkge1xuICAgIHJldHVybiAoeCA9ICt4KSA9PSAwID8geCA6IE1hdGgubG9nKCgxICsgeCkgLyAoMSAtIHgpKSAvIDI7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmF0YW5oLmpzXG4vLyBtb2R1bGUgaWQgPSAyNjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///264\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.9 Math.cbrt(x)\nvar $export = __webpack_require__(0);\nvar sign = __webpack_require__(115);\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jYnJ0LmpzPzkwMTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjkgTWF0aC5jYnJ0KHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHNpZ24gPSByZXF1aXJlKCcuL19tYXRoLXNpZ24nKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBjYnJ0OiBmdW5jdGlvbiBjYnJ0KHgpIHtcbiAgICByZXR1cm4gc2lnbih4ID0gK3gpICogTWF0aC5wb3coTWF0aC5hYnMoeCksIDEgLyAzKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGguY2JydC5qc1xuLy8gbW9kdWxlIGlkID0gMjY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///265\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.11 Math.clz32(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jbHozMi5qcz9jNGUzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xMSBNYXRoLmNsejMyKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGNsejMyOiBmdW5jdGlvbiBjbHozMih4KSB7XG4gICAgcmV0dXJuICh4ID4+Pj0gMCkgPyAzMSAtIE1hdGguZmxvb3IoTWF0aC5sb2coeCArIDAuNSkgKiBNYXRoLkxPRzJFKSA6IDMyO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jbHozMi5qc1xuLy8gbW9kdWxlIGlkID0gMjY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///266\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.12 Math.cosh(x)\nvar $export = __webpack_require__(0);\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jb3NoLmpzPzJlNTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjEyIE1hdGguY29zaCh4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBleHAgPSBNYXRoLmV4cDtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBjb3NoOiBmdW5jdGlvbiBjb3NoKHgpIHtcbiAgICByZXR1cm4gKGV4cCh4ID0gK3gpICsgZXhwKC14KSkgLyAyO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jb3NoLmpzXG4vLyBtb2R1bGUgaWQgPSAyNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///267\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.14 Math.expm1(x)\nvar $export = __webpack_require__(0);\nvar $expm1 = __webpack_require__(116);\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5leHBtMS5qcz9mNzEyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xNCBNYXRoLmV4cG0xKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRleHBtMSA9IHJlcXVpcmUoJy4vX21hdGgtZXhwbTEnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAoJGV4cG0xICE9IE1hdGguZXhwbTEpLCAnTWF0aCcsIHsgZXhwbTE6ICRleHBtMSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5leHBtMS5qc1xuLy8gbW9kdWxlIGlkID0gMjY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///268\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.16 Math.fround(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { fround: __webpack_require__(168) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5mcm91bmQuanM/OWJhNiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4yLjIuMTYgTWF0aC5mcm91bmQoeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgZnJvdW5kOiByZXF1aXJlKCcuL19tYXRoLWZyb3VuZCcpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmZyb3VuZC5qc1xuLy8gbW9kdWxlIGlkID0gMjY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///269\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = __webpack_require__(0);\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5oeXBvdC5qcz9jMmJiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xNyBNYXRoLmh5cG90KFt2YWx1ZTFbLCB2YWx1ZTJbLCDigKYgXV1dKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhYnMgPSBNYXRoLmFicztcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBoeXBvdDogZnVuY3Rpb24gaHlwb3QodmFsdWUxLCB2YWx1ZTIpIHsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bnVzZWQtdmFyc1xuICAgIHZhciBzdW0gPSAwO1xuICAgIHZhciBpID0gMDtcbiAgICB2YXIgYUxlbiA9IGFyZ3VtZW50cy5sZW5ndGg7XG4gICAgdmFyIGxhcmcgPSAwO1xuICAgIHZhciBhcmcsIGRpdjtcbiAgICB3aGlsZSAoaSA8IGFMZW4pIHtcbiAgICAgIGFyZyA9IGFicyhhcmd1bWVudHNbaSsrXSk7XG4gICAgICBpZiAobGFyZyA8IGFyZykge1xuICAgICAgICBkaXYgPSBsYXJnIC8gYXJnO1xuICAgICAgICBzdW0gPSBzdW0gKiBkaXYgKiBkaXYgKyAxO1xuICAgICAgICBsYXJnID0gYXJnO1xuICAgICAgfSBlbHNlIGlmIChhcmcgPiAwKSB7XG4gICAgICAgIGRpdiA9IGFyZyAvIGxhcmc7XG4gICAgICAgIHN1bSArPSBkaXYgKiBkaXY7XG4gICAgICB9IGVsc2Ugc3VtICs9IGFyZztcbiAgICB9XG4gICAgcmV0dXJuIGxhcmcgPT09IEluZmluaXR5ID8gSW5maW5pdHkgOiBsYXJnICogTWF0aC5zcXJ0KHN1bSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmh5cG90LmpzXG4vLyBtb2R1bGUgaWQgPSAyNzBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///270\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.18 Math.imul(x, y)\nvar $export = __webpack_require__(0);\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5pbXVsLmpzPzJlYTgiXSwic291c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sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///271\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.21 Math.log10(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5sb2cxMC5qcz9kNjJhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4yMSBNYXRoLmxvZzEwKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGxvZzEwOiBmdW5jdGlvbiBsb2cxMCh4KSB7XG4gICAgcmV0dXJuIE1hdGgubG9nKHgpICogTWF0aC5MT0cxMEU7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmxvZzEwLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///272\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.20 Math.log1p(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { log1p: __webpack_require__(167) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5sb2cxcC5qcz9hNTYxIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4yMCBNYXRoLmxvZzFwKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7IGxvZzFwOiByZXF1aXJlKCcuL19tYXRoLWxvZzFwJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGgubG9nMXAuanNcbi8vIG1vZHVsZSBpZCA9IDI3M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///273\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.22 Math.log2(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5sb2cyLmpzPzM3ODIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjIyIE1hdGgubG9nMih4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBsb2cyOiBmdW5jdGlvbiBsb2cyKHgpIHtcbiAgICByZXR1cm4gTWF0aC5sb2coeCkgLyBNYXRoLkxOMjtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGgubG9nMi5qc1xuLy8gbW9kdWxlIGlkID0gMjc0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///274\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.28 Math.sign(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { sign: __webpack_require__(115) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaWduLmpzPzFlNWYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjI4IE1hdGguc2lnbih4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywgeyBzaWduOiByZXF1aXJlKCcuL19tYXRoLXNpZ24nKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaWduLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///275\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.30 Math.sinh(x)\nvar $export = __webpack_require__(0);\nvar expm1 = __webpack_require__(116);\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaW5oLmpzPzMyMzEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjMwIE1hdGguc2luaCh4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBleHBtMSA9IHJlcXVpcmUoJy4vX21hdGgtZXhwbTEnKTtcbnZhciBleHAgPSBNYXRoLmV4cDtcblxuLy8gVjggbmVhciBDaHJvbWl1bSAzOCBoYXMgYSBwcm9ibGVtIHdpdGggdmVyeSBzbWFsbCBudW1iZXJzXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIHJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gIU1hdGguc2luaCgtMmUtMTcpICE9IC0yZS0xNztcbn0pLCAnTWF0aCcsIHtcbiAgc2luaDogZnVuY3Rpb24gc2luaCh4KSB7XG4gICAgcmV0dXJuIE1hdGguYWJzKHggPSAreCkgPCAxXG4gICAgICA/IChleHBtMSh4KSAtIGV4cG0xKC14KSkgLyAyXG4gICAgICA6IChleHAoeCAtIDEpIC0gZXhwKC14IC0gMSkpICogKE1hdGguRSAvIDIpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaW5oLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///276\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.33 Math.tanh(x)\nvar $export = __webpack_require__(0);\nvar expm1 = __webpack_require__(116);\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC50YW5oLmpzPzQ5MTAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjMzIE1hdGgudGFuaCh4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBleHBtMSA9IHJlcXVpcmUoJy4vX21hdGgtZXhwbTEnKTtcbnZhciBleHAgPSBNYXRoLmV4cDtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICB0YW5oOiBmdW5jdGlvbiB0YW5oKHgpIHtcbiAgICB2YXIgYSA9IGV4cG0xKHggPSAreCk7XG4gICAgdmFyIGIgPSBleHBtMSgteCk7XG4gICAgcmV0dXJuIGEgPT0gSW5maW5pdHkgPyAxIDogYiA9PSBJbmZpbml0eSA/IC0xIDogKGEgLSBiKSAvIChleHAoeCkgKyBleHAoLXgpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGgudGFuaC5qc1xuLy8gbW9kdWxlIGlkID0gMjc3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///277\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.34 Math.trunc(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC50cnVuYy5qcz8xZjQ5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4zNCBNYXRoLnRydW5jKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIHRydW5jOiBmdW5jdGlvbiB0cnVuYyhpdCkge1xuICAgIHJldHVybiAoaXQgPiAwID8gTWF0aC5mbG9vciA6IE1hdGguY2VpbCkoaXQpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC50cnVuYy5qc1xuLy8gbW9kdWxlIGlkID0gMjc4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///278\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZyb20tY29kZS1wb2ludC5qcz82ZWE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EwMDAwKSA+PiAxMCkgKyAweGQ4MDAsIGNvZGUgJSAweDQwMCArIDB4ZGMwMClcbiAgICAgICk7XG4gICAgfSByZXR1cm4gcmVzLmpvaW4oJycpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZyb20tY29kZS1wb2ludC5qc1xuLy8gbW9kdWxlIGlkID0gMjc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///279\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(28);\nvar toLength = __webpack_require__(14);\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJhdy5qcz8xNzdiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnL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,__webpack_require__){"use strict";eval("\n// 21.1.3.25 String.prototype.trim()\n__webpack_require__(65)('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnRyaW0uanM/OWExOSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyAyMS4xLjMuMjUgU3RyaW5nLnByb3RvdHlwZS50cmltKClcbnJlcXVpcmUoJy4vX3N0cmluZy10cmltJykoJ3RyaW0nLCBmdW5jdGlvbiAoJHRyaW0pIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIHRyaW0oKSB7XG4gICAgcmV0dXJuICR0cmltKHRoaXMsIDMpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy50cmltLmpzXG4vLyBtb2R1bGUgaWQgPSAyODFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///281\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(117)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(118)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yLmpzP2Q0MGQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRhdCA9IHJlcXVpcmUoJy4vX3N0cmluZy1hdCcpKHRydWUpO1xuXG4vLyAyMS4xLjMuMjcgU3RyaW5nLnByb3RvdHlwZVtAQGl0ZXJhdG9yXSgpXG5yZXF1aXJlKCcuL19pdGVyLWRlZmluZScpKFN0cmluZywgJ1N0cmluZycsIGZ1bmN0aW9uIChpdGVyYXRlZCkge1xuICB0aGlzLl90ID0gU3RyaW5nKGl0ZXJhdGVkKTsgLy8gdGFyZ2V0XG4gIHRoaXMuX2kgPSAwOyAgICAgICAgICAgICAgICAvLyBuZXh0IGluZGV4XG4vLyAyMS4xLjUuMi4xICVTdHJpbmdJdGVyYXRvclByb3RvdHlwZSUubmV4dCgpXG59LCBmdW5jdGlvbiAoKSB7XG4gIHZhciBPID0gdGhpcy5fdDtcbiAgdmFyIGluZGV4ID0gdGhpcy5faTtcbiAgdmFyIHBvaW50O1xuICBpZiAoaW5kZXggPj0gTy5sZW5ndGgpIHJldHVybiB7IHZhbHVlOiB1bmRlZmluZWQsIGRvbmU6IHRydWUgfTtcbiAgcG9pbnQgPSAkYXQoTywgaW5kZXgpO1xuICB0aGlzLl9pICs9IHBvaW50Lmxlbmd0aDtcbiAgcmV0dXJuIHsgdmFsdWU6IHBvaW50LCBkb25lOiBmYWxzZSB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gMjgyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///282\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $at = __webpack_require__(117)(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmNvZGUtcG9pbnQtYXQuanM/NDVhNyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRhdCA9IHJlcXVpcmUoJy4vX3N0cmluZy1hdCcpKGZhbHNlKTtcbiRleHBvcnQoJGV4cG9ydC5QLCAnU3RyaW5nJywge1xuICAvLyAyMS4xLjMuMyBTdHJpbmcucHJvdG90eXBlLmNvZGVQb2ludEF0KHBvcylcbiAgY29kZVBvaW50QXQ6IGZ1bmN0aW9uIGNvZGVQb2ludEF0KHBvcykge1xuICAgIHJldHVybiAkYXQodGhpcywgcG9zKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5jb2RlLXBvaW50LWF0LmpzXG4vLyBtb2R1bGUgaWQgPSAyODNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///283\n")},function(module,exports,__webpack_require__){"use strict";eval("// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n\nvar $export = __webpack_require__(0);\nvar toLength = __webpack_require__(14);\nvar context = __webpack_require__(120);\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(121)(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmVuZHMtd2l0aC5qcz82MzU0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIxLjEuMy42IFN0cmluZy5wcm90b3R5cGUuZW5kc1dpdGgoc2VhcmNoU3RyaW5nIFssIGVuZFBvc2l0aW9uXSlcbid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1a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uZW5kcy13aXRoLmpzXG4vLyBtb2R1bGUgaWQgPSAyODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///284\n")},function(module,exports,__webpack_require__){"use strict";eval("// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n\nvar $export = __webpack_require__(0);\nvar context = __webpack_require__(120);\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * __webpack_require__(121)(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmluY2x1ZGVzLmpzPzFhMWUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMS4zLjcgU3RyaW5nLnByb3RvdHlwZS5pbmNsdWRlcyhzZWFyY2hTdHJpbmcsIHBvc2l0aW9uID0gMClcbid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29udGV4dCA9IHJlcXVpcmUoJy4vX3N0cmluZy1jb250ZXh0Jyk7XG52YXIgSU5DTFVERVMgPSAnaW5jbHVkZXMnO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIHJlcXVpcmUoJy4vX2ZhaWxzLWlzLXJlZ2V4cCcpKElOQ0xVREVTKSwgJ1N0cmluZycsIHtcbiAgaW5jbHVkZXM6IGZ1bmN0aW9uIGluY2x1ZGVzKHNlYXJjaFN0cmluZyAvKiAsIHBvc2l0aW9uID0gMCAqLykge1xuICAgIHJldHVybiAhIX5jb250ZXh0KHRoaXMsIHNlYXJjaFN0cmluZywgSU5DTFVERVMpXG4gICAgICAuaW5kZXhPZihzZWFyY2hTdHJpbmcsIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5pbmNsdWRlcy5qc1xuLy8gbW9kdWxlIGlkID0gMjg1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///285\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: __webpack_require__(114)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJlcGVhdC5qcz9iNmE0Il0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnU3RyaW5nJywge1xuICAvLyAyMS4xLjMuMTMgU3RyaW5nLnByb3RvdHlwZS5yZXBlYXQoY291bnQpXG4gIHJlcGVhdDogcmVxdWlyZSgnLi9fc3RyaW5nLXJlcGVhdCcpXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJlcGVhdC5qc1xuLy8gbW9kdWxlIGlkID0gMjg2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///286\n")},function(module,exports,__webpack_require__){"use strict";eval("// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n\nvar $export = __webpack_require__(0);\nvar toLength = __webpack_require__(14);\nvar context = __webpack_require__(120);\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(121)(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN0YXJ0cy13aXRoLmpzPzBhZjUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMS4zLjE4IFN0cmluZy5wcm90b3R5cGUuc3Rh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XMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuc3RhcnRzLXdpdGguanNcbi8vIG1vZHVsZSBpZCA9IDI4N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///287\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.2 String.prototype.anchor(name)\n__webpack_require__(25)('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmFuY2hvci5qcz9mMGRhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjIgU3RyaW5nLnByb3RvdHlwZS5hbmNob3IobmFtZSlcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ2FuY2hvcicsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBhbmNob3IobmFtZSkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICdhJywgJ25hbWUnLCBuYW1lKTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuYW5jaG9yLmpzXG4vLyBtb2R1bGUgaWQgPSAyODhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///288\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.3 String.prototype.big()\n__webpack_require__(25)('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJpZy5qcz80NzhhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjMgU3RyaW5nLnByb3RvdHlwZS5iaWcoKVxucmVxdWlyZSgnLi9fc3RyaW5nLWh0bWwnKSgnYmlnJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGJpZygpIHtcbiAgICByZXR1cm4gY3JlYXRlSFRNTCh0aGlzLCAnYmlnJywgJycsICcnKTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuYmlnLmpzXG4vLyBtb2R1bGUgaWQgPSAyODlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///289\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.4 String.prototype.blink()\n__webpack_require__(25)('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJsaW5rLmpzP2UxMTkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuNCBTdHJpbmcucHJvdG90eXBlLmJsaW5rKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ2JsaW5rJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGJsaW5rKCkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICdibGluaycsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJsaW5rLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///290\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.5 String.prototype.bold()\n__webpack_require__(25)('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJvbGQuanM/ODhjZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBCLjIuMy41IFN0cmluZy5wcm90b3R5cGUuYm9sZCgpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdib2xkJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGJvbGQoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2InLCAnJywgJycpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5ib2xkLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///291\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.6 String.prototype.fixed()\n__webpack_require__(25)('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZpeGVkLmpzPzI3ZTgiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuNiBTdHJpbmcucHJvdG90eXBlLmZpeGVkKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ2ZpeGVkJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGZpeGVkKCkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICd0dCcsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZpeGVkLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///292\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.7 String.prototype.fontcolor(color)\n__webpack_require__(25)('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZvbnRjb2xvci5qcz9mMzZhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjcgU3RyaW5nLnByb3RvdHlwZS5mb250Y29sb3IoY29sb3IpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdmb250Y29sb3InLCBmdW5jdGlvbiAoY3JlYXRlSFRNTCkge1xuICByZXR1cm4gZnVuY3Rpb24gZm9udGNvbG9yKGNvbG9yKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2ZvbnQnLCAnY29sb3InLCBjb2xvcik7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZvbnRjb2xvci5qc1xuLy8gbW9kdWxlIGlkID0gMjkzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///293\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.8 String.prototype.fontsize(size)\n__webpack_require__(25)('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZvbnRzaXplLmpzPzVmZjEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuOCBTdHJpbmcucHJvdG90eXBlLmZvbnRzaXplKHNpemUpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdmb250c2l6ZScsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBmb250c2l6ZShzaXplKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2ZvbnQnLCAnc2l6ZScsIHNpemUpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5mb250c2l6ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjk0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///294\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.9 String.prototype.italics()\n__webpack_require__(25)('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLml0YWxpY3MuanM/Nzk1MiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBCLjIuMy45IFN0cmluZy5wcm90b3R5cGUuaXRhbGljcygpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdpdGFsaWNzJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGl0YWxpY3MoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2knLCAnJywgJycpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5pdGFsaWNzLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///295\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.10 String.prototype.link(url)\n__webpack_require__(25)('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmxpbmsuanM/NTA5OCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBCLjIuMy4xMCBTdHJpbmcucHJvdG90eXBlLmxpbmsodXJsKVxucmVxdWlyZSgnLi9fc3RyaW5nLWh0bWwnKSgnbGluaycsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBsaW5rKHVybCkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICdhJywgJ2hyZWYnLCB1cmwpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5saW5rLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///296\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.11 String.prototype.small()\n__webpack_require__(25)('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnNtYWxsLmpzPzQ5NGYiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuMTEgU3RyaW5nLnByb3RvdHlwZS5zbWFsbCgpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdzbWFsbCcsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzbWFsbCgpIHtcbiAgICByZXR1cm4gY3JlYXRlSFRNTCh0aGlzLCAnc21hbGwnLCAnJywgJycpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5zbWFsbC5qc1xuLy8gbW9kdWxlIGlkID0gMjk3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///297\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.12 String.prototype.strike()\n__webpack_require__(25)('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN0cmlrZS5qcz9lNjJjIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjEyIFN0cmluZy5wcm90b3R5cGUuc3RyaWtlKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ3N0cmlrZScsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzdHJpa2UoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ3N0cmlrZScsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN0cmlrZS5qc1xuLy8gbW9kdWxlIGlkID0gMjk4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///298\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.13 String.prototype.sub()\n__webpack_require__(25)('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1Yi5qcz8xMTZhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjEzIFN0cmluZy5wcm90b3R5cGUuc3ViKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ3N1YicsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzdWIoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ3N1YicsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1Yi5qc1xuLy8gbW9kdWxlIGlkID0gMjk5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///299\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.14 String.prototype.sup()\n__webpack_require__(25)('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1cC5qcz8yNzZhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjE0IFN0cmluZy5wcm90b3R5cGUuc3VwKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ3N1cCcsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzdXAoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ3N1cCcsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1cC5qc1xuLy8gbW9kdWxlIGlkID0gMzAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///300\n")},function(module,exports,__webpack_require__){eval("// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS5ub3cuanM/NDFhMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4zLjMuMSAvIDE1LjkuNC40IERhdGUubm93KClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnRGF0ZScsIHsgbm93OiBmdW5jdGlvbiAoKSB7IHJldHVybiBuZXcgRGF0ZSgpLmdldFRpbWUoKTsgfSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS5ub3cuanNcbi8vIG1vZHVsZSBpZCA9IDMwMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///301\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar toPrimitive = __webpack_require__(36);\n\n$export($export.P + $export.F * __webpack_require__(8)(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1qc29uLmpzP2YxZjgiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIHRvUHJpbWl0aXZlID0gcmVxdWlyZSgnLi9fdG8tcHJpbWl0aXZlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBuZXcgRGF0ZShOYU4pLnRvSlNPTigpICE9PSBudWxsXG4gICAgfHwgRGF0ZS5wcm90b3R5cGUudG9KU09OLmNhbGwoeyB0b0lTT1N0cmluZzogZnVuY3Rpb24gKCkgeyByZXR1cm4gMTsgfSB9KSAhPT0gMTtcbn0pLCAnRGF0ZScsIHtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXVudXNlZC12YXJzXG4gIHRvSlNPTjogZnVuY3Rpb24gdG9KU09OKGtleSkge1xuICAgIHZhciBPID0gdG9PYmplY3QodGhpcyk7XG4gICAgdmFyIHB2ID0gdG9QcmltaXRpdmUoTyk7XG4gICAgcmV0dXJuIHR5cGVvZiBwdiA9PSAnbnVtYmVyJyAmJiAhaXNGaW5pdGUocHYpID8gbnVsbCA6IE8udG9JU09TdHJpbmcoKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmRhdGUudG8tanNvbi5qc1xuLy8gbW9kdWxlIGlkID0gMzAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///302\n")},function(module,exports,__webpack_require__){eval("// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = __webpack_require__(0);\nvar toISOString = __webpack_require__(304);\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1pc28tc3RyaW5nLmpzPzUxYjUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMy40LjM2IC8gMTUuOS41LjQzIERhdGUucHJvdG90eXBlLnRvSVNPU3RyaW5nKClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9JU09TdHJpbmcgPSByZXF1aXJlKCcuL19kYXRlLXRvLWlzby1zdHJpbmcnKTtcblxuLy8gUGhhbnRvbUpTIC8gb2xkIFdlYktpdCBoYXMgYSBicm9rZW4gaW1wbGVtZW50YXRpb25zXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIChEYXRlLnByb3RvdHlwZS50b0lTT1N0cmluZyAhPT0gdG9JU09TdHJpbmcpLCAnRGF0ZScsIHtcbiAgdG9JU09TdHJpbmc6IHRvSVNPU3RyaW5nXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1pc28tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSAzMDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///303\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = __webpack_require__(8);\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGF0ZS10by1pc28tc3RyaW5nLmpzPzYzYjQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gMjAuMy40LjM2IC8gMTUuOS41LjQzIERhdGUucHJvdG90eXBlLnRvSVNPU3RyaW5nKClcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG52YXIgZ2V0VGltZSA9IERhdGUucHJvdG90eXBlLmdldFRpbWU7XG52YXIgJHRvSVNPU3RyaW5nID0gRGF0ZS5wcm90b3R5cGUudG9JU09TdHJpbmc7XG5cbnZhciBseiA9IGZ1bmN0aW9uIChudW0pIHtcbiAgcmV0dXJuIG51bSA+IDkgPyBudW0gOiAnMCcgKyBudW07XG59O1xuXG4vLyBQaGFudG9tSlMgLyBvbGQgV2ViS2l0IGhhcyBhIGJyb2tlbiBpbXBsZW1lbnRhdGlvbnNcbm1vZHVsZS5leHBvcnRzID0gKGZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuICR0b0lTT1N0cmluZy5jYWxsKG5ldyBEYXRlKC01ZTEzIC0gMSkpICE9ICcwMzg1LTA3LTI1VDA3OjA2OjM5Ljk5OVonO1xufSkgfHwgIWZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgJHRvSVNPU3RyaW5nLmNhbGwobmV3IERhdGUoTmF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0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///304\n")},function(module,exports,__webpack_require__){eval("var DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n __webpack_require__(24)(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1zdHJpbmcuanM/NDY0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgRGF0ZVByb3RvID0gRGF0ZS5wcm90b3R5cGU7XG52YXIgSU5WQUxJRF9EQVRFID0gJ0ludmFsaWQgRGF0ZSc7XG52YXIgVE9fU1RSSU5HID0gJ3RvU3RyaW5nJztcbnZhciAkdG9TdHJpbmcgPSBEYXRlUHJvdG9bVE9fU1RSSU5HXTtcbnZhciBnZXRUaW1lID0gRGF0ZVByb3RvLmdldFRpbWU7XG5pZiAobmV3IERhdGUoTmFOKSArICcnICE9IElOVkFMSURfREFURSkge1xuICByZXF1aXJlKCcuL19yZWRlZmluZScpKERhdGVQcm90bywgVE9fU1RSSU5HLCBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICB2YXIgdmFsdWUgPSBnZXRUaW1lLmNhbGwodGhpcyk7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgIHJldHVybiB2YWx1ZSA9PT0gdmFsdWUgPyAkdG9TdHJpbmcuY2FsbCh0aGlzKSA6IElOVkFMSURfREFURTtcbiAgfSk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmRhdGUudG8tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSAzMDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///305\n")},function(module,exports,__webpack_require__){eval("var TO_PRIMITIVE = __webpack_require__(10)('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) __webpack_require__(23)(proto, TO_PRIMITIVE, __webpack_require__(307));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1wcmltaXRpdmUuanM/ZTEwZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgVE9fUFJJTUlUSVZFID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvUHJpbWl0aXZlJyk7XG52YXIgcHJvdG8gPSBEYXRlLnByb3RvdHlwZTtcblxuaWYgKCEoVE9fUFJJTUlUSVZFIGluIHByb3RvKSkgcmVxdWlyZSgnLi9faGlkZScpKHByb3RvLCBUT19QUklNSVRJVkUsIHJlcXVpcmUoJy4vX2RhdGUtdG8tcHJpbWl0aXZlJykpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5kYXRlLnRvLXByaW1pdGl2ZS5qc1xuLy8gbW9kdWxlIGlkID0gMzA2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///306\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar anObject = __webpack_require__(5);\nvar toPrimitive = __webpack_require__(36);\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGF0ZS10by1wcmltaXRpdmUuanM/OGMxZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIE5VTUJFUiA9ICdudW1iZXInO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChoaW50KSB7XG4gIGlmIChoaW50ICE9PSAnc3RyaW5nJyAmJiBoaW50ICE9PSBOVU1CRVIgJiYgaGludCAhPT0gJ2RlZmF1bHQnKSB0aHJvdyBUeXBlRXJyb3IoJ0luY29ycmVjdCBoaW50Jyk7XG4gIHJldHVybiB0b1ByaW1pdGl2ZShhbk9iamVjdCh0aGlzKSwgaGludCAhPSBOVU1CRVIpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGF0ZS10by1wcmltaXRpdmUuanNcbi8vIG1vZHVsZSBpZCA9IDMwN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///307\n")},function(module,exports,__webpack_require__){eval("// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Array', { isArray: __webpack_require__(86) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaXMtYXJyYXkuanM/MjBjNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjIuMiAvIDE1LjQuMy4yIEFycmF5LmlzQXJyYXkoYXJnKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdBcnJheScsIHsgaXNBcnJheTogcmVxdWlyZSgnLi9faXMtYXJyYXknKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaXMtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDMwOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///308\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar ctx = __webpack_require__(32);\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar call = __webpack_require__(169);\nvar isArrayIter = __webpack_require__(122);\nvar toLength = __webpack_require__(14);\nvar createProperty = __webpack_require__(123);\nvar getIterFn = __webpack_require__(124);\n\n$export($export.S + $export.F * !__webpack_require__(88)(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZnJvbS5qcz82ZGUxIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgn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y8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDMwOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///309\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar createProperty = __webpack_require__(123);\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkub2YuanM/YzRjYSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///310\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(28);\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (__webpack_require__(73) != Object || !__webpack_require__(34)(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuam9pbi5qcz84ZjhkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIyLjEuMy4xMyBBcnJheS5wcm90b3R5cGUuam9pbihzZXBhcmF0b3IpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUpvaW4gPSBbXS5qb2luO1xuXG4vLyBmYWxsYmFjayBmb3Igbm90IGFycmF5LWxpa2Ugc3RyaW5nc1xuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAocmVxdWlyZSgnLi9faW9iamVjdCcpICE9IE9iamVjdCB8fCAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKGFycmF5Sm9pbikpLCAnQXJyYXknLCB7XG4gIGpvaW46IGZ1bmN0aW9uIGpvaW4oc2VwYXJhdG9yKSB7XG4gICAgcmV0dXJuIGFycmF5Sm9pbi5jYWxsKHRvSU9iamVjdCh0aGlzKSwgc2VwYXJhdG9yID09PSB1bmRlZmluZWQgPyAnLCcgOiBzZXBhcmF0b3IpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuam9pbi5qc1xuLy8gbW9kdWxlIGlkID0gMzExXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///311\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar html = __webpack_require__(110);\nvar cof = __webpack_require__(33);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * __webpack_require__(8)(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc2xpY2Uuan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IG5ldyBBcnJheShzaXplKTtcbiAgICB2YXIgaSA9IDA7XG4gICAgZm9yICg7IGkgPCBzaXplOyBpKyspIGNsb25lZFtpXSA9IGtsYXNzID09ICdTdHJpbmcnXG4gICAgICA/IHRoaXMuY2hhckF0KHN0YXJ0ICsgaSlcbiAgICAgIDogdGhpc1tzdGFydCArIGldO1xuICAgIHJldHVybiBjbG9uZWQ7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5zbGljZS5qc1xuLy8gbW9kdWxlIGlkID0gMzEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///312\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(20);\nvar toObject = __webpack_require__(19);\nvar fails = __webpack_require__(8);\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !__webpack_require__(34)($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=ut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vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29ydC5qc1xuLy8gbW9kdWxlIGlkID0gMzEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///313\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $forEach = __webpack_require__(40)(0);\nvar STRICT = __webpack_require__(34)([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZm9yLWVhY2guanM/MDg0MyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRmb3JFYWNoID0gcmVxdWlyZSgnLi9fYXJyYXktbWV0aG9kcycpKDApO1xudmFyIFNUUklDVCA9IHJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5mb3JFYWNoLCB0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAhU1RSSUNULCAnQXJyYXknLCB7XG4gIC8vIDIyLjEuMy4xMCAvIDE1LjQuNC4xOCBBcnJheS5wcm90b3R5cGUuZm9yRWFjaChjYWxsYmFja2ZuIFssIHRoaXNBcmddKVxuICBmb3JFYWNoOiBmdW5jdGlvbiBmb3JFYWNoKGNhbGxiYWNrZm4gLyogLCB0aGlzQXJnICovKSB7XG4gICAgcmV0dXJuICRmb3JFYWNoKHRoaXMsIGNhbGxiYWNrZm4sIGFyZ3VtZW50c1sxXSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5mb3ItZWFjaC5qc1xuLy8gbW9kdWxlIGlkID0gMzE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///314\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar isArray = __webpack_require__(86);\nvar SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXkt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ourceURL=webpack-internal:///315\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $map = __webpack_require__(40)(1);\n\n$export($export.P + $export.F * !__webpack_require__(34)([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkubWFwLmpzP2MzYTUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkbWFwID0gcmVxdWlyZSgnLi9fYXJyYXktbWV0aG9kcycpKDEpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqICFyZXF1aXJlKCcuL19zdHJpY3QtbWV0aG9kJykoW10ubWFwLCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuMTUgLyAxNS40LjQuMTkgQXJyYXkucHJvdG90eXBlLm1hcChjYWxsYmFja2ZuIFssIHRoaXNBcmddKVxuICBtYXA6IGZ1bmN0aW9uIG1hcChjYWxsYmFja2ZuIC8qICwgdGhpc0FyZyAqLykge1xuICAgIHJldHVybiAkbWFwKHRoaXMsIGNhbGxiYWNrZm4sIGFyZ3VtZW50c1sxXSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5tYXAuanNcbi8vIG1vZHVsZSBpZCA9IDMxNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///316\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $filter = __webpack_require__(40)(2);\n\n$export($export.P + $export.F * !__webpack_require__(34)([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmlsdGVyLmpzPzdjZTciXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkZmlsdGVyID0gcmVxdWlyZSgnLi9fYXJyYXktbWV0aG9kcycpKDIpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqICFyZXF1aXJlKCcuL19zdHJpY3QtbWV0aG9kJykoW10uZmlsdGVyLCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuNyAvIDE1LjQuNC4yMCBBcnJheS5wcm90b3R5cGUuZmlsdGVyKGNhbGxiYWNrZm4gWywgdGhpc0FyZ10pXG4gIGZpbHRlcjogZnVuY3Rpb24gZmlsdGVyKGNhbGxiYWNrZm4gLyogLCB0aGlzQXJnICovKSB7XG4gICAgcmV0dXJuICRmaWx0ZXIodGhpcywgY2FsbGJhY2tmbiwgYXJndW1lbnRzWzFdKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmZpbHRlci5qc1xuLy8gbW9kdWxlIGlkID0gMzE3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///317\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $some = __webpack_require__(40)(3);\n\n$export($export.P + $export.F * !__webpack_require__(34)([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29tZS5qcz9jMTU3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJHNvbWUgPSByZXF1aXJlKCcuL19hcnJheS1tZXRob2RzJykoMyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5zb21lLCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuMjMgLyAxNS40LjQuMTcgQXJyYXkucHJvdG90eXBlLnNvbWUoY2FsbGJhY2tmbiBbLCB0aGlzQXJnXSlcbiAgc29tZTogZnVuY3Rpb24gc29tZShjYWxsYmFja2ZuIC8qICwgdGhpc0FyZyAqLykge1xuICAgIHJldHVybiAkc29tZSh0aGlzLCBjYWxsYmFja2ZuLCBhcmd1bWVudHNbMV0pO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29tZS5qc1xuLy8gbW9kdWxlIGlkID0gMzE4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///318\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $every = __webpack_require__(40)(4);\n\n$export($export.P + $export.F * !__webpack_require__(34)([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZXZlcnkuanM/MzY0YSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRldmVyeSA9IHJlcXVpcmUoJy4vX2FycmF5LW1ldGhvZHMnKSg0KTtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKFtdLmV2ZXJ5LCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuNSAvIDE1LjQuNC4xNiBBcnJheS5wcm90b3R5cGUuZXZlcnkoY2FsbGJhY2tmbiBbLCB0aGlzQXJnXSlcbiAgZXZlcnk6IGZ1bmN0aW9uIGV2ZXJ5KGNhbGxiYWNrZm4gLyogLCB0aGlzQXJnICovKSB7XG4gICAgcmV0dXJuICRldmVyeSh0aGlzLCBjYWxsYmFja2ZuLCBhcmd1bWVudHNbMV0pO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZXZlcnkuanNcbi8vIG1vZHVsZSBpZCA9IDMxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///319\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $reduce = __webpack_require__(170);\n\n$export($export.P + $export.F * !__webpack_require__(34)([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkucmVkdWNlLmpzP2MyNzQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcmVkdWNlID0gcmVxdWlyZSgnLi9fYXJyYXktcmVkdWNlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5yZWR1Y2UsIHRydWUpLCAnQXJyYXknLCB7XG4gIC8vIDIyLjEuMy4xOCAvIDE1LjQuNC4yMSBBcnJheS5wcm90b3R5cGUucmVkdWNlKGNhbGxiYWNrZm4gWywgaW5pdGlhbFZhbHVlXSlcbiAgcmVkdWNlOiBmdW5jdGlvbiByZWR1Y2UoY2FsbGJhY2tmbiAvKiAsIGluaXRpYWxWYWx1ZSAqLykge1xuICAgIHJldHVybiAkcmVkdWNlKHRoaXMsIGNhbGxiYWNrZm4sIGFyZ3VtZW50cy5sZW5ndGgsIGFyZ3VtZW50c1sxXSwgZmFsc2UpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkucmVkdWNlLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///320\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $reduce = __webpack_require__(170);\n\n$export($export.P + $export.F * !__webpack_require__(34)([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkucmVkdWNlLXJpZ2h0LmpzPzk2NDQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcmVkdWNlID0gcmVxdWlyZSgnLi9fYXJyYXktcmVkdWNlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5yZWR1Y2VSaWdodCwgdHJ1ZSksICdBcnJheScsIHtcbiAgLy8gMjIuMS4zLjE5IC8gMTUuNC40LjIyIEFycmF5LnByb3RvdHlwZS5yZWR1Y2VSaWdodChjYWxsYmFja2ZuIFssIGluaXRpYWxWYWx1ZV0pXG4gIHJlZHVjZVJpZ2h0OiBmdW5jdGlvbiByZWR1Y2VSaWdodChjYWxsYmFja2ZuIC8qICwgaW5pdGlhbFZhbHVlICovKSB7XG4gICAgcmV0dXJuICRyZWR1Y2UodGhpcywgY2FsbGJhY2tmbiwgYXJndW1lbnRzLmxlbmd0aCwgYXJndW1lbnRzWzFdLCB0cnVlKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LnJlZHVjZS1yaWdodC5qc1xuLy8gbW9kdWxlIGlkID0gMzIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///321\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $indexOf = __webpack_require__(84)(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(34)($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaW5kZXgtb2YuanM/ZjgyMyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRpbmRleE9mID0gcmVxdWlyZSgnLi9fYXJyYXktaW5jbHVkZXMnKShmYWxzZSk7XG52YXIgJG5hdGl2ZSA9IFtdLmluZGV4T2Y7XG52YXIgTkVHQVRJVkVfWkVSTyA9ICEhJG5hdGl2ZSAmJiAxIC8gWzFdLmluZGV4T2YoMSwgLTApIDwgMDtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAoTkVHQVRJVkVfWkVSTyB8fCAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKCRuYXRpdmUpKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuMTEgLyAxNS40LjQuMTQgQXJyYXkucHJvdG90eXBlLmluZGV4T2Yoc2VhcmNoRWxlbWVudCBbLCBmcm9tSW5kZXhdKVxuICBpbmRleE9mOiBmdW5jdGlvbiBpbmRleE9mKHNlYXJjaEVsZW1lbnQgLyogLCBmcm9tSW5kZXggPSAwICovKSB7XG4gICAgcmV0dXJuIE5FR0FUSVZFX1pFUk9cbiAgICAgIC8vIGNvbnZlcnQgLTAgdG8gKzBcbiAgICAgID8gJG5hdGl2ZS5hcHBseSh0aGlzLCBhcmd1bWVudHMpIHx8IDBcbiAgICAgIDogJGluZGV4T2YodGhpcywgc2VhcmNoRWxlbWVudCwgYXJndW1lbnRzWzFdKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmluZGV4LW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///322\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(28);\nvar toInteger = __webpack_require__(38);\nvar toLength = __webpack_require__(14);\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(34)($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkubGFzdC1pbmRleC1vZi5qcz9hMDcyIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xudmFyICRuYXRpdmUgPSBbXS5sYXN0SW5kZXhPZjtcbnZhciBORUdBVElWRV9aRVJPID0gISEkbmF0aXZlICYmIDEgLyBbMV0ubGFzdEluZGV4T2YoMSwgLTApIDwgMDtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAoTkVHQVRJVkVfWkVSTyB8fCAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKCRuYXRpdmUpKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuMTQgLyAxNS40LjQuMTUgQXJyYXkucHJvdG90eX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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///323\n")},function(module,exports,__webpack_require__){eval("// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Array', { copyWithin: __webpack_require__(171) });\n\n__webpack_require__(49)('copyWithin');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuY29weS13aXRoaW4uanM/ZjZmNyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjMuMyBBcnJheS5wcm90b3R5cGUuY29weVdpdGhpbih0YXJnZXQsIHN0YXJ0LCBlbmQgPSB0aGlzLmxlbmd0aClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnQXJyYXknLCB7IGNvcHlXaXRoaW46IHJlcXVpcmUoJy4vX2FycmF5LWNvcHktd2l0aGluJykgfSk7XG5cbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKCdjb3B5V2l0aGluJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmNvcHktd2l0aGluLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///324\n")},function(module,exports,__webpack_require__){eval("// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Array', { fill: __webpack_require__(126) });\n\n__webpack_require__(49)('fill');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmlsbC5qcz8zNjhlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIyLjEuMy42IEFycmF5LnByb3RvdHlwZS5maWxsKHZhbHVlLCBzdGFydCA9IDAsIGVuZCA9IHRoaXMubGVuZ3RoKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAsICdBcnJheScsIHsgZmlsbDogcmVxdWlyZSgnLi9fYXJyYXktZmlsbCcpIH0pO1xuXG5yZXF1aXJlKCcuL19hZGQtdG8tdW5zY29wYWJsZXMnKSgnZmlsbCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5maWxsLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///325\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = __webpack_require__(0);\nvar $find = __webpack_require__(40)(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(49)(KEY);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmluZC5qcz81YTk0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIyLjEuMy44IEFycmF5LnByb3RvdHlwZS5maW5kKHByZWRpY2F0ZSwgdGhpc0FyZyA9IHVuZGVmaW5lZClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGZpbmQgPSByZXF1aXJlKCcuL19hcnJheS1tZXRob2RzJykoNSk7XG52YXIgS0VZID0gJ2ZpbmQnO1xudmFyIGZvcmNlZCA9IHRydWU7XG4vLyBTaG91bGRuJ3Qgc2tpcCBob2xlc1xuaWYgKEtFWSBpbiBbXSkgQXJyYXkoMSlbS0VZXShmdW5jdGlvbiAoKSB7IGZvcmNlZCA9IGZhbHNlOyB9KTtcbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogZm9yY2VkLCAnQXJyYXknLCB7XG4gIGZpbmQ6IGZ1bmN0aW9uIGZpbmQoY2FsbGJhY2tmbiAvKiAsIHRoYXQgPSB1bmRlZmluZWQgKi8pIHtcbiAgICByZXR1cm4gJGZpbmQodGhpcywgY2FsbGJhY2tmbiwgYXJndW1lbnRzLmxlbmd0aCA+IDEgPyBhcmd1bWVudHNbMV0gOiB1bmRlZmluZWQpO1xuICB9XG59KTtcbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKEtFWSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmZpbmQuanNcbi8vIG1vZHVsZSBpZCA9IDMyNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///326\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = __webpack_require__(0);\nvar $find = __webpack_require__(40)(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(49)(KEY);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmluZC1pbmRleC5qcz81M2FhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIyLjEuMy45IEFycmF5LnByb3RvdHlwZS5maW5kSW5kZXgocHJlZGljYXRlLCB0aGlzQXJnID0gdW5kZWZpbmVkKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkZmluZCA9IHJlcXVpcmUoJy4vX2FycmF5LW1ldGhvZHMnKSg2KTtcbnZhciBLRVkgPSAnZmluZEluZGV4JztcbnZhciBmb3JjZWQgPSB0cnVlO1xuLy8gU2hvdWxkbid0IHNraXAgaG9sZXNcbmlmIChLRVkgaW4gW10pIEFycmF5KDEpW0tFWV0oZnVuY3Rpb24gKCkgeyBmb3JjZWQgPSBmYWxzZTsgfSk7XG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIGZvcmNlZCwgJ0FycmF5Jywge1xuICBmaW5kSW5kZXg6IGZ1bmN0aW9uIGZpbmRJbmRleChjYWxsYmFja2ZuIC8qICwgdGhhdCA9IHVuZGVmaW5lZCAqLykge1xuICAgIHJldHVybiAkZmluZCh0aGlzLCBjYWxsYmFja2ZuLCBhcmd1bWVudHMubGVuZ3RoID4gMSA/IGFyZ3VtZW50c1sxXSA6IHVuZGVmaW5lZCk7XG4gIH1cbn0pO1xucmVxdWlyZSgnLi9fYWRkLXRvLXVuc2NvcGFibGVzJykoS0VZKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmluZC1pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gMzI3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///327\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(58)('Array');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc3BlY2llcy5qcz80M2YwIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3NldC1zcGVjaWVzJykoJ0FycmF5Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LnNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDMyOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///328\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar inheritIfRequired = __webpack_require__(113);\nvar dP = __webpack_require__(13).f;\nvar gOPN = __webpack_require__(57).f;\nvar isRegExp = __webpack_require__(87);\nvar $flags = __webpack_require__(89);\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (__webpack_require__(12) && (!CORRECT_NEW || __webpack_require__(8)(function () {\n re2[__webpack_require__(10)('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n __webpack_require__(24)(global, 'RegExp', $RegExp);\n}\n\n__webpack_require__(58)('RegExp');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmNvbnN0cnVjdG9yLmpzPzk2NzYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGluaGVyaXRJZlJlcXVpcmVkID0gcmVxdWlyZSgnLi9faW5oZXJpdC1pZi1yZXF1aXJlZCcpO1xudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbnZhciBnT1BOID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4nKS5mO1xudmFyIGlzUmVnRXhwID0gcmVxdWlyZSgnLi9faXMtcmVnZXhwJyk7XG52YXIgJGZsYWdzID0gcmVxdWlyZSgnLi9fZmxhZ3MnKTtcbnZhciAkUmVnRXhwID0gZ2xvYmFsLlJlZ0V4cDtcbnZhciBCYXNlID0gJFJlZ0V4cDtcbnZhciBwcm90byA9ICRSZWdFeHAucHJvdG90eXBlO1xudmFyIHJlMSA9IC9hL2c7XG52YXIgcmUyID0gL2EvZztcbi8vIFwibmV3XCIgY3JlYXRlcyBhIG5ldyBvYmplY3QsIG9sZCB3ZWJraXQgYnVnZ3kgaGVyZVxudmFyIENPUlJFQ1RfTkVXID0gbmV3ICRSZWdFeHAocmUxKSAhPT0gcmUxO1xuXG5pZiAocmVxdWlyZSgnLi9fZGVzY3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ack_require__(173);\nvar anObject = __webpack_require__(5);\nvar $flags = __webpack_require__(89);\nvar DESCRIPTORS = __webpack_require__(12);\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n __webpack_require__(24)(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (__webpack_require__(8)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnRvLXN0cmluZy5qcz8xNWE2Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnJlcXVpcmUoJy4vZXM2LnJlZ2V4cC5mbGFncycpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgJGZsYWdzID0gcmVxdWlyZSgnLi9fZmxhZ3MnKTtcbnZhciBERVNDUklQVE9SUyA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyk7XG52YXIgVE9fU1RSSU5HID0gJ3RvU3RyaW5nJztcbnZhciAkdG9TdHJpbmcgPSAvLi9bVE9fU1RSSU5HXTtcblxudmFyIGRlZmluZSA9IGZ1bmN0aW9uIChmbikge1xuICByZXF1aXJlKCcuL19yZWRlZmluZScpKFJlZ0V4cC5wcm90b3R5cGUsIFRPX1NUUklORywgZm4sIHRydWUpO1xufTtcblxuL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BQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///330\n")},function(module,exports,__webpack_require__){eval("// @@match logic\n__webpack_require__(90)('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLm1hdGNoLmpzPzMxZjciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gQEBtYXRjaCBsb2dpY1xucmVxdWlyZSgnLi9fZml4LXJlLXdrcycpKCdtYXRjaCcsIDEsIGZ1bmN0aW9uIChkZWZpbmVkLCBNQVRDSCwgJG1hdGNoKSB7XG4gIC8vIDIxLjEuMy4xMSBTdHJpbmcucHJvdG90eXBlLm1hdGNoKHJlZ2V4cClcbiAgcmV0dXJuIFtmdW5jdGlvbiBtYXRjaChyZWdleHApIHtcbiAgICAndXNlIHN0cmljdCc7XG4gICAgdmFyIE8gPSBkZWZpbmVkKHRoaXMpO1xuICAgIHZhciBmbiA9IHJlZ2V4cCA9PSB1bmRlZmluZWQgPyB1bmRlZmluZWQgOiByZWdleHBbTUFUQ0hdO1xuICAgIHJldHVybiBmbiAhPT0gdW5kZWZpbmVkID8gZm4uY2FsbChyZWdleHAsIE8pIDogbmV3IFJlZ0V4cChyZWdleHApW01BVENIXShTdHJpbmcoTykpO1xuICB9LCAkbWF0Y2hdO1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5tYXRjaC5qc1xuLy8gbW9kdWxlIGlkID0gMzMxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///331\n")},function(module,exports,__webpack_require__){eval("// @@replace logic\n__webpack_require__(90)('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnJlcGxhY2UuanM/NTYzYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBAQHJlcGxhY2UgbG9naWNcbnJlcXVpcmUoJy4vX2ZpeC1yZS13a3MnKSgncmVwbGFjZScsIDIsIGZ1bmN0aW9uIChkZWZpbmVkLCBSRVBMQUNFLCAkcmVwbGFjZSkge1xuICAvLyAyMS4xLjMuMTQgU3RyaW5nLnByb3RvdHlwZS5yZXBsYWNlKHNlYXJjaFZhbHVlLCByZXBsYWNlVmFsdWUpXG4gIHJldHVybiBbZnVuY3Rpb24gcmVwbGFjZShzZWFyY2hWYWx1ZSwgcmVwbGFjZVZhbHVlKSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuICAgIHZhciBPID0gZGVmaW5lZCh0aGlzKTtcbiAgICB2YXIgZm4gPSBzZWFyY2hWYWx1ZSA9PSB1bmRlZmluZWQgPyB1bmRlZmluZWQgOiBzZWFyY2hWYWx1ZVtSRVBMQUNFXTtcbiAgICByZXR1cm4gZm4gIT09IHVuZGVmaW5lZFxuICAgICAgPyBmbi5jYWxsKHNlYXJjaFZhbHVlLCBPLCByZXBsYWNlVmFsdWUpXG4gICAgICA6ICRyZXBsYWNlLmNhbGwoU3RyaW5nKE8pLCBzZWFyY2hWYWx1ZSwgcmVwbGFjZVZhbHVlKTtcbiAgfSwgJHJlcGxhY2VdO1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5yZXBsYWNlLmpzXG4vLyBtb2R1bGUgaWQgPSAzMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///332\n")},function(module,exports,__webpack_require__){eval("// @@search logic\n__webpack_require__(90)('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnNlYXJjaC5qcz9hYjA0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIEBAc2VhcmNoIGxvZ2ljXG5yZXF1aXJlKCcuL19maXgtcmUtd2tzJykoJ3NlYXJjaCcsIDEsIGZ1bmN0aW9uIChkZWZpbmVkLCBTRUFSQ0gsICRzZWFyY2gpIHtcbiAgLy8gMjEuMS4zLjE1IFN0cmluZy5wcm90b3R5cGUuc2VhcmNoKHJlZ2V4cClcbiAgcmV0dXJuIFtmdW5jdGlvbiBzZWFyY2gocmVnZXhwKSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuICAgIHZhciBPID0gZGVmaW5lZCh0aGlzKTtcbiAgICB2YXIgZm4gPSByZWdleHAgPT0gdW5kZWZpbmVkID8gdW5kZWZpbmVkIDogcmVnZXhwW1NFQVJDSF07XG4gICAgcmV0dXJuIGZuICE9PSB1bmRlZmluZWQgPyBmbi5jYWxsKHJlZ2V4cCwgTykgOiBuZXcgUmVnRXhwKHJlZ2V4cClbU0VBUkNIXShTdHJpbmcoTykpO1xuICB9LCAkc2VhcmNoXTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAuc2VhcmNoLmpzXG4vLyBtb2R1bGUgaWQgPSAzMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///333\n")},function(module,exports,__webpack_require__){eval("// @@split logic\n__webpack_require__(90)('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = __webpack_require__(87);\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnNwbGl0LmpzPzk4OWMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gQEBzcGxpdCBsb2dpY1xucmVxdWlyZSgnLi9fZml4LXJlLXdrcycpKCdzcGxpdCcsIDIsIGZ1bmN0aW9uIChkZWZpbmVkLCBTUExJVCwgJHNwbGl0KSB7XG4gICd1c2Ugc3RyaWN0JztcbiAgdmFyIGlzUmVnRXhwID0gcmVxdWlyZSgnLi9faXMtcmVnZXhwJyk7XG4gIHZhciBfc3BsaXQgPSAkc3BsaXQ7XG4gIHZhciAkcHVzaCA9IFtdLnB1c2g7XG4gIHZhciAkU1BMSVQgPSAnc3BsaXQnO1xuICB2YXIgTEVOR1RIID0gJ2xlbmd0aCc7XG4gIHZhciBMQVNUX0lOREVYID0gJ2xhc3RJbmRleCc7XG4gIGlmIChcbiAgICAnYWJiYydbJFNQTElUXSgvKGIpKi8pWzFdID09ICdjJyB8fFxuICAgICd0ZXN0J1skU1BMSVRdKC8oPzopLyw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BQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///334\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(48);\nvar global = __webpack_require__(7);\nvar ctx = __webpack_require__(32);\nvar classof = __webpack_require__(75);\nvar $export = __webpack_require__(0);\nvar isObject = __webpack_require__(9);\nvar aFunction = __webpack_require__(20);\nvar anInstance = __webpack_require__(59);\nvar forOf = __webpack_require__(60);\nvar speciesConstructor = __webpack_require__(91);\nvar task = __webpack_require__(128).set;\nvar microtask = __webpack_require__(129)();\nvar newPromiseCapabilityModule = __webpack_require__(130);\nvar perform = __webpack_require__(174);\nvar userAgent = __webpack_require__(92);\nvar promiseResolve = __webpack_require__(175);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(61)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(64)($Promise, PROMISE);\n__webpack_require__(58)(PROMISE);\nWrapper = __webpack_require__(31)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(88)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucHJvbWlzZS5qcz9jYmQ5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgYUZ1bmN0aW9uID0gcmVxdWlyZSgnLi9fYS1mdW5jd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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///335\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar weak = __webpack_require__(180);\nvar validate = __webpack_require__(67);\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\n__webpack_require__(93)(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYud2Vhay1zZXQuanM/NTdmMSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgd2VhayA9IHJlcXVpcmUoJy4vX2NvbGxlY3Rpb24td2VhaycpO1xudmFyIHZhbGlkYXRlID0gcmVxdWlyZSgnLi9fdmFsaWRhdGUtY29sbGVjdGlvbicpO1xudmFyIFdFQUtfU0VUID0gJ1dlYWtTZXQnO1xuXG4vLyAyMy40IFdlYWtTZXQgT2JqZWN0c1xucmVxdWlyZSgnLi9fY29sbGVjdGlvbicpKFdFQUtfU0VULCBmdW5jdGlvbiAoZ2V0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBXZWFrU2V0KCkgeyByZXR1cm4gZ2V0KHRoaXMsIGFyZ3VtZW50cy5sZW5ndGggPiAwID8gYXJndW1lbnRzWzBdIDogdW5kZWZpbmVkKTsgfTtcbn0sIHtcbiAgLy8gMjMuNC4zLjEgV2Vha1NldC5wcm90b3R5cGUuYWRkKHZhbHVlKVxuICBhZGQ6IGZ1bmN0aW9uIGFkZCh2YWx1ZSkge1xuICAgIHJldHVybiB3ZWFrLmRlZih2YWxpZGF0ZSh0aGlzLCBXRUFLX1NFVCksIHZhbHVlLCB0cnVlKTtcbiAgfVxufSwgd2VhaywgZmFsc2UsIHRydWUpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi53ZWFrLXNldC5qc1xuLy8gbW9kdWxlIGlkID0gMzM2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///336\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $typed = __webpack_require__(94);\nvar buffer = __webpack_require__(131);\nvar anObject = __webpack_require__(5);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\nvar isObject = __webpack_require__(9);\nvar ArrayBuffer = __webpack_require__(7).ArrayBuffer;\nvar speciesConstructor = __webpack_require__(91);\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * __webpack_require__(8)(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var fin = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < fin) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\n__webpack_require__(58)(ARRAY_BUFFER);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuYXJyYXktYnVmZmVyLmpzP2Y2NjkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkdHlwZWQgPSByZXF1aXJlKCcuL190eXBlZCcpO1xudmFyIGJ1ZmZlciA9IHJlcXVpcmUoJy4vX3R5cGVkLWJ1ZmZlcicpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk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HlwZWQuYXJyYXktYnVmZmVyLmpzXG4vLyBtb2R1bGUgaWQgPSAzMzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///337\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n$export($export.G + $export.W + $export.F * !__webpack_require__(94).ABV, {\n DataView: __webpack_require__(131).DataView\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZGF0YS12aWV3LmpzP2Q2ZTIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbiRleHBvcnQoJGV4cG9ydC5HICsgJGV4cG9ydC5XICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3R5cGVkJykuQUJWLCB7XG4gIERhdGFWaWV3OiByZXF1aXJlKCcuL190eXBlZC1idWZmZXInKS5EYXRhVmlld1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnR5cGVkLmRhdGEtdmlldy5qc1xuLy8gbW9kdWxlIGlkID0gMzM4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///338\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50OC1hcnJheS5qcz9lNzY1Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ0ludDgnLCAxLCBmdW5jdGlvbiAoaW5pdCkge1xuICByZXR1cm4gZnVuY3Rpb24gSW50OEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50OC1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///339\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtYXJyYXkuanM/NGM1NSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL190eXBlZC1hcnJheScpKCdVaW50OCcsIDEsIGZ1bmN0aW9uIChpbml0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBVaW50OEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDM0MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///340\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtY2xhbXBlZC1hcnJheS5qcz8zMzI4Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ1VpbnQ4JywgMSwgZnVuY3Rpb24gKGluaXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFVpbnQ4Q2xhbXBlZEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59LCB0cnVlKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtY2xhbXBlZC1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzQxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///341\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MTYtYXJyYXkuanM/YWFkNCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL190eXBlZC1hcnJheScpKCdJbnQxNicsIDIsIGZ1bmN0aW9uIChpbml0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBJbnQxNkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MTYtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDM0MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///342\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDE2LWFycmF5LmpzPzRjNzkiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fdHlwZWQtYXJyYXknKSgnVWludDE2JywgMiwgZnVuY3Rpb24gKGluaXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFVpbnQxNkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDE2LWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///343\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MzItYXJyYXkuanM/MmI0MiJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL190eXBlZC1hcnJheScpKCdJbnQzMicsIDQsIGZ1bmN0aW9uIChpbml0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBJbnQzMkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MzItYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDM0NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///344\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDMyLWFycmF5LmpzPzM1ZjYiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fdHlwZWQtYXJyYXknKSgnVWludDMyJywgNCwgZnVuY3Rpb24gKGluaXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFVpbnQzMkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDMyLWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///345\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQzMi1hcnJheS5qcz83NTNjIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ0Zsb2F0MzInLCA0LCBmdW5jdGlvbiAoaW5pdCkge1xuICByZXR1cm4gZnVuY3Rpb24gRmxvYXQzMkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQzMi1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///346\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(42)('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQ2NC1hcnJheS5qcz9mYWY1Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ0Zsb2F0NjQnLCA4LCBmdW5jdGlvbiAoaW5pdCkge1xuICByZXR1cm4gZnVuY3Rpb24gRmxvYXQ2NEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQ2NC1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzQ3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///347\n")},function(module,exports,__webpack_require__){eval("// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(20);\nvar anObject = __webpack_require__(5);\nvar rApply = (__webpack_require__(7).Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !__webpack_require__(8)(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5hcHBseS5qcz8wOTU0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDI2LjEuMSBSZWZsZWN0LmFwcGx5KHRhcmdldCwgdGhpc0FyZ3VtZW50LCBhcmd1bWVudHNMaXN0KVxudmFyICRleHBvcnQgPSByZXF1aX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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///348\n")},function(module,exports,__webpack_require__){eval("// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = __webpack_require__(0);\nvar create = __webpack_require__(56);\nvar aFunction = __webpack_require__(20);\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar fails = __webpack_require__(8);\nvar bind = __webpack_require__(161);\nvar rConstruct = (__webpack_require__(7).Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiM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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///349\n")},function(module,exports,__webpack_require__){eval("// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = __webpack_require__(13);\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar toPrimitive = __webpack_require__(36);\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5kZWZpbmUtcHJvcGVydHkuanM/ZTE5NSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjMgUmVmbGVjdC5kZWZpbmVQcm9wZXJ0eSh0YXJnZXQsIHByb3BlcnR5S2V5LCBhdHRyaWJ1dGVzKVxudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4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b2R1bGUgaWQgPSAzNTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///350\n")},function(module,exports,__webpack_require__){eval("// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = __webpack_require__(0);\nvar gOPD = __webpack_require__(29).f;\nvar anObject = __webpack_require__(5);\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5kZWxldGUtcHJvcGVydHkuanM/Y2IxZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjQgUmVmbGVjdC5kZWxldGVQcm9wZXJ0eSh0YXJnZXQsIHByb3BlcnR5S2V5KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBnT1BEID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKS5mO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHtcbiAgZGVsZXRlUHJvcGVydHk6IGZ1bmN0aW9uIGRlbGV0ZVByb3BlcnR5KHRhcmdldCwgcHJvcGVydHlLZXkpIHtcbiAgICB2YXIgZGVzYyA9IGdPUEQoYW5PYmplY3QodGFyZ2V0KSwgcHJvcGVydHlLZXkpO1xuICAgIHJldHVybiBkZXNjICYmICFkZXNjLmNvbmZpZ3VyYWJsZSA/IGZhbHNlIDogZGVsZXRlIHRhcmdldFtwcm9wZXJ0eUtleV07XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmRlbGV0ZS1wcm9wZXJ0eS5qc1xuLy8gbW9kdWxlIGlkID0gMzUxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///351\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 26.1.5 Reflect.enumerate(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\n__webpack_require__(119)(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtan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RlKHRhcmdldCk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmVudW1lcmF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMzUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///352\n")},function(module,exports,__webpack_require__){eval("// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = __webpack_require__(29);\nvar getPrototypeOf = __webpack_require__(30);\nvar has = __webpack_require__(27);\nvar $export = __webpack_require__(0);\nvar isObject = __webpack_require__(9);\nvar anObject = __webpack_require__(5);\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5nZXQuanM/NDh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lY3QnLCB7IGdldDogZ2V0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmdldC5qc1xuLy8gbW9kdWxlIGlkID0gMzUzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///353\n")},function(module,exports,__webpack_require__){eval("// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = __webpack_require__(29);\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanM/MDM5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjcgUmVmbGVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodGFyZ2V0LCBwcm9wZXJ0eUtleSlcbnZhciBnT1BEID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdSZWZsZWN0Jywge1xuICBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I6IGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcih0YXJnZXQsIHByb3BlcnR5S2V5KSB7XG4gICAgcmV0dXJuIGdPUEQuZihhbk9iamVjdCh0YXJnZXQpLCBwcm9wZXJ0eUtleSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gMzU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///354\n")},function(module,exports,__webpack_require__){eval("// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = __webpack_require__(0);\nvar getProto = __webpack_require__(30);\nvar anObject = __webpack_require__(5);\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5nZXQtcHJvdG90eXBlLW9mLmpzPzNlZTQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjYuMS44IFJlZmxlY3QuZ2V0UHJvdG90eXBlT2YodGFyZ2V0KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBnZXRQcm90byA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1JlZmxlY3QnLCB7XG4gIGdldFByb3RvdHlwZU9mOiBmdW5jdGlvbiBnZXRQcm90b3R5cGVPZih0YXJnZXQpIHtcbiAgICByZXR1cm4gZ2V0UHJvdG8oYW5PYmplY3QodGFyZ2V0KSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmdldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDM1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///355\n")},function(module,exports,__webpack_require__){eval("// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5oYXMuanM/NzY2ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjkgUmVmbGVjdC5oYXModGFyZ2V0LCBwcm9wZXJ0eUtleSlcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHtcbiAgaGFzOiBmdW5jdGlvbiBoYXModGFyZ2V0LCBwcm9wZXJ0eUtleSkge1xuICAgIHJldHVybiBwcm9wZXJ0eUtleSBpbiB0YXJnZXQ7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0Lmhhcy5qc1xuLy8gbW9kdWxlIGlkID0gMzU2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///356\n")},function(module,exports,__webpack_require__){eval("// 26.1.10 Reflect.isExtensible(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5pcy1leHRlbnNpYmxlLmpzPzI0NmQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjYuMS4xMCBSZWZsZWN0LmlzRXh0ZW5zaWJsZSh0YXJnZXQpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgJGlzRXh0ZW5zaWJsZSA9IE9iamVjdC5pc0V4dGVuc2libGU7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHtcbiAgaXNFeHRlbnNpYmxlOiBmdW5jdGlvbiBpc0V4dGVuc2libGUodGFyZ2V0KSB7XG4gICAgYW5PYmplY3QodGFyZ2V0KTtcbiAgICByZXR1cm4gJGlzRXh0ZW5zaWJsZSA/ICRpc0V4dGVuc2libGUodGFyZ2V0KSA6IHRydWU7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmlzLWV4dGVuc2libGUuanNcbi8vIG1vZHVsZSBpZCA9IDM1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///357\n")},function(module,exports,__webpack_require__){eval("// 26.1.11 Reflect.ownKeys(target)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Reflect', { ownKeys: __webpack_require__(182) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5vd24ta2V5cy5qcz80NzBlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDI2LjEuMTEgUmVmbGVjdC5vd25LZXlzKHRhcmdldClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHsgb3duS2V5czogcmVxdWlyZSgnLi9fb3duLWtleXMnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5vd24ta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMzU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///358\n")},function(module,exports,__webpack_require__){eval("// 26.1.12 Reflect.preventExtensions(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5wcmV2ZW50LWV4dGVuc2lvbnMuanM/ZjY2MSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjEyIFJlZmxlY3QucHJldmVudEV4dGVuc2lvbnModGFyZ2V0KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyICRwcmV2ZW50RXh0ZW5zaW9ucyA9IE9iamVjdC5wcmV2ZW50RXh0ZW5zaW9ucztcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdSZWZsZWN0Jywge1xuICBwcmV2ZW50RXh0ZW5zaW9uczogZnVuY3Rpb24gcHJldmVudEV4dGVuc2lvbnModGFyZ2V0KSB7XG4gICAgYW5PYmplY3QodGFyZ2V0KTtcbiAgICB0cnkge1xuICAgICAgaWYgKCRwcmV2ZW50RXh0ZW5zaW9ucykgJHByZXZlbnRFeHRlbnNpb25zKHRhcmdldCk7XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5wcmV2ZW50LWV4dGVuc2lvbnMuanNcbi8vIG1vZHVsZSBpZCA9IDM1OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///359\n")},function(module,exports,__webpack_require__){eval("// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = __webpack_require__(13);\nvar gOPD = __webpack_require__(29);\nvar getPrototypeOf = __webpack_require__(30);\nvar has = __webpack_require__(27);\nvar $export = __webpack_require__(0);\nvar createDesc = __webpack_require__(52);\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5zZXQuanM/NmQ0NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjEzIFJlZmxlY3Quc2V0KHRhcmdldCwgcHJvcGVydHlLZXksIFYgWywgcmVjZWl2ZXJdKVxudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgZ09QRCA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNyZWF0ZURlc2MgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBpc09iamVjdCA9IHJl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XksIGNyZWF0ZURlc2MoMCwgVikpO1xuICAgIHJldHVybiB0cnVlO1xuICB9XG4gIHJldHVybiBvd25EZXNjLnNldCA9PT0gdW5kZWZpbmVkID8gZmFsc2UgOiAob3duRGVzYy5zZXQuY2FsbChyZWNlaXZlciwgViksIHRydWUpO1xufVxuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1JlZmxlY3QnLCB7IHNldDogc2V0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LnNldC5qc1xuLy8gbW9kdWxlIGlkID0gMzYwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///360\n")},function(module,exports,__webpack_require__){eval("// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = __webpack_require__(0);\nvar setProto = __webpack_require__(111);\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5zZXQtcHJvdG90eXBlLW9mLmpzPzk5M2EiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjYuMS4xNCBSZWZsZWN0LnNldFByb3RvdHlwZU9mKHRhcmdldCwgcHJvdG8pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHNldFByb3RvID0gcmVxdWlyZSgnLi9fc2V0LXByb3RvJyk7XG5cbmlmIChzZXRQcm90bykgJGV4cG9ydCgkZXhwb3J0LlMsICdSZWZsZWN0Jywge1xuICBzZXRQcm90b3R5cGVPZjogZnVuY3Rpb24gc2V0UHJvdG90eXBlT2YodGFyZ2V0LCBwcm90bykge1xuICAgIHNldFByb3RvLmNoZWNrKHRhcmdldCwgcHJvdG8pO1xuICAgIHRyeSB7XG4gICAgICBzZXRQcm90by5zZXQodGFyZ2V0LCBwcm90byk7XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5zZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzNjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///361\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/Array.prototype.includes\nvar $export = __webpack_require__(0);\nvar $includes = __webpack_require__(84)(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n__webpack_require__(49)('includes');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXJyYXkuaW5jbHVkZXMuanM/ODFiYyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9BcnJheS5wcm90b3R5cGUuaW5jbHVkZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGluY2x1ZGVzID0gcmVxdWlyZSgnLi9fYXJyYXktaW5jbHVkZXMnKSh0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAsICdBcnJheScsIHtcbiAgaW5jbHVkZXM6IGZ1bmN0aW9uIGluY2x1ZGVzKGVsIC8qICwgZnJvbUluZGV4ID0gMCAqLykge1xuICAgIHJldHVybiAkaW5jbHVkZXModGhpcywgZWwsIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkKTtcbiAgfVxufSk7XG5cbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKCdpbmNsdWRlcycpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5hcnJheS5pbmNsdWRlcy5qc1xuLy8gbW9kdWxlIGlkID0gMzYyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///362\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = __webpack_require__(0);\nvar flattenIntoArray = __webpack_require__(183);\nvar toObject = __webpack_require__(19);\nvar toLength = __webpack_require__(14);\nvar aFunction = __webpack_require__(20);\nvar arraySpeciesCreate = __webpack_require__(125);\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\n__webpack_require__(49)('flatMap');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXJyYXkuZmxhdC1tYXAuanM/YTA1ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLWZsYXRNYXAvI3NlYy1BcnJheS5wcm90b3R5cGUuZmxhdE1hcFxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBmbGF0dGVuSW50b0FycmF5ID0gcmVxdWlyZSgnLi9fZmxhdHRlbi1pbnRvLWFycmF5Jyk7XG52YXIgdG9PYmplY3QgPSByZXF1aXJlKCcuL190by1vYmplY3QnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xud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al:///363\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten\nvar $export = __webpack_require__(0);\nvar flattenIntoArray = __webpack_require__(183);\nvar toObject = __webpack_require__(19);\nvar toLength = __webpack_require__(14);\nvar toInteger = __webpack_require__(38);\nvar arraySpeciesCreate = __webpack_require__(125);\n\n$export($export.P, 'Array', {\n flatten: function flatten(/* depthArg = 1 */) {\n var depthArg = arguments[0];\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n\n__webpack_require__(49)('flatten');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXJyYXkuZmxhdHRlbi5qcz9iZmRkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtZmxhdE1hcC8jc2VjLUFycmF5LnByb3RvdHlwZS5mbGF0dGVuXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGZsYXR0ZW5JbnRvQXJyYXkgPSByZXF1aXJlKCcuL19mbGF0dGVuLWludG8tYXJyYXknKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG52YXIgdG9JbnRlZ2VyID0gcmVxdWlyZSgnLi9fdG8taW50ZWdlcicpO1xudmFyIGFycmF5U3BlY2llc0NyZWF0ZSA9IHJlcXVpcmUoJy4vX2FycmF5LXNwZWNpZXMtY3JlYXRlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnQXJyYXknLCB7XG4gIGZsYXR0ZW46IGZ1bmN0aW9uIGZsYXR0ZW4oLyogZGVwdGhBcmcgPSAxICovKSB7XG4gICAgdmFyIGRlcHRoQXJnID0gYXJndW1lbnRzWzBdO1xuICAgIHZhciBPID0gdG9PYmplY3QodGhpcyk7XG4gICAgdmFyIHNvdXJjZUxlbiA9IHRvTGVuZ3RoKE8ubGVuZ3RoKTtcbiAgICB2YXIgQSA9IGFycmF5U3BlY2llc0NyZWF0ZShPLCAwKTtcbiAgICBmbGF0dGVuSW50b0FycmF5KEEsIE8sIE8sIHNvdXJjZUxlbiwgMCwgZGVwdGhBcmcgPT09IHVuZGVmaW5lZCA/IDEgOiB0b0ludGVnZXIoZGVwdGhBcmcpKTtcbiAgICByZXR1cm4gQTtcbiAgfVxufSk7XG5cbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKCdmbGF0dGVuJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LmFycmF5LmZsYXR0ZW4uanNcbi8vIG1vZHVsZSBpZCA9IDM2NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///364\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/mathiasbynens/String.prototype.at\nvar $export = __webpack_require__(0);\nvar $at = __webpack_require__(117)(true);\n\n$export($export.P, 'String', {\n at: function at(pos) {\n return $at(this, pos);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLmF0LmpzP2ZiNmYiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly9naXRodWIuY29tL21hdGhpYXNieW5lbnMvU3RyaW5nLnByb3RvdHlwZS5hdFxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAsICdTdHJpbmcnLCB7XG4gIGF0OiBmdW5jdGlvbiBhdChwb3MpIHtcbiAgICByZXR1cm4gJGF0KHRoaXMsIHBvcyk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcuYXQuanNcbi8vIG1vZHVsZSBpZCA9IDM2NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///365\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(0);\nvar $pad = __webpack_require__(184);\nvar userAgent = __webpack_require__(92);\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnBhZC1zdGFydC5qcz9iMjY0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLXN0cmluZy1wYWQtc3RhcnQtZW5kXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRwYWQgPSByZXF1aXJlKCcuL19zdHJpbmctcGFkJyk7XG52YXIgdXNlckFnZW50ID0gcmVxdWlyZSgnLi9fdXNlci1hZ2VudCcpO1xuXG4vLyBodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcy9pc3N1ZXMvMjgwXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIC9WZXJzaW9uXFwvMTBcXC5cXGQrKFxcLlxcZCspPyBTYWZhcmlcXC8vLnRlc3QodXNlckFnZW50KSwgJ1N0cmluZycsIHtcbiAgcGFkU3RhcnQ6IGZ1bmN0aW9uIHBhZFN0YXJ0KG1heExlbmd0aCAvKiAsIGZpbGxTdHJpbmcgPSAnICcgKi8pIHtcbiAgICByZXR1cm4gJHBhZCh0aGlzLCBtYXhMZW5ndGgsIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkLCB0cnVlKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN0cmluZy5wYWQtc3RhcnQuanNcbi8vIG1vZHVsZSBpZCA9IDM2NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///366\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(0);\nvar $pad = __webpack_require__(184);\nvar userAgent = __webpack_require__(92);\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnBhZC1lbmQuanM/OWJjMSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1zdHJpbmctcGFkLXN0YXJ0LWVuZFxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcGFkID0gcmVxdWlyZSgnLi9fc3RyaW5nLXBhZCcpO1xudmFyIHVzZXJBZ2VudCA9IHJlcXVpcmUoJy4vX3VzZXItYWdlbnQnKTtcblxuLy8gaHR0cHM6Ly9naXRodWIuY29tL3psb2lyb2NrL2NvcmUtanMvaXNzdWVzLzI4MFxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAvVmVyc2lvblxcLzEwXFwuXFxkKyhcXC5cXGQrKT8gU2FmYXJpXFwvLy50ZXN0KHVzZXJBZ2VudCksICdTdHJpbmcnLCB7XG4gIHBhZEVuZDogZnVuY3Rpb24gcGFkRW5kKG1heExlbmd0aCAvKiAsIGZpbGxTdHJpbmcgPSAnICcgKi8pIHtcbiAgICByZXR1cm4gJHBhZCh0aGlzLCBtYXhMZW5ndGgsIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkLCBmYWxzZSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcucGFkLWVuZC5qc1xuLy8gbW9kdWxlIGlkID0gMzY3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///367\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n__webpack_require__(65)('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnRyaW0tbGVmdC5qcz9jNjdmIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9zZWJtYXJrYmFnZS9lY21hc2NyaXB0LXN0cmluZy1sZWZ0LXJpZ2h0LXRyaW1cbnJlcXVpcmUoJy4vX3N0cmluZy10cmltJykoJ3RyaW1MZWZ0JywgZnVuY3Rpb24gKCR0cmltKSB7XG4gIHJldHVybiBmdW5jdGlvbiB0cmltTGVmdCgpIHtcbiAgICByZXR1cm4gJHRyaW0odGhpcywgMSk7XG4gIH07XG59LCAndHJpbVN0YXJ0Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN0cmluZy50cmltLWxlZnQuanNcbi8vIG1vZHVsZSBpZCA9IDM2OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///368\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n__webpack_require__(65)('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnRyaW0tcmlnaHQuanM/MmQxMiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vc2VibWFya2JhZ2UvZWNtYXNjcmlwdC1zdHJpbmctbGVmdC1yaWdodC10cmltXG5yZXF1aXJlKCcuL19zdHJpbmctdHJpbScpKCd0cmltUmlnaHQnLCBmdW5jdGlvbiAoJHRyaW0pIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIHRyaW1SaWdodCgpIHtcbiAgICByZXR1cm4gJHRyaW0odGhpcywgMik7XG4gIH07XG59LCAndHJpbUVuZCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcudHJpbS1yaWdodC5qc1xuLy8gbW9kdWxlIGlkID0gMzY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///369\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/String.prototype.matchAll/\nvar $export = __webpack_require__(0);\nvar defined = __webpack_require__(37);\nvar toLength = __webpack_require__(14);\nvar isRegExp = __webpack_require__(87);\nvar getFlags = __webpack_require__(89);\nvar RegExpProto = RegExp.prototype;\n\nvar $RegExpStringIterator = function (regexp, string) {\n this._r = regexp;\n this._s = string;\n};\n\n__webpack_require__(119)($RegExpStringIterator, 'RegExp String', function next() {\n var match = this._r.exec(this._s);\n return { value: match, done: match === null };\n});\n\n$export($export.P, 'String', {\n matchAll: function matchAll(regexp) {\n defined(this);\n if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');\n var S = String(this);\n var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);\n var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);\n rx.lastIndex = toLength(regexp.lastIndex);\n return new $RegExpStringIterator(rx, S);\n }\n});\n//# sourceURL=[module]\n//# sourceMapp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iAgICBkZWZpbmVkKHRoaXMpO1xuICAgIGlmICghaXNSZWdFeHAocmVnZXhwKSkgdGhyb3cgVHlwZUVycm9yKHJlZ2V4cCArICcgaXMgbm90IGEgcmVnZXhwIScpO1xuICAgIHZhciBTID0gU3RyaW5nKHRoaXMpO1xuICAgIHZhciBmbGFncyA9ICdmbGFncycgaW4gUmVnRXhwUHJvdG8gPyBTdHJpbmcocmVnZXhwLmZsYWdzKSA6IGdldEZsYWdzLmNhbGwocmVnZXhwKTtcbiAgICB2YXIgcnggPSBuZXcgUmVnRXhwKHJlZ2V4cC5zb3VyY2UsIH5mbGFncy5pbmRleE9mKCdnJykgPyBmbGFncyA6ICdnJyArIGZsYWdzKTtcbiAgICByeC5sYXN0SW5kZXggPSB0b0xlbmd0aChyZWdleHAubGFzdEluZGV4KTtcbiAgICByZXR1cm4gbmV3ICRSZWdFeHBTdHJpbmdJdGVyYXRvcihyeCwgUyk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcubWF0Y2gtYWxsLmpzXG4vLyBtb2R1bGUgaWQgPSAzNzBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///370\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(107)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3ltYm9sLmFzeW5jLWl0ZXJhdG9yLmpzP2Y1ODgiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fd2tzLWRlZmluZScpKCdhc3luY0l0ZXJhdG9yJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gMzcxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///371\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(107)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUuanM/YmVlZiJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL193a3MtZGVmaW5lJykoJ29ic2VydmFibGUnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUuanNcbi8vIG1vZHVsZSBpZCA9IDM3MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///372\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = __webpack_require__(0);\nvar ownKeys = __webpack_require__(182);\nvar toIObject = __webpack_require__(28);\nvar gOPD = __webpack_require__(29);\nvar createProperty = __webpack_require__(123);\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvcnMuanM/Y2U2YyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1vYmplY3QtZ2V0b3ducHJvcGVydHlkZXNjcmlwdG9yc1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBvd25LZXlzID0gcmVxdWlyZSgnLi9fb3duLWtleXMnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgZ09QRCA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJyk7XG52YXIgY3JlYXRlUHJvcGVydHkgPSByZXF1aXJlKCcuL19jcmVhdGUtcHJvcGVydHknKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7XG4gIGdldE93blByb3BlcnR5RGVzY3JpcHRvcnM6IGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcnMob2JqZWN0KSB7XG4gICAgdmFyIE8gPSB0b0lPYmplY3Qob2JqZWN0KTtcbiAgICB2YXIgZ2V0RGVzYyA9IGdPUEQuZjtcbiAgICB2YXIga2V5cyA9IG93bktleXMoTyk7XG4gICAgdmFyIHJlc3VsdCA9IHt9O1xuICAgIHZhciBpID0gMDtcbiAgICB2YXIga2V5LCBkZXNjO1xuICAgIHdoaWxlIChrZXlzLmxlbmd0aCA+IGkpIHtcbiAgICAgIGRlc2MgPSBnZXREZXNjKE8sIGtleSA9IGtleXNbaSsrXSk7XG4gICAgICBpZiAoZGVzYyAhPT0gdW5kZWZpbmVkKSBjcmVhdGVQcm9wZXJ0eShyZXN1bHQsIGtleSwgZGVzYyk7XG4gICAgfVxuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gMzczXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///373\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(0);\nvar $values = __webpack_require__(185)(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LnZhbHVlcy5qcz82MTU5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLW9iamVjdC12YWx1ZXMtZW50cmllc1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkdmFsdWVzID0gcmVxdWlyZSgnLi9fb2JqZWN0LXRvLWFycmF5JykoZmFsc2UpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHtcbiAgdmFsdWVzOiBmdW5jdGlvbiB2YWx1ZXMoaXQpIHtcbiAgICByZXR1cm4gJHZhbHVlcyhpdCk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5vYmplY3QudmFsdWVzLmpzXG4vLyBtb2R1bGUgaWQgPSAzNzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///374\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(0);\nvar $entries = __webpack_require__(185)(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmVudHJpZXMuanM/MTRhNyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1vYmplY3QtdmFsdWVzLWVudHJpZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGVudHJpZXMgPSByZXF1aXJlKCcuL19vYmplY3QtdG8tYXJyYXknKSh0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7XG4gIGVudHJpZXM6IGZ1bmN0aW9uIGVudHJpZXMoaXQpIHtcbiAgICByZXR1cm4gJGVudHJpZXMoaXQpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmVudHJpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDM3NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///375\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar aFunction = __webpack_require__(20);\nvar $defineProperty = __webpack_require__(13);\n\n// B.2.2.2 Object.prototype.__defineGetter__(P, getter)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __defineGetter__: function __defineGetter__(P, getter) {\n $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n});\n//# sourceURL=[module]\n//# sourceM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2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///376\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar aFunction = __webpack_require__(20);\nvar $defineProperty = __webpack_require__(13);\n\n// B.2.2.3 Object.prototype.__defineSetter__(P, setter)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __defineSetter__: function __defineSetter__(P, setter) {\n $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmRlZmluZS1zZXR0ZXIuanM/NzcxNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgYUZ1bmN0aW9uID0gcmVxdWlyZSgnLi9fYS1mdW5jdGlvbicpO1xudmFyICRkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xuXG4vLyBCLjIuMi4zIE9iamVjdC5wcm90b3R5cGUuX19kZWZpbmVTZXR0ZXJfXyhQLCBzZXR0ZXIpXG5yZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICRleHBvcnQoJGV4cG9ydC5QICsgcmVxdWlyZSgnLi9fb2JqZWN0LWZvcmNlZC1wYW0nKSwgJ09iamVjdCcsIHtcbiAgX19kZWZpbmVTZXR0ZXJfXzogZnVuY3Rpb24gX19kZWZpbmVTZXR0ZXJfXyhQLCBzZXR0ZXIpIHtcbiAgICAkZGVmaW5lUHJvcGVydHkuZih0b09iamVjdCh0aGlzKSwgUCwgeyBzZXQ6IGFGdW5jdGlvbihzZXR0ZXIpLCBlbnVtZXJhYmxlOiB0cnVlLCBjb25maWd1cmFibGU6IHRydWUgfSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5vYmplY3QuZGVmaW5lLXNldHRlci5qc1xuLy8gbW9kdWxlIGlkID0gMzc3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///377\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar toPrimitive = __webpack_require__(36);\nvar getPrototypeOf = __webpack_require__(30);\nvar getOwnPropertyDescriptor = __webpack_require__(29).f;\n\n// B.2.2.4 Object.prototype.__lookupGetter__(P)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.get;\n } while (O = getPrototypeOf(O));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc4LmpzIiwic291cmNl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jb3JlLWpzL21vZHVsZXMvZXM3Lm9iamVjdC5sb29rdXAtZ2V0dGVyLmpzXG4vLyBtb2R1bGUgaWQgPSAzNzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///378\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar toPrimitive = __webpack_require__(36);\nvar getPrototypeOf = __webpack_require__(30);\nvar getOwnPropertyDescriptor = __webpack_require__(29).f;\n\n// B.2.2.5 Object.prototype.__lookupSetter__(P)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.set;\n } while (O = getPrototypeOf(O));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0Lmxvb2t1cC1zZXR0ZXIuanM/MDI0NCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBnZXRQ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("// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(0);\n\n$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(186)('Map') });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLnRvLWpzb24uanM/ODdiNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vRGF2aWRCcnVhbnQvTWFwLVNldC5wcm90b3R5cGUudG9KU09OXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuUiwgJ01hcCcsIHsgdG9KU09OOiByZXF1aXJlKCcuL19jb2xsZWN0aW9uLXRvLWpzb24nKSgnTWFwJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hcC50by1qc29uLmpzXG4vLyBtb2R1bGUgaWQgPSAzODBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///380\n")},function(module,exports,__webpack_require__){eval("// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(0);\n\n$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(186)('Set') });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0LnRvLWpzb24uanM/NmFiMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vRGF2aWRCcnVhbnQvTWFwLVNldC5wcm90b3R5cGUudG9KU09OXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuUiwgJ1NldCcsIHsgdG9KU09OOiByZXF1aXJlKCcuL19jb2xsZWN0aW9uLXRvLWpzb24nKSgnU2V0JykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnNldC50by1qc29uLmpzXG4vLyBtb2R1bGUgaWQgPSAzODFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///381\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\n__webpack_require__(96)('Map');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLm9mLmpzPzI0OWQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1zZXRtYXAtb2Zmcm9tLyNzZWMtbWFwLm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdNYXAnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///382\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\n__webpack_require__(96)('Set');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0Lm9mLmpzP2E5OTYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1zZXRtYXAtb2Zmcm9tLyNzZWMtc2V0Lm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdTZXQnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0Lm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///383\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\n__webpack_require__(96)('WeakMap');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1tYXAub2YuanM/MmRhZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy13ZWFrbWFwLm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdXZWFrTWFwJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstbWFwLm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///384\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\n__webpack_require__(96)('WeakSet');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1zZXQub2YuanM/MDRlNiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy13ZWFrc2V0Lm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdXZWFrU2V0Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstc2V0Lm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///385\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\n__webpack_require__(97)('Map');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLmZyb20uanM/ZTJiOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy1tYXAuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdNYXAnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM4NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///386\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\n__webpack_require__(97)('Set');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0LmZyb20uanM/NjIwOCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy1zZXQuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdTZXQnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0LmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM4N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///387\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\n__webpack_require__(97)('WeakMap');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1tYXAuZnJvbS5qcz9lOTdjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtc2V0bWFwLW9mZnJvbS8jc2VjLXdlYWttYXAuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdXZWFrTWFwJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstbWFwLmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM4OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///388\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\n__webpack_require__(97)('WeakSet');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1zZXQuZnJvbS5qcz9hOWQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtc2V0bWFwLW9mZnJvbS8jc2VjLXdlYWtzZXQuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdXZWFrU2V0Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstc2V0LmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM4OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///389\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-global\nvar $export = __webpack_require__(0);\n\n$export($export.G, { global: __webpack_require__(7) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuZ2xvYmFsLmpzPzBkMDciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtZ2xvYmFsXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuRywgeyBnbG9iYWw6IHJlcXVpcmUoJy4vX2dsb2JhbCcpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5nbG9iYWwuanNcbi8vIG1vZHVsZSBpZCA9IDM5MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///390\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-global\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'System', { global: __webpack_require__(7) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3lzdGVtLmdsb2JhbC5qcz84ZmYyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLWdsb2JhbFxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdTeXN0ZW0nLCB7IGdsb2JhbDogcmVxdWlyZSgnLi9fZ2xvYmFsJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN5c3RlbS5nbG9iYWwuanNcbi8vIG1vZHVsZSBpZCA9IDM5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///391\n")},function(module,exports,__webpack_require__){eval("// https://github.com/ljharb/proposal-is-error\nvar $export = __webpack_require__(0);\nvar cof = __webpack_require__(33);\n\n$export($export.S, 'Error', {\n isError: function isError(it) {\n return cof(it) === 'Error';\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuZXJyb3IuaXMtZXJyb3IuanM/NTNlNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vbGpoYXJiL3Byb3Bvc2FsLWlzLWVycm9yXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ0Vycm9yJywge1xuICBpc0Vycm9yOiBmdW5jdGlvbiBpc0Vycm9yKGl0KSB7XG4gICAgcmV0dXJuIGNvZihpdCkgPT09ICdFcnJvcic7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5lcnJvci5pcy1lcnJvci5qc1xuLy8gbW9kdWxlIGlkID0gMzkyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///392\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n clamp: function clamp(x, lower, upper) {\n return Math.min(upper, Math.max(lower, x));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5jbGFtcC5qcz81ZmEzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgY2xhbXA6IGZ1bmN0aW9uIGNsYW1wKHgsIGxvd2VyLCB1cHBlcikge1xuICAgIHJldHVybiBNYXRoLm1pbih1cHBlciwgTWF0aC5tYXgobG93ZXIsIHgpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguY2xhbXAuanNcbi8vIG1vZHVsZSBpZCA9IDM5M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///393\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5kZWctcGVyLXJhZC5qcz81YjRhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgREVHX1BFUl9SQUQ6IE1hdGguUEkgLyAxODAgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguZGVnLXBlci1yYWQuanNcbi8vIG1vZHVsZSBpZCA9IDM5NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///394\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar RAD_PER_DEG = 180 / Math.PI;\n\n$export($export.S, 'Math', {\n degrees: function degrees(radians) {\n return radians * RAD_PER_DEG;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5kZWdyZWVzLmpzP2I1YTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9yd2FsZHJvbi5naXRodWIuaW8vcHJvcG9zYWwtbWF0aC1leHRlbnNpb25zL1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBSQURfUEVSX0RFRyA9IDE4MCAvIE1hdGguUEk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgZGVncmVlczogZnVuY3Rpb24gZGVncmVlcyhyYWRpYW5zKSB7XG4gICAgcmV0dXJuIHJhZGlhbnMgKiBSQURfUEVSX0RFRztcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguZGVncmVlcy5qc1xuLy8gbW9kdWxlIGlkID0gMzk1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///395\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar scale = __webpack_require__(188);\nvar fround = __webpack_require__(168);\n\n$export($export.S, 'Math', {\n fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {\n return fround(scale(x, inLow, inHigh, outLow, outHigh));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5mc2NhbGUuanM/YmU3NSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3J3YWxkcm9uLmdpdGh1Yi5pby9wcm9wb3NhbC1tYXRoLWV4dGVuc2lvbnMvXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHNjYWxlID0gcmVxdWlyZSgnLi9fbWF0aC1zY2FsZScpO1xudmFyIGZyb3VuZCA9IHJlcXVpcmUoJy4vX21hdGgtZnJvdW5kJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgZnNjYWxlOiBmdW5jdGlvbiBmc2NhbGUoeCwgaW5Mb3csIGluSGlnaCwgb3V0TG93LCBvdXRIaWdoKSB7XG4gICAgcmV0dXJuIGZyb3VuZChzY2FsZSh4LCBpbkxvdywgaW5IaWdoLCBvdXRMb3csIG91dEhpZ2gpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguZnNjYWxlLmpzXG4vLyBtb2R1bGUgaWQgPSAzOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///396\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n iaddh: function iaddh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5pYWRkaC5qcz80NzcyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyZW5kYW5FaWNoLzQyOTRkNWMyMTJhNmQyMjU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGlhZGRoOiBmdW5jdGlvbiBpYWRkaCh4MCwgeDEsIHkwLCB5MSkge1xuICAgIHZhciAkeDAgPSB4MCA+Pj4gMDtcbiAgICB2YXIgJHgxID0geDEgPj4+IDA7XG4gICAgdmFyICR5MCA9IHkwID4+PiAwO1xuICAgIHJldHVybiAkeDEgKyAoeTEgPj4+IDApICsgKCgkeDAgJiAkeTAgfCAoJHgwIHwgJHkwKSAmIH4oJHgwICsgJHkwID4+PiAwKSkgPj4+IDMxKSB8IDA7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5tYXRoLmlhZGRoLmpzXG4vLyBtb2R1bGUgaWQgPSAzOTdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///397\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n isubh: function isubh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5pc3ViaC5qcz9lYTIzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyZW5kYW5FaWNoLzQyOTRkNWMyMTJhNmQyMjU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGlzdWJoOiBmdW5jdGlvbiBpc3ViaCh4MCwgeDEsIHkwLCB5MSkge1xuICAgIHZhciAkeDAgPSB4MCA+Pj4gMDtcbiAgICB2YXIgJHgxID0geDEgPj4+IDA7XG4gICAgdmFyICR5MCA9IHkwID4+PiAwO1xuICAgIHJldHVybiAkeDEgLSAoeTEgPj4+IDApIC0gKCh+JHgwICYgJHkwIHwgfigkeDAgXiAkeTApICYgJHgwIC0gJHkwID4+PiAwKSA+Pj4gMzEpIHwgMDtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguaXN1YmguanNcbi8vIG1vZHVsZSBpZCA9IDM5OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///398\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n imulh: function imulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >> 16;\n var v1 = $v >> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5pbXVsaC5qcz8wNzc1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyZW5kYW5FaWNoLzQyOTRkNWMyMTJhNmQyMjU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGltdWxoOiBmdW5jdGlvbiBpbXVsaCh1LCB2KSB7XG4gICAgdmFyIFVJTlQxNiA9IDB4ZmZmZjtcbiAgICB2YXIgJHUgPSArdTtcbiAgICB2YXIgJHYgPSArdjtcbiAgICB2YXIgdTAgPSAkdSAmIFVJTlQxNjtcbiAgICB2YXIgdjAgPSAkdiAmIFVJTlQxNjtcbiAgICB2YXIgdTEgPSAkdSA+PiAxNjtcbiAgICB2YXIgdjEgPSAkdiA+PiAxNjtcbiAgICB2YXIgdCA9ICh1MSAqIHYwID4+PiAwKSArICh1MCAqIHYwID4+PiAxNik7XG4gICAgcmV0dXJuIHUxICogdjEgKyAodCA+PiAxNikgKyAoKHUwICogdjEgPj4+IDApICsgKHQgJiBVSU5UMTYpID4+IDE2KTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguaW11bGguanNcbi8vIG1vZHVsZSBpZCA9IDM5OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///399\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5yYWQtcGVyLWRlZy5qcz9kZWNmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgUkFEX1BFUl9ERUc6IDE4MCAvIE1hdGguUEkgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGgucmFkLXBlci1kZWcuanNcbi8vIG1vZHVsZSBpZCA9IDQwMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///400\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar DEG_PER_RAD = Math.PI / 180;\n\n$export($export.S, 'Math', {\n radians: function radians(degrees) {\n return degrees * DEG_PER_RAD;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5yYWRpYW5zLmpzPzE3NWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9yd2FsZHJvbi5naXRodWIuaW8vcHJvcG9zYWwtbWF0aC1leHRlbnNpb25zL1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBERUdfUEVSX1JBRCA9IE1hdGguUEkgLyAxODA7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgcmFkaWFuczogZnVuY3Rpb24gcmFkaWFucyhkZWdyZWVzKSB7XG4gICAgcmV0dXJuIGRlZ3JlZXMgKiBERUdfUEVSX1JBRDtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGgucmFkaWFucy5qc1xuLy8gbW9kdWxlIGlkID0gNDAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///401\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { scale: __webpack_require__(188) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5zY2FsZS5qcz9iODQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgc2NhbGU6IHJlcXVpcmUoJy4vX21hdGgtc2NhbGUnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5zY2FsZS5qc1xuLy8gbW9kdWxlIGlkID0gNDAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///402\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n umulh: function umulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >>> 16;\n var v1 = $v >>> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC51bXVsaC5qcz84YjRkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyZW5kYW5FaWNoLzQyOTRkNWMyMTJhNmQyMjU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIHVtdWxoOiBmdW5jdGlvbiB1bXVsaCh1LCB2KSB7XG4gICAgdmFyIFVJTlQxNiA9IDB4ZmZmZjtcbiAgICB2YXIgJHUgPSArdTtcbiAgICB2YXIgJHYgPSArdjtcbiAgICB2YXIgdTAgPSAkdSAmIFVJTlQxNjtcbiAgICB2YXIgdjAgPSAkdiAmIFVJTlQxNjtcbiAgICB2YXIgdTEgPSAkdSA+Pj4gMTY7XG4gICAgdmFyIHYxID0gJHYgPj4+IDE2O1xuICAgIHZhciB0ID0gKHUxICogdjAgPj4+IDApICsgKHUwICogdjAgPj4+IDE2KTtcbiAgICByZXR1cm4gdTEgKiB2MSArICh0ID4+PiAxNikgKyAoKHUwICogdjEgPj4+IDApICsgKHQgJiBVSU5UMTYpID4+PiAxNik7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5tYXRoLnVtdWxoLmpzXG4vLyBtb2R1bGUgaWQgPSA0MDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///403\n")},function(module,exports,__webpack_require__){eval("// http://jfbastien.github.io/papers/Math.signbit.html\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { signbit: function signbit(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5zaWduYml0LmpzPzFmYmMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cDovL2pmYmFzdGllbi5naXRodWIuaW8vcGFwZXJzL01hdGguc2lnbmJpdC5odG1sXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7IHNpZ25iaXQ6IGZ1bmN0aW9uIHNpZ25iaXQoeCkge1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gIHJldHVybiAoeCA9ICt4KSAhPSB4ID8geCA6IHggPT0gMCA/IDEgLyB4ID09IEluZmluaXR5IDogeCA+IDA7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5tYXRoLnNpZ25iaXQuanNcbi8vIG1vZHVsZSBpZCA9IDQwNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///404\n")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(0);\nvar core = __webpack_require__(31);\nvar global = __webpack_require__(7);\nvar speciesConstructor = __webpack_require__(91);\nvar promiseResolve = __webpack_require__(175);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc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W5hbGx5XG4gICk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5wcm9taXNlLmZpbmFsbHkuanNcbi8vIG1vZHVsZSBpZCA9IDQwNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///405\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(0);\nvar newPromiseCapability = __webpack_require__(130);\nvar perform = __webpack_require__(174);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucHJvbWlzZS50cnkuanM/NDFjNSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1wcm9taXNlLXRyeVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBuZXdQcm9taXNlQ2FwYWJpbGl0eSA9IHJlcXVpcmUoJy4vX25ldy1wcm9taXNlLWNhcGFiaWxpdHknKTtcbnZhciBwZXJmb3JtID0gcmVxdWlyZSgnLi9fcGVyZm9ybScpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1Byb21pc2UnLCB7ICd0cnknOiBmdW5jdGlvbiAoY2FsbGJhY2tmbikge1xuICB2YXIgcHJvbWlzZUNhcGFiaWxpdHkgPSBuZXdQcm9taXNlQ2FwYWJpbGl0eS5mKHRoaXMpO1xuICB2YXIgcmVzdWx0ID0gcGVyZm9ybShjYWxsYmFja2ZuKTtcbiAgKHJlc3VsdC5lID8gcHJvbWlzZUNhcGFiaWxpdHkucmVqZWN0IDogcHJvbWlzZUNhcGFiaWxpdHkucmVzb2x2ZSkocmVzdWx0LnYpO1xuICByZXR1cm4gcHJvbWlzZUNhcGFiaWxpdHkucHJvbWlzZTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnByb21pc2UudHJ5LmpzXG4vLyBtb2R1bGUgaWQgPSA0MDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///406\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar toMetaKey = metadata.key;\nvar ordinaryDefineOwnMetadata = metadata.set;\n\nmetadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {\n ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWZpbmUtbWV0YWRhdGEuanM/Yzg5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xudmFyIG9yZGluYXJ5RGVmaW5lT3duTWV0YWRhdGEgPSBtZXRhZGF0YS5zZXQ7XG5cbm1ldGFkYXRhLmV4cCh7IGRlZmluZU1ldGFkYXRhOiBmdW5jdGlvbiBkZWZpbmVNZXRhZGF0YShtZXRhZGF0YUtleSwgbWV0YWRhdGFWYWx1ZSwgdGFyZ2V0LCB0YXJnZXRLZXkpIHtcbiAgb3JkaW5hcnlEZWZpbmVPd25NZXRhZGF0YShtZXRhZGF0YUtleSwgbWV0YWRhdGFWYWx1ZSwgYW5PYmplY3QodGFyZ2V0KSwgdG9NZXRhS2V5KHRhcmdldEtleSkpO1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWZpbmUtbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQwN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///407\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar toMetaKey = metadata.key;\nvar getOrCreateMetadataMap = metadata.map;\nvar store = metadata.store;\n\nmetadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {\n var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);\n var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);\n if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;\n if (metadataMap.size) return true;\n var targetMetadata = store.get(target);\n targetMetadata['delete'](targetKey);\n return !!targetMetadata.size || store['delete'](target);\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWxldGUtbWV0YWRhdGEuanM/ZGVhZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xudmFyIGdldE9yQ3JlYXRlTWV0YWRhdGFNYXAgPSBtZXRhZGF0YS5tYXA7XG52YXIgc3RvcmUgPSBtZXRhZGF0YS5zdG9yZTtcblxubWV0YWRhdGEuZXhwKHsgZGVsZXRlTWV0YWRhdGE6IGZ1bmN0aW9uIGRlbGV0ZU1ldGFkYXRhKG1ldGFkYXRhS2V5LCB0YXJnZXQgLyogLCB0YXJnZXRLZXkgKi8pIHtcbiAgdmFyIHRhcmdldEtleSA9IGFyZ3VtZW50cy5sZW5ndGggPCAzID8gdW5kZWZpbmVkIDogdG9NZXRhS2V5KGFyZ3VtZW50c1syXSk7XG4gIHZhciBtZXRhZGF0YU1hcCA9IGdldE9yQ3JlYXRlTWV0YWRhdGFNYXAoYW5PYmplY3QodGFyZ2V0KSwgdGFyZ2V0S2V5LCBmYWxzZSk7XG4gIGlmIChtZXRhZGF0YU1hcCA9PT0gdW5kZWZpbmVkIHx8ICFtZXRhZGF0YU1hcFsnZGVsZXRlJ10obWV0YWRhdGFLZXkpKSByZXR1cm4gZmFsc2U7XG4gIGlmIChtZXRhZGF0YU1hcC5zaXplKSByZXR1cm4gdHJ1ZTtcbiAgdmFyIHRhcmdldE1ldGFkYXRhID0gc3RvcmUuZ2V0KHRhcmdldCk7XG4gIHRhcmdldE1ldGFkYXRhWydkZWxldGUnXSh0YXJnZXRLZXkpO1xuICByZXR1cm4gISF0YXJnZXRNZXRhZGF0YS5zaXplIHx8IHN0b3JlWydkZWxldGUnXSh0YXJnZXQpO1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWxldGUtbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQwOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///408\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar getPrototypeOf = __webpack_require__(30);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nvar ordinaryGetMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;\n};\n\nmetadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtbWV0YWRhdGEuanM/MzQ3NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgb3JkaW5hcnlIYXNPd25NZXRhZGF0YSA9IG1ldGFkYXRhLmhhcztcbnZhciBvcmRpbmFyeUdldE93bk1ldGFkYXRhID0gbWV0YWRhdGEuZ2V0O1xudmFyIHRvTWV0YUtleSA9IG1ldGFkYXRhLmtleTtcblxudmFyIG9yZGluYXJ5R2V0TWV0YWRhdGEgPSBmdW5jdGlvbiAoTWV0YWRhdGFLZXksIE8sIFApIHtcbiAgdmFyIGhhc093biA9IG9yZGluYXJ5SGFzT3duTWV0YWRhdGEoTWV0YWRhdGFLZXksIE8sIFApO1xuICBpZiAoaGFzT3duKSByZXR1cm4gb3JkaW5hcnlHZXRPd25NZXRhZGF0YShNZXRhZGF0YUtleSwgTywgUCk7XG4gIHZhciBwYXJlbnQgPSBnZXRQcm90b3R5cGVPZihPKTtcbiAgcmV0dXJuIHBhcmVudCAhPT0gbnVsbCA/IG9yZGluYXJ5R2V0TWV0YWRhdGEoTWV0YWRhdGFLZXksIHBhcmVudCwgUCkgOiB1bmRlZmluZWQ7XG59O1xuXG5tZXRhZGF0YS5leHAoeyBnZXRNZXRhZGF0YTogZnVuY3Rpb24gZ2V0TWV0YWRhdGEobWV0YWRhdGFLZXksIHRhcmdldCAvKiAsIHRhcmdldEtleSAqLykge1xuICByZXR1cm4gb3JkaW5hcnlHZXRNZXRhZGF0YShtZXRhZGF0YUtleSwgYW5PYmplY3QodGFyZ2V0KSwgYXJndW1lbnRzLmxlbmd0aCA8IDMgPyB1bmRlZmluZWQgOiB0b01ldGFLZXkoYXJndW1lbnRzWzJdKSk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5yZWZsZWN0LmdldC1tZXRhZGF0YS5qc1xuLy8gbW9kdWxlIGlkID0gNDA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///409\n")},function(module,exports,__webpack_require__){eval("var Set = __webpack_require__(178);\nvar from = __webpack_require__(187);\nvar metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar getPrototypeOf = __webpack_require__(30);\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nvar ordinaryMetadataKeys = function (O, P) {\n var oKeys = ordinaryOwnMetadataKeys(O, P);\n var parent = getPrototypeOf(O);\n if (parent === null) return oKeys;\n var pKeys = ordinaryMetadataKeys(parent, P);\n return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;\n};\n\nmetadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {\n return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtbWV0YWRhdGEta2V5cy5qcz9iZjc4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBTZXQgPSByZXF1aXJlKCcuL2VzNi5zZXQnKTtcbnZhciBmcm9tID0gcmVxdWlyZSgnLi9fYXJyYXktZnJvbS1pdGVyYWJsZScpO1xudmFyIG1ldGFkYXRhID0gcmVxdWlyZSgnLi9fbWV0YWRhdGEnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdwbycpO1xudmFyIG9yZGluYXJ5T3duTWV0YWRhdGFLZXlzID0gbWV0YWRhdGEua2V5cztcbnZhciB0b01ldGFLZXkgPSBtZXRhZGF0YS5rZXk7XG5cbnZhciBvcmRpbmFyeU1ldGFkYXRhS2V5cyA9IGZ1bmN0aW9uIChPLCBQKSB7XG4gIHZhciBvS2V5cyA9IG9yZGluYXJ5T3duTWV0YWRhdGFLZXlzKE8sIFApO1xuICB2YXIgcGFyZW50ID0gZ2V0UHJvdG90eXBlT2YoTyk7XG4gIGlmIChwYXJlbnQgPT09IG51bGwpIHJldHVybiBvS2V5cztcbiAgdmFyIHBLZXlzID0gb3JkaW5hcnlNZXRhZGF0YUtleXMocGFyZW50LCBQKTtcbiAgcmV0dXJuIHBLZXlzLmxlbmd0aCA/IG9LZXlzLmxlbmd0aCA/IGZyb20obmV3IFNldChvS2V5cy5jb25jYXQocEtleXMpKSkgOiBwS2V5cyA6IG9LZXlzO1xufTtcblxubWV0YWRhdGEuZXhwKHsgZ2V0TWV0YWRhdGFLZXlzOiBmdW5jdGlvbiBnZXRNZXRhZGF0YUtleXModGFyZ2V0IC8qICwgdGFyZ2V0S2V5ICovKSB7XG4gIHJldHVybiBvcmRpbmFyeU1ldGFkYXRhS2V5cyhhbk9iamVjdCh0YXJnZXQpLCBhcmd1bWVudHMubGVuZ3RoIDwgMiA/IHVuZGVmaW5lZCA6IHRvTWV0YUtleShhcmd1bWVudHNbMV0pKTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnJlZmxlY3QuZ2V0LW1ldGFkYXRhLWtleXMuanNcbi8vIG1vZHVsZSBpZCA9IDQxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///410\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtb3duLW1ldGFkYXRhLmpzP2NkOTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1ldGFkYXRhID0gcmVxdWlyZSgnLi9fbWV0YWRhdGEnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIG9yZGluYXJ5R2V0T3duTWV0YWRhdGEgPSBtZXRhZGF0YS5nZXQ7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xuXG5tZXRhZGF0YS5leHAoeyBnZXRPd25NZXRhZGF0YTogZnVuY3Rpb24gZ2V0T3duTWV0YWRhdGEobWV0YWRhdGFLZXksIHRhcmdldCAvKiAsIHRhcmdldEtleSAqLykge1xuICByZXR1cm4gb3JkaW5hcnlHZXRPd25NZXRhZGF0YShtZXRhZGF0YUtleSwgYW5PYmplY3QodGFyZ2V0KVxuICAgICwgYXJndW1lbnRzLmxlbmd0aCA8IDMgPyB1bmRlZmluZWQgOiB0b01ldGFLZXkoYXJndW1lbnRzWzJdKSk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5yZWZsZWN0LmdldC1vd24tbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQxMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///411\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {\n return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtb3duLW1ldGFkYXRhLWtleXMuanM/YmVjOCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgb3JkaW5hcnlPd25NZXRhZGF0YUtleXMgPSBtZXRhZGF0YS5rZXlzO1xudmFyIHRvTWV0YUtleSA9IG1ldGFkYXRhLmtleTtcblxubWV0YWRhdGEuZXhwKHsgZ2V0T3duTWV0YWRhdGFLZXlzOiBmdW5jdGlvbiBnZXRPd25NZXRhZGF0YUtleXModGFyZ2V0IC8qICwgdGFyZ2V0S2V5ICovKSB7XG4gIHJldHVybiBvcmRpbmFyeU93bk1ldGFkYXRhS2V5cyhhbk9iamVjdCh0YXJnZXQpLCBhcmd1bWVudHMubGVuZ3RoIDwgMiA/IHVuZGVmaW5lZCA6IHRvTWV0YUtleShhcmd1bWVudHNbMV0pKTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnJlZmxlY3QuZ2V0LW93bi1tZXRhZGF0YS1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA0MTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///412\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar getPrototypeOf = __webpack_require__(30);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nvar ordinaryHasMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;\n};\n\nmetadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5oYXMtbWV0YWRhdGEuanM/ZjE2NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgb3JkaW5hcnlIYXNPd25NZXRhZGF0YSA9IG1ldGFkYXRhLmhhcztcbnZhciB0b01ldGFLZXkgPSBtZXRhZGF0YS5rZXk7XG5cbnZhciBvcmRpbmFyeUhhc01ldGFkYXRhID0gZnVuY3Rpb24gKE1ldGFkYXRhS2V5LCBPLCBQKSB7XG4gIHZhciBoYXNPd24gPSBvcmRpbmFyeUhhc093bk1ldGFkYXRhKE1ldGFkYXRhS2V5LCBPLCBQKTtcbiAgaWYgKGhhc093bikgcmV0dXJuIHRydWU7XG4gIHZhciBwYXJlbnQgPSBnZXRQcm90b3R5cGVPZihPKTtcbiAgcmV0dXJuIHBhcmVudCAhPT0gbnVsbCA/IG9yZGluYXJ5SGFzTWV0YWRhdGEoTWV0YWRhdGFLZXksIHBhcmVudCwgUCkgOiBmYWxzZTtcbn07XG5cbm1ldGFkYXRhLmV4cCh7IGhhc01ldGFkYXRhOiBmdW5jdGlvbiBoYXNNZXRhZGF0YShtZXRhZGF0YUtleSwgdGFyZ2V0IC8qICwgdGFyZ2V0S2V5ICovKSB7XG4gIHJldHVybiBvcmRpbmFyeUhhc01ldGFkYXRhKG1ldGFkYXRhS2V5LCBhbk9iamVjdCh0YXJnZXQpLCBhcmd1bWVudHMubGVuZ3RoIDwgMyA/IHVuZGVmaW5lZCA6IHRvTWV0YUtleShhcmd1bWVudHNbMl0pKTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnJlZmxlY3QuaGFzLW1ldGFkYXRhLmpzXG4vLyBtb2R1bGUgaWQgPSA0MTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///413\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5oYXMtb3duLW1ldGFkYXRhLmpzP2M4ZWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1ldGFkYXRhID0gcmVxdWlyZSgnLi9fbWV0YWRhdGEnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIG9yZGluYXJ5SGFzT3duTWV0YWRhdGEgPSBtZXRhZGF0YS5oYXM7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xuXG5tZXRhZGF0YS5leHAoeyBoYXNPd25NZXRhZGF0YTogZnVuY3Rpb24gaGFzT3duTWV0YWRhdGEobWV0YWRhdGFLZXksIHRhcmdldCAvKiAsIHRhcmdldEtleSAqLykge1xuICByZXR1cm4gb3JkaW5hcnlIYXNPd25NZXRhZGF0YShtZXRhZGF0YUtleSwgYW5PYmplY3QodGFyZ2V0KVxuICAgICwgYXJndW1lbnRzLmxlbmd0aCA8IDMgPyB1bmRlZmluZWQgOiB0b01ldGFLZXkoYXJndW1lbnRzWzJdKSk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5yZWZsZWN0Lmhhcy1vd24tbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQxNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///414\n")},function(module,exports,__webpack_require__){eval("var $metadata = __webpack_require__(43);\nvar anObject = __webpack_require__(5);\nvar aFunction = __webpack_require__(20);\nvar toMetaKey = $metadata.key;\nvar ordinaryDefineOwnMetadata = $metadata.set;\n\n$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {\n return function decorator(target, targetKey) {\n ordinaryDefineOwnMetadata(\n metadataKey, metadataValue,\n (targetKey !== undefined ? anObject : aFunction)(target),\n toMetaKey(targetKey)\n );\n };\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5tZXRhZGF0YS5qcz8xMTlmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgYUZ1bmN0aW9uID0gcmVxdWlyZSgnLi9fYS1mdW5jdGlvbicpO1xudmFyIHRvTWV0YUtleSA9ICRtZXRhZGF0YS5rZXk7XG52YXIgb3JkaW5hcnlEZWZpbmVPd25NZXRhZGF0YSA9ICRtZXRhZGF0YS5zZXQ7XG5cbiRtZXRhZGF0YS5leHAoeyBtZXRhZGF0YTogZnVuY3Rpb24gbWV0YWRhdGEobWV0YWRhdGFLZXksIG1ldGFkYXRhVmFsdWUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGRlY29yYXRvcih0YXJnZXQsIHRhcmdldEtleSkge1xuICAgIG9yZGluYXJ5RGVmaW5lT3duTWV0YWRhdGEoXG4gICAgICBtZXRhZGF0YUtleSwgbWV0YWRhdGFWYWx1ZSxcbiAgICAgICh0YXJnZXRLZXkgIT09IHVuZGVmaW5lZCA/IGFuT2JqZWN0IDogYUZ1bmN0aW9uKSh0YXJnZXQpLFxuICAgICAgdG9NZXRhS2V5KHRhcmdldEtleSlcbiAgICApO1xuICB9O1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5tZXRhZGF0YS5qc1xuLy8gbW9kdWxlIGlkID0gNDE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///415\n")},function(module,exports,__webpack_require__){eval("// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask\nvar $export = __webpack_require__(0);\nvar microtask = __webpack_require__(129)();\nvar process = __webpack_require__(7).process;\nvar isNode = __webpack_require__(33)(process) == 'process';\n\n$export($export.G, {\n asap: function asap(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXNhcC5qcz82OGNkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9yd2FsZHJvbi90YzM5LW5vdGVzL2Jsb2IvbWFzdGVyL2VzNi8yMDE0LTA5L3NlcHQtMjUubWQjNTEwLWdsb2JhbGFzYXAtZm9yLWVucXVldWluZy1hLW1pY3JvdGFza1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBtaWNyb3Rhc2sgPSByZXF1aXJlKCcuL19taWNyb3Rhc2snKSgpO1xudmFyIHByb2Nlc3MgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5wcm9jZXNzO1xudmFyIGlzTm9kZSA9IHJlcXVpcmUoJy4vX2NvZicpKHByb2Nlc3MpID09ICdwcm9jZXNzJztcblxuJGV4cG9ydCgkZXhwb3J0LkcsIHtcbiAgYXNhcDogZnVuY3Rpb24gYXNhcChmbikge1xuICAgIHZhciBkb21haW4gPSBpc05vZGUgJiYgcHJvY2Vzcy5kb21haW47XG4gICAgbWljcm90YXNrKGRvbWFpbiA/IGRvbWFpbi5iaW5kKGZuKSA6IGZuKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LmFzYXAuanNcbi8vIG1vZHVsZSBpZCA9IDQxNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///416\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/zenparsing/es-observable\nvar $export = __webpack_require__(0);\nvar global = __webpack_require__(7);\nvar core = __webpack_require__(31);\nvar microtask = __webpack_require__(129)();\nvar OBSERVABLE = __webpack_require__(10)('observable');\nvar aFunction = __webpack_require__(20);\nvar anObject = __webpack_require__(5);\nvar anInstance = __webpack_require__(59);\nvar redefineAll = __webpack_require__(61);\nvar hide = __webpack_require__(23);\nvar forOf = __webpack_require__(60);\nvar RETURN = forOf.RETURN;\n\nvar getMethod = function (fn) {\n return fn == null ? undefined : aFunction(fn);\n};\n\nvar cleanupSubscription = function (subscription) {\n var cleanup = subscription._c;\n if (cleanup) {\n subscription._c = undefined;\n cleanup();\n }\n};\n\nvar subscriptionClosed = function (subscription) {\n return subscription._o === undefined;\n};\n\nvar closeSubscription = function (subscription) {\n if (!subscriptionClosed(subscription)) {\n subscription._o = undefined;\n cleanupSubscription(subscription);\n }\n};\n\nvar Subscription = function (observer, subscriber) {\n anObject(observer);\n this._c = undefined;\n this._o = observer;\n observer = new SubscriptionObserver(this);\n try {\n var cleanup = subscriber(observer);\n var subscription = cleanup;\n if (cleanup != null) {\n if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };\n else aFunction(cleanup);\n this._c = cleanup;\n }\n } catch (e) {\n observer.error(e);\n return;\n } if (subscriptionClosed(this)) cleanupSubscription(this);\n};\n\nSubscription.prototype = redefineAll({}, {\n unsubscribe: function unsubscribe() { closeSubscription(this); }\n});\n\nvar SubscriptionObserver = function (subscription) {\n this._s = subscription;\n};\n\nSubscriptionObserver.prototype = redefineAll({}, {\n next: function next(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n try {\n var m = getMethod(observer.next);\n if (m) return m.call(observer, value);\n } catch (e) {\n try {\n closeSubscription(subscription);\n } finally {\n throw e;\n }\n }\n }\n },\n error: function error(value) {\n var subscription = this._s;\n if (subscriptionClosed(subscription)) throw value;\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.error);\n if (!m) throw value;\n value = m.call(observer, value);\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n },\n complete: function complete(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.complete);\n value = m ? m.call(observer, value) : undefined;\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n }\n }\n});\n\nvar $Observable = function Observable(subscriber) {\n anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);\n};\n\nredefineAll($Observable.prototype, {\n subscribe: function subscribe(observer) {\n return new Subscription(observer, this._f);\n },\n forEach: function forEach(fn) {\n var that = this;\n return new (core.Promise || global.Promise)(function (resolve, reject) {\n aFunction(fn);\n var subscription = that.subscribe({\n next: function (value) {\n try {\n return fn(value);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n});\n\nredefineAll($Observable, {\n from: function from(x) {\n var C = typeof this === 'function' ? this : $Observable;\n var method = getMethod(anObject(x)[OBSERVABLE]);\n if (method) {\n var observable = anObject(method.call(x));\n return observable.constructor === C ? observable : new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n return new C(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n try {\n if (forOf(x, false, function (it) {\n observer.next(it);\n if (done) return RETURN;\n }) === RETURN) return;\n } catch (e) {\n if (done) throw e;\n observer.error(e);\n return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n },\n of: function of() {\n for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];\n return new (typeof this === 'function' ? this : $Observable)(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n for (var j = 0; j < items.length; ++j) {\n observer.next(items[j]);\n if (done) return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n }\n});\n\nhide($Observable.prototype, OBSERVABLE, function () { return this; });\n\n$export($export.G, { Observable: $Observable });\n\n__webpack_require__(58)('Observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJz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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///417\n")},function(module,exports,__webpack_require__){eval("// ie9- setTimeout & setInterval additional parameters fix\nvar global = __webpack_require__(7);\nvar $export = __webpack_require__(0);\nvar userAgent = __webpack_require__(92);\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIudGltZXJzLmpzP2JmYzUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaWU5LSBzZXRUaW1lb3V0ICYgc2V0SW50ZXJ2YWwgYWRkaXRpb25hbCBwYXJhbWV0ZXJzIGZpeFxudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciB1c2VyQWdlbnQgPSByZXF1aXJlKCcuL191c2VyLWFnZW50Jyk7XG52YXIgc2xpY2UgPSBbXS5zbGljZTtcbnZhciBNU0lFID0gL01TSUUgLlxcLi8udGVzdCh1c2VyQWdlbnQpOyAvLyA8LSBkaXJ0eSBpZTktIGNoZWNrXG52YXIgd3JhcCA9IGZ1bmN0aW9uIChzZXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIChmbiwgdGltZSAvKiAsIC4uLmFyZ3MgKi8pIHtcbiAgICB2YXIgYm91bmRBcmdzID0gYXJndW1lbnRzLmxlbmd0aCA+IDI7XG4gICAgdmFyIGFyZ3MgPSBib3VuZEFyZ3MgPyBzbGljZS5jYWxsKGFyZ3VtZW50cywgMikgOiBmYWxzZTtcbiAgICByZXR1cm4gc2V0KGJvdW5kQXJncyA/IGZ1bmN0aW9uICgpIHtcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1uZXctZnVuY1xuICAgICAgKHR5cGVvZiBmbiA9PSAnZnVuY3Rpb24nID8gZm4gOiBGdW5jdGlvbihmbikpLmFwcGx5KHRoaXMsIGFyZ3MpO1xuICAgIH0gOiBmbiwgdGltZSk7XG4gIH07XG59O1xuJGV4cG9ydCgkZXhwb3J0LkcgKyAkZXhwb3J0LkIgKyAkZXhwb3J0LkYgKiBNU0lFLCB7XG4gIHNldFRpbWVvdXQ6IHdyYXAoZ2xvYmFsLnNldFRpbWVvdXQpLFxuICBzZXRJbnRlcnZhbDogd3JhcChnbG9iYWwuc2V0SW50ZXJ2YWwpXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIudGltZXJzLmpzXG4vLyBtb2R1bGUgaWQgPSA0MThcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///418\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $task = __webpack_require__(128);\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIuaW1tZWRpYXRlLmpzPzc2MjciXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkdGFzayA9IHJlcXVpcmUoJy4vX3Rhc2snKTtcbiRleHBvcnQoJGV4cG9ydC5HICsgJGV4cG9ydC5CLCB7XG4gIHNldEltbWVkaWF0ZTogJHRhc2suc2V0LFxuICBjbGVhckltbWVkaWF0ZTogJHRhc2suY2xlYXJcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL3dlYi5pbW1lZGlhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDQxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///419\n")},function(module,exports,__webpack_require__){eval("var $iterators = __webpack_require__(127);\nvar getKeys = __webpack_require__(54);\nvar redefine = __webpack_require__(24);\nvar global = __webpack_require__(7);\nvar hide = __webpack_require__(23);\nvar Iterators = __webpack_require__(66);\nvar wks = __webpack_require__(10);\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlLmpzPzdmMWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRpdGVyYXRvcnMgPSByZXF1aXJlKCcuL2VzNi5hcnJheS5pdGVyYXRvcicpO1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xudmFyIHJlZGVmaW5lID0gcmVxdWlyZSgnLi9fcmVkZWZpbmUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xudmFyIHdrcyA9IHJlcXVpcmUoJy4vX3drcycpO1xudmFyIElURVJBVE9SID0gd2tzKCdpdGVyYXRvcicpO1xudmFyIFRPX1NUUklOR19UQUcgPSB3a3MoJ3RvU3RyaW5nVGFnJyk7XG52YXIgQXJyYXlWYWx1ZXMgPSBJdGVyYXRvcnMuQXJyYXk7XG5cbnZhciBET01JdGVyYWJsZXMgPSB7XG4gIENTU1J1bGVMaXN0OiB0cnVlLCAvLyBUT0RPOiBOb3Qgc3BlYyBjb21wbGlhbnQsIHNob3V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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///420\n")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n "use strict";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === "function" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || "@@iterator";\n var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";\n var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";\n\n var inModule = typeof module === "object";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we\'re in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don\'t bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we\'re in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there\'s no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don\'t have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: "normal", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: "throw", arg: err };\n }\n }\n\n var GenStateSuspendedStart = "suspendedStart";\n var GenStateSuspendedYield = "suspendedYield";\n var GenStateExecuting = "executing";\n var GenStateCompleted = "completed";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don\'t natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = "GeneratorFunction";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n ["next", "throw", "return"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === "function" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === "GeneratorFunction"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = "GeneratorFunction";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, "__await")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === "throw") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === "object" &&\n hasOwn.call(value, "__await")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke("next", value, resolve, reject);\n }, function(err) {\n invoke("throw", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === "object" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error("Generator is already running");\n }\n\n if (state === GenStateCompleted) {\n if (method === "throw") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === "next") {\n // Setting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === "throw") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === "return") {\n context.abrupt("return", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === "normal") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === "throw") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = "throw";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === "throw") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = "return";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === "throw") {\n // If maybeInvokeDelegate(context) changed context.method from\n // "return" to "throw", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = "throw";\n context.arg = new TypeError(\n "The iterator does not provide a \'throw\' method");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === "throw") {\n context.method = "throw";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = "throw";\n context.arg = new TypeError("iterator result is not an object");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was "throw" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was "next", forget context.arg since it has been\n // "consumed" by the delegate iterator. If context.method was\n // "return", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== "return") {\n context.method = "next";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = "Generator";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers\' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn\'t happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return "[object Generator]";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = "normal";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: "root" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === "function") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = "next";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === "t" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === "throw") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = "throw";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = "next";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === "root") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle("end");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, "catchLoc");\n var hasFinally = hasOwn.call(entry, "finallyLoc");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error("try statement without catch or finally");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, "finallyLoc") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === "break" ||\n type === "continue") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = "next";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === "throw") {\n throw record.arg;\n }\n\n if (record.type === "break" ||\n record.type === "continue") {\n this.next = record.arg;\n } else if (record.type === "return") {\n this.rval = this.arg = record.arg;\n this.method = "return";\n this.next = "end";\n } else if (record.type === "normal" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n "catch": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === "throw") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error("illegal catch attempt");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === "next") {\n // Deliberately forget the last sent value so that we don\'t\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === "object" ? global :\n typeof window === "object" ? window :\n typeof self === "object" ? self : this\n);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(154)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXBvbHlmaWxsL25vZGVfbW9kdWxlcy9yZWdlbmVyYXRvci1ydW50aW1lL3J1bnRpbWUuanM/Y2U0NSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxNCwgRmFjZWJvb2ssIEluYy5cbiAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgQlNELXN0eWxlIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBodHRwczovL3Jhdy5naXRodWIuY29tL2ZhY2Vib29rL3JlZ2VuZXJhdG9yL21hc3Rlci9MSUNFTlNFIGZpbGUuIEFuXG4gKiBhZGRpdGlvbmFsIGdyYW50IG9mIHBhdGVudCByaWdodHMgY2FuIGJlIGZvdW5kIGluIHRoZSBQQVRFTlRTIGZpbGUgaW5cbiAqIHRoZSBzYW1lIGRpcmVjdG9yeS5cbiAqL1xuXG4hKGZ1bmN0aW9uKGdsb2JhbCkge1xuICBcInVzZSBzdHJpY3RcIjtcblxuICB2YXIgT3AgPSBPYmplY3QucHJvdG90eXBlO1xuICB2YXIgaGFzT3duID0gT3AuaGFzT3duUHJvcGVydHk7XG4gIHZhciB1bmRlZmluZWQ7IC8vIE1vcmUgY29tcHJlc3NpYmxlIHRoYW4gdm9pZCAwLlxuICB2YXIgJFN5bWJvbCA9IHR5cGVvZi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ZXh0LmFyZyk7XG5cbiAgICAgICAgfSBlbHNlIGlmIChjb250ZXh0Lm1ldGhvZCA9PT0gXCJyZXR1cm5cIikge1xuICAgICAgICAgIGNvbnRleHQuYWJydXB0KFwicmV0dXJuXCIsIGNvbnRleHQuYXJnKTtcbiAgICAgICAgfVxuXG4gICAgICAgIHN0YXRlID0gR2VuU3RhdGVFeGVjdXRpbmc7XG5cbiAgICAgICAgdmFyIHJlY29yZCA9IHRyeUNhdGNoKGlubmVyRm4sIHNlbGYsIGNvbnRleHQpO1xuICAgICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwibm9ybWFsXCIpIHtcbiAgICAgICAgICAvLyBJZiBhbiBleGNlcHRpb24gaXMgdGhyb3duIGZyb20gaW5uZXJGbiwgd2UgbGVhdmUgc3RhdGUgPT09XG4gICAgICAgICAgLy8gR2VuU3RhdGVFeGVjdXRpbmcgYW5kIGxvb3AgYmFjayBmb3IgYW5vdGhlciBpbnZvY2F0aW9uLlxuICAgICAgICAgIHN0YXRlID0gY29udGV4dC5kb25lXG4gICAgICAgICAgICA/IEdlblN0YXRlQ29tcGxldGVkXG4gICAgICAgICAgICA6IEdlblN0YXRlU3VzcGVuZGVkWWllbGQ7XG5cbiAgICAgICAgICBpZiAocmVjb3JkLmFyZyA9PT0gQ29udGludWVTZW50aW5lbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiByZWNvcmQuYXJnLFxuICAgICAgICAgICAgZG9uZTogY29udGV4dC5kb25lXG4gICAgICAgICAgfTtcblxuICAgICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICBzdGF0ZSA9IEdlblN0YXRlQ29tcGxldGVkO1xuICAgICAgICAgIC8vIERpc3BhdGNoIHRoZSBleGNlcHRpb24gYnkgbG9vcGluZyBiYWNrIGFyb3VuZCB0byB0aGV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pdCwgc28gc2V0IHRoZSBjb21wbGV0aW9uIHZhbHVlIG9mIHRoZSBlbnRpcmUgZnVuY3Rpb24gdG9cbiAgICAgICAgICAvLyB0aHJvdyB0aGUgZXhjZXB0aW9uLlxuICAgICAgICAgIHJldHVybiBoYW5kbGUoXCJlbmRcIik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZW50cnkudHJ5TG9jIDw9IHRoaXMucHJldikge1xuICAgICAgICAgIHZhciBoYXNDYXRjaCA9IGhhc093bi5jYWxsKGVudHJ5LCBcImNhdGNoTG9jXCIpO1xuICAgICAgICAgIHZhciBoYXNGaW5hbGx5ID0gaGFzT3duLmNhbGwoZW50cnksIFwiZmluYWxseUxvY1wiKTtcblxuICAgICAgICAgIGlmIChoYXNDYXRjaCAmJiBoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5maW5hbGx5TG9jKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0gZWxzZSBpZiAoaGFzQ2F0Y2gpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0gZWxzZSBpZiAoaGFzRmluYWxseSkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5maW5hbGx5TG9jKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJ0cnkgc3RhdGVtZW50IHdpdGhvdXQgY2F0Y2ggb3IgZmluYWxseVwiKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgYWJydXB0OiBmdW5jdGlvbih0eXBlLCBhcmcpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG9jIDw9IHRoaXMucHJldiAmJlxuICAgICAgICAgICAgaGFzT3duLmNhbGwoZW50cnksIFwiZmluYWxseUxvY1wiKSAmJlxuICAgICAgICAgICAgdGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgIHZhciBmaW5hbGx5RW50cnkgPSBlbnRyeTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoZmluYWxseUVudHJ5ICYmXG4gICAgICAgICAgKHR5cGUgPT09IFwiYnJlYWtcIiB8fFxuICAgICAgICAgICB0eXBlID09PSBcImNvbnRpbnVlXCIpICYmXG4gICAgICAgICAgZmluYWxseUVudHJ5LnRyeUxvYyA8PSBhcmcgJiZcbiAgICAgICAgICBhcmcgPD0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgLy8gSWdub3JlIHRoZSBmaW5hbGx5IGVudHJ5IGlmIGNvbnRyb2wgaXMgbm90IGp1bXBpbmcgdG8gYVxuICAgICAgICAvLyBsb2NhdGlvbiBvdXRzaWRlIHRoZSB0cnkvY2F0Y2ggYmxvY2suXG4gICAgICAgIGZpbmFsbHlFbnRyeSA9IG51bGw7XG4gICAgICB9XG5cbiAgICAgIHZhciByZWNvcmQgPSBmaW5hbGx5RW50cnkgPyBmaW5hbGx5RW50cnkuY29tcGxldGlvbiA6IHt9O1xuICAgICAgcmVjb3JkLnR5cGUgPSB0eXBlO1xuICAgICAgcmVjb3JkLmFyZyA9IGFyZztcblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSkge1xuICAgICAgICB0aGlzLm1ldGhvZCA9IFwibmV4dFwiO1xuICAgICAgICB0aGlzLm5leHQgPSBmaW5hbGx5RW50cnkuZmluYWxseUxvYztcbiAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLmNvbXBsZXRlKHJlY29yZCk7XG4gICAgfSxcblxuICAgIGNvbXBsZXRlOiBmdW5jdGlvbihyZWNvcmQsIGFmdGVyTG9jKSB7XG4gICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICB0aHJvdyByZWNvcmQuYXJnO1xuICAgICAgfVxuXG4gICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwiYnJlYWtcIiB8fFxuICAgICAgICAgIHJlY29yZC50eXBlID09PSBcImNvbnRpbnVlXCIpIHtcbiAgICAgICAgdGhpcy5uZXh0ID0gcmVjb3JkLmFyZztcbiAgICAgIH0gZWxzZSBpZiAocmVjb3JkLnR5cGUgPT09IFwicmV0dXJuXCIpIHtcbiAgICAgICAgdGhpcy5ydmFsID0gdGhpcy5hcmcgPSByZWNvcmQuYXJnO1xuICAgICAgICB0aGlzLm1ldGhvZCA9IFwicmV0dXJuXCI7XG4gICAgICAgIHRoaXMubmV4dCA9IFwiZW5kXCI7XG4gICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcIm5vcm1hbFwiICYmIGFmdGVyTG9jKSB7XG4gICAgICAgIHRoaXMubmV4dCA9IGFmdGVyTG9jO1xuICAgICAgfVxuXG4gICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICB9LFxuXG4gICAgZmluaXNoOiBmdW5jdGlvbihmaW5hbGx5TG9jKSB7XG4gICAgICBmb3IgKHZhciBpID0gdGhpcy50cnlFbnRyaWVzLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgIHZhciBlbnRyeSA9IHRoaXMudHJ5RW50cmllc1tpXTtcbiAgICAgICAgaWYgKGVudHJ5LmZpbmFsbHlMb2MgPT09IGZpbmFsbHlMb2MpIHtcbiAgICAgICAgICB0aGlzLmNvbXBsZXRlKGVudHJ5LmNvbXBsZXRpb24sIGVudHJ5LmFmdGVyTG9jKTtcbiAgICAgICAgICByZXNldFRyeUVudHJ5KGVudHJ5KTtcbiAgICAgICAgICByZXR1cm4gQ29udGludWVTZW50aW5lbDtcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH0sXG5cbiAgICBcImNhdGNoXCI6IGZ1bmN0aW9uKHRyeUxvYykge1xuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPT09IHRyeUxvYykge1xuICAgICAgICAgIHZhciByZWNvcmQgPSBlbnRyeS5jb21wbGV0aW9uO1xuICAgICAgICAgIGlmIChyZWNvcmQudHlwZSA9PT0gXCJ0aHJvd1wiKSB7XG4gICAgICAgICAgICB2YXIgdGhyb3duID0gcmVjb3JkLmFyZztcbiAgICAgICAgICAgIHJlc2V0VHJ5RW50cnkoZW50cnkpO1xuICAgICAgICAgIH1cbiAgICAgICAgICByZXR1cm4gdGhyb3duO1xuICAgICAgICB9XG4gICAgICB9XG5cbiAgICAgIC8vIFRoZSBjb250ZXh0LmNhdGNoIG1ldGhvZCBtdXN0IG9ubHkgYmUgY2FsbGVkIHdpdGggYSBsb2NhdGlvblxuICAgICAgLy8g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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///421\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(423);\nmodule.exports = __webpack_require__(31).RegExp.escape;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvZm4vcmVnZXhwL2VzY2FwZS5qcz81YjA5Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvY29yZS5yZWdleHAuZXNjYXBlJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5SZWdFeHAuZXNjYXBlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9mbi9yZWdleHAvZXNjYXBlLmpzXG4vLyBtb2R1bGUgaWQgPSA0MjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///422\n")},function(module,exports,__webpack_require__){eval("// https://github.com/benjamingr/RexExp.escape\nvar $export = __webpack_require__(0);\nvar $re = __webpack_require__(424)(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLnJlZ2V4cC5lc2NhcGUuanM/YWY2MSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vYmVuamFtaW5nci9SZXhFeHAuZXNjYXBlXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRyZSA9IHJlcXVpcmUoJy4vX3JlcGxhY2VyJykoL1tcXFxcXiQqKz8uKCl8W1xcXXt9XS9nLCAnXFxcXCQmJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVnRXhwJywgeyBlc2NhcGU6IGZ1bmN0aW9uIGVzY2FwZShpdCkgeyByZXR1cm4gJHJlKGl0KTsgfSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLnJlZ2V4cC5lc2NhcGUuanNcbi8vIG1vZHVsZSBpZCA9IDQyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///423\n")},function(module,exports){eval("module.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcmVwbGFjZXIuanM/OWVhMyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChyZWdFeHAsIHJlcGxhY2UpIHtcbiAgdmFyIHJlcGxhY2VyID0gcmVwbGFjZSA9PT0gT2JqZWN0KHJlcGxhY2UpID8gZnVuY3Rpb24gKHBhcnQpIHtcbiAgICByZXR1cm4gcmVwbGFjZVtwYXJ0XTtcbiAgfSA6IHJlcGxhY2U7XG4gIHJldHVybiBmdW5jdGlvbiAoaXQpIHtcbiAgICByZXR1cm4gU3RyaW5nKGl0KS5yZXBsYWNlKHJlZ0V4cCwgcmVwbGFjZXIpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcmVwbGFjZXIuanNcbi8vIG1vZHVsZSBpZCA9IDQyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///424\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _logLevels = __webpack_require__(452);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _Registry = __webpack_require__(453);\n\nvar _Registry2 = _interopRequireDefault(_Registry);\n\nvar _IdentityModule = __webpack_require__(509);\n\nvar _IdentityModule2 = _interopRequireDefault(_IdentityModule);\n\nvar _IdentityHandler = __webpack_require__(515);\n\nvar _IdentityHandler2 = _interopRequireDefault(_IdentityHandler);\n\nvar _PEP = __webpack_require__(516);\n\nvar _PEP2 = _interopRequireDefault(_PEP);\n\nvar _MessageBus = __webpack_require__(523);\n\nvar _MessageBus2 = _interopRequireDefault(_MessageBus);\n\nvar _utils = __webpack_require__(6);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar _CryptoManager2 = _interopRequireDefault(_CryptoManager);\n\nvar _Loader = __webpack_require__(527);\n\nvar _Loader2 = _interopRequireDefault(_Loader);\n\nvar _Storage = __webpack_require__(218);\n\nvar _Descriptors = __webpack_require__(528);\n\nvar _Descriptors2 = _interopRequireDefault(_Descriptors);\n\nvar _runtimeConfiguration = __webpack_require__(151);\n\nvar _MsgBusHandlers = __webpack_require__(529);\n\nvar _MsgBusHandlers2 = _interopRequireDefault(_MsgBusHandlers);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _CoreDiscovery = __webpack_require__(530);\n\nvar _CoreDiscovery2 = _interopRequireDefault(_CoreDiscovery);\n\nvar _DataObjectsStorage = __webpack_require__(531);\n\nvar _DataObjectsStorage2 = _interopRequireDefault(_DataObjectsStorage);\n\nvar _HypertyResourcesStorage = __webpack_require__(535);\n\nvar _HypertyResourcesStorage2 = _interopRequireDefault(_HypertyResourcesStorage);\n\nvar _SyncherManager = __webpack_require__(538);\n\nvar _SyncherManager2 = _interopRequireDefault(_SyncherManager);\n\nvar _SubscriptionManager = __webpack_require__(544);\n\nvar _SubscriptionManager2 = _interopRequireDefault(_SubscriptionManager);\n\nvar _RuntimeCoreCtx = __webpack_require__(546);\n\nvar _RuntimeCoreCtx2 = _interopRequireDefault(_RuntimeCoreCtx);\n\nvar _RuntimeCatalogue = __webpack_require__(548);\n\nvar _RuntimeCatalogue2 = _interopRequireDefault(_RuntimeCatalogue);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// import 'babel-polyfill';\n\nvar log = logger.getLogger('RuntimeUA');\n\n//Main dependecies\n\n\n// Log System\n\n\n//import GraphConnector from '../graphconnector/GraphConnector';\n\n/**\n * Runtime User Agent Interface will process all the dependecies of the core runtime;\n * @author Vitor Silva [vitor-t-silva@telecom.pt]\n * @version 0.4.0\n *\n * @property {runtimeFactory} runtimeFactory - Specific implementation for all environments;\n * @property {RuntimeCatalogue} runtimeCatalogue - Catalogue of components can be installed;\n * @property {runtimeURL} runtimeURL - This identify the core runtime, should be unique;\n * @property {IdentityModule} identityModule - Identity Module;\n * @property {PEP} policyEngine - Policy Engine Module;\n * @property {Registry} registry - Registry Module;\n * @property {MessageBus} messageBus - Message Bus is used like a router to redirect the messages from one component to other(s)\n * @property {GraphConnector} graphConnector - Graph Connector handling GUID and contacts\n * @property {CoreDiscovery} coreDiscovery - Discovery for discovery hyperties/dataObjects\n */\nvar RuntimeUA = function () {\n\n /**\n * Create a new instance of Runtime User Agent\n * @param {descriptor} runtimeDescriptor - pass all the hyperty runtime descriptor\n * @param {runtimeFactory} runtimeFactory - Specific implementation for the environment where the core runtime will run;\n * @param {domain} domainURL - specify the domain base for the runtime;\n */\n function RuntimeUA(runtimeDescriptor, runtimeFactory, domain) {\n (0, _classCallCheck3.default)(this, RuntimeUA);\n\n if (!runtimeDescriptor) throw new Error('The runtime descriptor is a needed parameter');\n if (!runtimeFactory) throw new Error('The sandbox factory is a needed parameter');\n if (!domain) throw new Error('You need the domain of runtime');\n\n // Configuration object with information related with servers\n this.runtimeConfiguration = (0, _assign2.default)({ domain: domain }, _runtimeConfiguration.runtimeConfiguration);\n this.runtimeFactory = runtimeFactory;\n\n this.log = log;\n this.logLevels = _logLevels.log;\n\n if (runtimeDescriptor.p2pHandlerStub && typeof runtimeDescriptor.p2pHandlerStub === 'string' && runtimeDescriptor.p2pHandlerStub.includes('://')) {\n this.p2p = true;\n } else {\n this.p2p = false;\n }\n\n _runtimeUtils.runtimeUtils.runtimeDescriptor = runtimeDescriptor;\n this.runtimeUtils = _runtimeUtils.runtimeUtils;\n\n this.storages = {};\n\n /* if (typeof runtimeFactory.createRuntimeCatalogue === 'function') {\n this.runtimeCatalogue = runtimeFactory.createRuntimeCatalogue();\n } else {\n throw new Error('Check your Runtime Factory because it needs the Runtime Catalogue implementation');\n }*/\n\n this.runtimeCatalogue = new _RuntimeCatalogue2.default(runtimeFactory);\n\n /* if (typeof runtimeFactory.persistenceManager === 'function') {\n this.persistenceManager = runtimeFactory.persistenceManager();\n } else {\n throw new Error('Check your Runtime Factory because it needs the Persistence Manager implementation');\n }*/\n\n if (typeof runtimeFactory.storageManager === 'function') {\n\n this.storages = (0, _Storage.storage)(runtimeFactory, this);\n } else {\n throw new Error('Check your Runtime Factory because it needs the Storage Manager implementation');\n }\n\n if (typeof runtimeFactory.runtimeCapabilities === 'function') {\n this.runtimeCapabilities = runtimeFactory.runtimeCapabilities(this.storages.capabilities);\n } else {\n log.info('Check your RuntimeFactory because it needs the Runtime Capabilities implementation');\n }\n }\n\n /**\n * Intialize the installation of runtime\n *\n * @access public\n * @return {Promise} this is Promise and if the installation process happened without any problems returns true otherwise the error.\n *\n * @memberOf RuntimeUA\n */\n\n\n (0, _createClass3.default)(RuntimeUA, [{\n key: 'init',\n value: function init() {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this2.domain = _this2.runtimeConfiguration.domain;\n\n log.info('[RuntimeUA - init] Starting ');\n\n try {\n var getCapabilities = _this2.runtimeCapabilities.getRuntimeCapabilities();\n var getRuntimeURL = _this2.storages.runtime.get('runtime:URL');\n var getStoredDataObjects = _this2.storages.syncherManager.get('syncherManager:ObjectURLs');\n var getHypertyStorageObjects = _this2.storages.hypertyResources.get();\n var getP2PHandlerURL = _this2.storages.runtime.get('p2pHandler:URL');\n // let getRemotes = this.storages.syncherManager.get('remotes');\n\n _promise2.default.all([getRuntimeURL, getCapabilities, getStoredDataObjects, getHypertyStorageObjects, getP2PHandlerURL]).then(function (results) {\n\n _this2.runtimeURL = results[0] ? results[0].runtimeURL : results[0];\n if (!_this2.runtimeURL) {\n _this2.runtimeURL = 'runtime://' + _this2.domain + '/' + (0, _utils.generateGUID)();\n _this2.storages.runtime.set('runtime:URL', 1, { runtimeURL: _this2.runtimeURL });\n }\n\n _this2.capabilities = results[1];\n (0, _assign2.default)(_runtimeUtils.runtimeUtils.runtimeCapabilities.constraints, results[1]);\n\n _this2._dataObjectsStorage = new _DataObjectsStorage2.default(_this2.storages.syncherManager, results[2] || {}, _this2.runtimeFactory, _this2);\n\n _this2._hypertyResources = results[3] || {};\n\n _this2.p2pHandlerURL = results[4] ? results[4].p2pHandlerURL : results[4];\n if (!_this2.p2pHandlerURL) {\n _this2.p2pHandlerURL = _this2.runtimeURL + '/p2phandler/' + (0, _utils.generateGUID)();\n log.info('[RuntimeUA - init] P2PHandlerURL: ', _this2.p2pHandlerURL);\n\n _this2.storages.runtime.set('p2pHandler:URL', 1, { p2pHandlerURL: _this2.p2pHandlerURL });\n }\n\n /* log.info('[RuntimeUA - init] dataObjectsStorage remote load starting');\n this._dataObjectsStorage.loadRemote().then(()=> {\n log.info('[RuntimeUA - init] dataObjectsStorage remote load concluded');*/\n return _this2._loadComponents();\n\n // });\n\n }).then(function (status) {\n\n _this2._hypertyResourcesStorage = new _HypertyResourcesStorage2.default(_this2.runtimeURL, _this2.messageBus, _this2.storages.hypertyResources, _this2._hypertyResources);\n\n if (_this2.p2p) {\n log.info('[RuntimeUA - init] load p2pHandler: ', status);\n return _this2._loadP2PHandler();\n } else {\n log.info('[RuntimeUA - init] P2P not supported');\n return 'P2P Not Supported';\n }\n }).then(function (result) {\n log.info('[runtime ua - init] - status: ', result);\n resolve(true);\n }, function (reason) {\n log.error('ERROR: ', reason);\n resolve(true);\n });\n } catch (e) {\n reject(e);\n }\n });\n }\n }, {\n key: '_updateRuntimeStatus',\n value: function _updateRuntimeStatus(event) {\n\n var _this = this;\n\n _this.messageBus.postMessage({\n from: this.runtimeURL,\n to: this.runtimeURL + '/status',\n type: 'update',\n body: event\n });\n }\n }, {\n key: '_loadP2PHandler',\n value: function _loadP2PHandler() {\n var _this3 = this;\n\n return new _promise2.default(function (resolve) {\n\n var runtimeDescriptor = _runtimeUtils.runtimeUtils.runtimeDescriptor;\n var p2pStubHandler = runtimeDescriptor.p2pHandlerStub;\n\n var p2pConfig = {\n isHandlerStub: true,\n runtimeURL: _this3.runtimeURL\n };\n\n log.log('[RuntimeUA loadP2PHandler] P2PStubHandler: ', p2pStubHandler);\n\n _this3.loader.loadStub(p2pStubHandler, p2pConfig).then(function (result) {\n\n var runtimeUAURL = _this3.runtimeURL + '/ua';\n var msg = {\n type: 'subscribe',\n from: runtimeUAURL,\n to: 'domain://msg-node.' + _this3.domain + '/sm',\n body: {\n subscribe: [result.url],\n source: _this3.runtimeURL\n }\n };\n\n _this3.messageBus.addListener(runtimeUAURL, function (msg) {\n log.log('[runtime ua - listener] - receive msg: ', msg);\n });\n\n _this3.messageBus.postMessage(msg, function (reply) {\n log.log('[runtime ua - postMessage] - reply: ', reply);\n });\n\n log.info('[runtime ua - p2p installation] - success: ', result);\n resolve(true);\n }).catch(function (reason) {\n log.info('[runtime ua - p2p installation] - fail: ', reason);\n resolve(false);\n });\n });\n }\n\n /**\n *\n * @access private\n * @return {Promise} this is Promise and returns true if all components are loaded with success or an error if someone fails.\n *\n * @memberOf RuntimeUA\n */\n\n }, {\n key: '_loadComponents',\n value: function _loadComponents() {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n try {\n\n // Prepare the on instance to handle with the fallbacks and runtimeCatalogue;\n _this4.descriptorInstance = new _Descriptors2.default(_this4.runtimeURL, _this4.runtimeCatalogue, _this4.runtimeConfiguration);\n\n // Prepare the loader to load the hyperties, protostubs and idpproxy;\n _this4.loader = new _Loader2.default(_this4.runtimeURL, _this4.runtimeConfiguration, _this4.descriptorInstance);\n\n // Instantiate the identity Module\n _this4.identityModule = new _IdentityModule2.default(_this4.runtimeURL, _this4.runtimeCapabilities, _this4.storages.identity, _this4._dataObjectsStorage, _CryptoManager2.default, _this4.runtimeCatalogue);\n\n // Use the sandbox factory to create an AppSandbox;\n // In the future can be decided by policyEngine if we need\n // create a AppSandbox or not;\n var appSandbox = _this4.runtimeFactory.createAppSandbox();\n\n // Instantiate the Registry Module\n _this4.registry = new _Registry2.default(_this4.runtimeURL, appSandbox, _this4.identityModule, _this4.runtimeCatalogue, _this4.runtimeCapabilities, _this4.storages.registry, _this4.p2pHandlerURL);\n\n // Set the loader to load Hyperties, Stubs and IdpProxies\n _this4.registry.loader = _this4.loader;\n\n // Instantiate the Message Bus\n _this4.messageBus = new _MessageBus2.default(_this4.registry);\n\n // Instanciate the SubscriptionManager;\n _this4.subscriptionManager = new _SubscriptionManager2.default(_this4.runtimeURL, _this4.messageBus, _this4.storages.subscriptions);\n\n // Prepare the address allocation instance;\n _this4.addressAllocation = new _AddressAllocation2.default(_this4.runtimeURL, _this4.messageBus, _this4.registry, _this4.subscriptionManager);\n\n // Instantiate the Policy Engine\n _this4.policyEngine = new _PEP2.default(new _RuntimeCoreCtx2.default(_this4.runtimeURL, _this4.identityModule, _this4.registry, _this4.storages.policy, _this4.runtimeCapabilities));\n\n // Instantiate Discovery\n _this4.coreDiscovery = new _CoreDiscovery2.default(_this4.runtimeURL, _this4.messageBus, _this4.graphConnector, _this4.runtimeFactory, _this4.registry);\n\n // Instantiate the identityHandler\n _this4.identityHandler = new _IdentityHandler2.default(_this4.identityModule);\n\n // initialise the CryptoManager\n _CryptoManager2.default.init(_this4.runtimeURL, _this4.runtimeCapabilities, _this4.storages.cryptoManager, _this4._dataObjectsStorage, _this4.registry, _this4.coreDiscovery, _this4.identityModule, _this4.runtimeFactory);\n\n // Instantiate the Graph Connector\n // this.graphConnector = process.env.MODE !== 'light' ? new GraphConnector(this.runtimeURL, this.messageBus, this.storageManager) : null;\n\n _this4.handlers = new _MsgBusHandlers2.default(_this4.policyEngine, _this4.identityHandler, _CryptoManager2.default);\n\n _this4.messageBus.pipelineOut.handlers = [_this4.handlers.idmHandler, _this4.handlers.pepOutHandler, _this4.handlers.encryptHandler];\n _this4.messageBus.pipelineIn.handlers = [_this4.handlers.decryptHandler, _this4.handlers.pepInHandler];\n\n // Add to App Sandbox the listener;\n appSandbox.addListener('*', function (msg) {\n _this4.messageBus.postMessage(msg);\n });\n\n _CryptoManager2.default.messageBus = _this4.messageBus;\n\n // Register messageBus on Registry\n _this4.registry.messageBus = _this4.messageBus;\n\n // Policy Engine\n _this4.policyEngine.messageBus = _this4.messageBus;\n\n // Register messageBus on IDM\n _this4.identityModule.messageBus = _this4.messageBus;\n\n // Register registry on IdentityModule\n _this4.identityModule.registry = _this4.registry;\n\n // Register coreDiscovery on IdentityModule\n _this4.identityModule.coreDiscovery = _this4.coreDiscovery;\n\n // Use sandbox factory to use specific methods\n // and set the message bus to the factory\n _this4.runtimeFactory.messageBus = _this4.messageBus;\n\n // Instanciate the SyncherManager;\n _this4.syncherManager = new _SyncherManager2.default(_this4.runtimeURL, _this4.messageBus, _this4.registry, _this4.runtimeCatalogue, _this4.storages.syncherManager, null, _this4._dataObjectsStorage, _this4.identityModule);\n\n // Set into loader the needed components;\n _this4.loader.runtimeURL = _this4.runtimeURL;\n _this4.loader.messageBus = _this4.messageBus;\n _this4.loader.registry = _this4.registry;\n _this4.loader.runtimeCatalogue = _this4.runtimeCatalogue;\n _this4.loader.runtimeFactory = _this4.runtimeFactory;\n\n //Instantiate Discovery Lib for notification testing\n // this.discovery = new Discovery(\"hyperty://localhost/test\", this.runtimeURL, this.messageBus);\n // this.loadStub(\"localhost\");\n // setTimeout(() => {\n // this.discovery.discoverHypertiesDO(\"user://google.com/openidtest20@gmail.com\")\n // .then(hyperties => {\n // hyperties.forEach(hyperty =>{\n // hyperty.onLive(() => log.log(`Notification from ${hyperty.data.hypertyID} changed to live`));\n // hyperty.onDisconnected(() => log.log(`Notification from ${hyperty.data.hypertyID} changed to disconnected`));\n // });\n // });\n // }, 2000);\n\n\n // this.subscriptionManager.init().then(()=>{\n // resolve(true);\n // });\n\n var prepareComponents = [];\n prepareComponents.push(_this4.subscriptionManager.init());\n prepareComponents.push(_this4.identityModule.init());\n prepareComponents.push(_CryptoManager2.default.loadSessionKeys());\n\n _promise2.default.all(prepareComponents).then(function (result) {\n if (result.length === 3) {\n resolve(true);\n } else {\n reject('[RuntimeUA._loadComponents] Error ] ', result);\n }\n }).catch(function (reason) {\n throw Error(reason);\n });\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Deploy Hyperty from Catalogue URL\n *\n * @see https://github.com/reTHINK-project/specs/tree/master/datamodel/core/address\n *\n * @param {URL.HypertyCatalogueURL} hypertyCatalogueURL - The Catalogue URL used to identify descriptors in the Catalogue.\n * @param {boolean|URL.HypertyURL} [reuseURL=false] reuseURL - reuseURL is used to reuse the hypertyURL previously registred, by default the reuse is disabled;\n * @param {URL} appURL - the app url address; // TODO: improve this description;\n * @returns {Promise} this is Promise and returns true if all components are loaded with success or an error if someone fails.\n *\n * @memberOf RuntimeUA\n */\n\n }, {\n key: 'loadHyperty',\n value: function loadHyperty(hypertyCatalogueURL) {\n var reuseURL = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var appURL = arguments[2];\n\n\n if (!hypertyCatalogueURL) throw new Error('Hyperty descriptor url parameter is needed');\n return this.loader.loadHyperty(hypertyCatalogueURL, reuseURL, appURL);\n }\n\n /**\n * Deploy Stub from Catalogue URL or domain url\n * @param {URL.URL} domain domain\n */\n\n }, {\n key: 'loadStub',\n value: function loadStub(protocolstubCatalogueURL) {\n\n if (!protocolstubCatalogueURL) throw new Error('ProtoStub descriptor url parameter is needed');\n return this.loader.loadStub(protocolstubCatalogueURL);\n }\n\n /**\n * Deploy idpProxy from Catalogue URL or domain url\n * @param {URL.URL} domain domain\n */\n\n }, {\n key: 'loadIdpProxy',\n value: function loadIdpProxy(ipdProxyCatalogueURL) {\n log.log('ipdProxyCatalogueURL', ipdProxyCatalogueURL);\n\n if (!ipdProxyCatalogueURL) throw new Error('The IDP Proxy URL is a needed parameter, could be a DOMAIN or a URL');\n return this.loader.loadIdpProxy(ipdProxyCatalogueURL);\n }\n\n /**\n * Used to close all the runtime; Unregister all hyperties;\n * @return {Promise} result of the close method, with true or false to the operation success;\n */\n\n }, {\n key: 'close',\n value: function close(logOut) {\n console.log('Runtime core logout: ', logOut);\n var _this = this;\n if (logOut === true) {\n this.identityHandler.reset();\n }\n\n log.info('Unregister all hyperties');\n return new _promise2.default(function (resolve, reject) {\n\n _this.registry.unregisterAllHyperties().then(function (result) {\n log.info('All the hyperties are unregisted with Success:', result);\n resolve(true);\n }).catch(function (reason) {\n log.error('Failed to unregister the hyperties', reason);\n reject(false);\n });\n });\n }\n\n /**\n * Used to reset the runtime by deleting all data from the storage manager;\n * @return {Promise} result of the reset method, with true or false to the operation success;\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n var _this5 = this;\n\n console.log('RuntimeUA.Runtime core reset: ');\n\n var reseting = [];\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //TODO: delegate db reset operation to each component\n // this.identityManager.reset();\n\n _this5.storages.identity.get(false, false, 'identities').then(function (identities) {\n var identitiesKeys = (0, _keys2.default)(identities);\n\n identitiesKeys.forEach(function (key) {\n reseting.push(_this5.storages.identity.delete(key, false, 'identities'));\n });\n\n reseting.push(_this5.storages.capabilities.delete('capabilities'));\n reseting.push(_this5.storages.cryptoManager.delete('userAsymmetricKey'));\n reseting.push(_this5.storages.hypertyResources.delete('hypertyResources'));\n reseting.push(_this5.storages.identity.delete('accessTokens'));\n reseting.push(_this5.storages.registry.delete('registry:DataObjectURLs'));\n reseting.push(_this5.storages.registry.delete('registry:HypertyURLs'));\n reseting.push(_this5.storages.runtime.delete('p2pHandler:URL'));\n reseting.push(_this5.storages.runtime.delete('runtime:URL'));\n // reseting.push(this.storages.runtimeCatalogue.delete('runtimeCatalogue'));\n reseting.push(_this5.storages.subscriptions.delete('subscriptions'));\n reseting.push(_this5.storages.syncherManager.delete('syncherManager:ObjectURLs'));\n\n _promise2.default.all(reseting).then(function (result) {\n\n log.info('All DBs were reset with Success:', result);\n resolve(true);\n }).catch(function (reason) {\n log.error('Failed to reset all DBs', reason);\n resolve(false);\n });\n });\n });\n }\n }]);\n return RuntimeUA;\n}();\n\nexports.default = RuntimeUA;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL1J1bnRpbWVVQS5qcz9iZmFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4qIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuKlxuKiAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuKlxuKiBVbmx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0FBRUE7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///425\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(427);\nmodule.exports = __webpack_require__(11).Object.keys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qcz84YzU2Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Qua2V5cztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNDI2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///426\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(76);\nvar $keys = __webpack_require__(68);\n\n__webpack_require__(138)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qcz8wOWRjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCBPYmplY3Qua2V5cyhPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2tleXMnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBrZXlzKGl0KSB7XG4gICAgcmV0dXJuICRrZXlzKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNDI3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///427\n")},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(50);\nvar toLength = __webpack_require__(133);\nvar toAbsoluteIndex = __webpack_require__(429);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hcnJheS1pbmNsdWRlcy5qcz9iYzU3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbHNlIC0+IEFycmF5I2luZGV4T2Zcbi8vIHRydWUgIC0+IEFycmF5I2luY2x1ZGVzXG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZX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sZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FycmF5LWluY2x1ZGVzLmpzXG4vLyBtb2R1bGUgaWQgPSA0Mjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///428\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(134);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1hYnNvbHV0ZS1pbmRleC5qcz83ZTQwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWF4ID0gTWF0aC5tYXg7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpbmRleCwgbGVuZ3RoKSB7XG4gIGluZGV4ID0gdG9JbnRlZ2VyKGluZGV4KTtcbiAgcmV0dXJuIGluZGV4IDwgMCA/IG1heChpbmRleCArIGxlbmd0aCwgMCkgOiBtaW4oaW5kZXgsIGxlbmd0aCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSA0Mjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///429\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(192);\n__webpack_require__(80);\n__webpack_require__(101);\n__webpack_require__(437);\n__webpack_require__(445);\n__webpack_require__(446);\nmodule.exports = __webpack_require__(11).Promise;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9wcm9taXNlLmpzPzUzOTgiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZycpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi9tb2R1bGVzL3dlYi5kb20uaXRlcmFibGUnKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvZXM2LnByb21pc2UnKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvZXM3LnByb21pc2UuZmluYWxseScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczcucHJvbWlzZS50cnknKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vbW9kdWxlcy9fY29yZScpLlByb21pc2U7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vcHJvbWlzZS5qc1xuLy8gbW9kdWxlIGlkID0gNDMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///430\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(134);\nvar defined = __webpack_require__(132);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zdHJpbmctYXQuanM/ODdhZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9JbnRlZ2VyID0gcmVxdWlyZSgnLi9fdG8taW50ZWdlcicpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG4vLyB0cnVlICAtPiBTdHJpbmcjYXRcbi8vIGZhbHNlIC0+IFN0cmluZyNjb2RlUG9pbnRBdFxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoVE9fU1RSSU5HKSB7XG4gIHJldHVybiBmdW5jdGlvbiAodGhhdCwgcG9zKSB7XG4gICAgdmFyIHMgPSBTdHJpbmcoZGVmaW5lZCh0aGF0KSk7XG4gICAgdmFyIGkgPSB0b0ludGVnZXIocG9zKTtcbiAgICB2YXIgbCA9IHMubGVuZ3RoO1xuICAgIHZhciBhLCBiO1xuICAgIGlmIChpIDwgMCB8fCBpID49IGwpIHJldHVybiBUT19TVFJJTkcgPyAnJyA6IHVuZGVmaW5lZDtcbiAgICBhID0gcy5jaGFyQ29kZUF0KGkpO1xuICAgIHJldHVybiBhIDwgMHhkODAwIHx8IGEgPiAweGRiZmYgfHwgaSArIDEgPT09IGwgfHwgKGIgPSBzLmNoYXJDb2RlQXQoaSArIDEpKSA8IDB4ZGMwMCB8fCBiID4gMHhkZmZmXG4gICAgICA/IFRPX1NUUklORyA/IHMuY2hhckF0KGkpIDogYVxuICAgICAgOiBUT19TVFJJTkcgPyBzLnNsaWNlKGksIGkgKyAyKSA6IChhIC0gMHhkODAwIDw8IDEwKSArIChiIC0gMHhkYzAwKSArIDB4MTAwMDA7XG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3N0cmluZy1hdC5qc1xuLy8gbW9kdWxlIGlkID0gNDMxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///431\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(141);\nvar descriptor = __webpack_require__(79);\nvar setToStringTag = __webpack_require__(100);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(63)(IteratorPrototype, __webpack_require__(22)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWNyZWF0ZS5qcz9mNzg1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBjcmVhdGUgPSByZXF1aXJlKCcuL19vYmplY3QtY3JlYXRlJyk7XG52YXIgZGVzY3JpcHRvciA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbnZhciBzZXRUb1N0cmluZ1RhZyA9IHJlcXVpcmUoJy4vX3NldC10by1zdHJpbmctdGFnJyk7XG52YXIgSXRlcmF0b3JQcm90b3R5cGUgPSB7fTtcblxuLy8gMjUuMS4yLjEuMSAlSXRlcmF0b3JQcm90b3R5cGUlW0BAaXRlcmF0b3JdKClcbnJlcXVpcmUoJy4vX2hpZGUnKShJdGVyYXRvclByb3RvdHlwZSwgcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyksIGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXM7IH0pO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChDb25zdHJ1Y3RvciwgTkFNRSwgbmV4dCkge1xuICBDb25zdHJ1Y3Rvci5wcm90b3R5cGUgPSBjcmVhdGUoSXRlcmF0b3JQcm90b3R5cGUsIHsgbmV4dDogZGVzY3JpcHRvcigxLCBuZXh0KSB9KTtcbiAgc2V0VG9TdHJpbmdUYWcoQ29uc3RydWN0b3IsIE5BTUUgKyAnIEl0ZXJhdG9yJyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXItY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSA0MzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///432\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(44);\nvar anObject = __webpack_require__(41);\nvar getKeys = __webpack_require__(68);\n\nmodule.exports = __webpack_require__(51) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHBzLmpzP2FhMmEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBnZXRLZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gT2JqZWN0LmRlZmluZVByb3BlcnRpZXMgOiBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0aWVzKE8sIFByb3BlcnRpZXMpIHtcbiAgYW5PYmplY3QoTyk7XG4gIHZhciBrZXlzID0gZ2V0S2V5cyhQcm9wZXJ0aWVzKTtcbiAgdmFyIGxlbmd0aCA9IGtleXMubGVuZ3RoO1xuICB2YXIgaSA9IDA7XG4gIHZhciBQO1xuICB3aGlsZSAobGVuZ3RoID4gaSkgZFAuZihPLCBQID0ga2V5c1tpKytdLCBQcm9wZXJ0aWVzW1BdKTtcbiAgcmV0dXJuIE87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcHMuanNcbi8vIG1vZHVsZSBpZCA9IDQzM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///433\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(435);\nvar step = __webpack_require__(436);\nvar Iterators = __webpack_require__(71);\nvar toIObject = __webpack_require__(50);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(193)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5pdGVyYXRvci5qcz9jNDY5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBhZGRUb1Vuc2NvcGFibGVzID0gcmVxdWlyZSgnLi9fYWRkLXRvLXVuc2NvcGFibGVzJyk7XG52YXIgc3RlcCA9IHJlcXVpcmUoJy4vX2l0ZXItc3RlcCcpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcblxuLy8gMjIuMS4zLjQgQXJyYXkucHJvdG90eXBlLmVudHJpZXMoKVxuLy8gMjIuMS4zLjEzIEFycmF5LnByb3RvdHlwZS5rZXlzKClcbi8vIDIyLjEuMy4yOSBBcnJheS5wcm90b3R5cGUudmFsdWVzKClcbi8vIDIyLjEuMy4zMCBBcnJheS5wcm90b3R5cGVbQEBpdGVyYXRvcl0oKVxubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19pdGVyLWRlZmluZScpKEFycmF5LCAnQXJyYXknLCBmdW5jdGlvbiAoaXRlcmF0ZWQsIGtpbmQpIHtcbiAgdGhpcy5fdCA9IHRvSU9iamVjdChpdGVyYXRlZCk7IC8vIHRhcmdldFxuICB0aGlzLl9pID0gMDsgICAgICAgICAgICAgICAgICAgLy8gbmV4dCBpbmRleFx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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///434\n")},function(module,exports){eval("module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanM/ZTI2NyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uICgpIHsgLyogZW1wdHkgKi8gfTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanNcbi8vIG1vZHVsZSBpZCA9IDQzNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///435\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLXN0ZXAuanM/MTA2NiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChkb25lLCB2YWx1ZSkge1xuICByZXR1cm4geyB2YWx1ZTogdmFsdWUsIGRvbmU6ICEhZG9uZSB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLXN0ZXAuanNcbi8vIG1vZHVsZSBpZCA9IDQzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///436\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(78);\nvar global = __webpack_require__(21);\nvar ctx = __webpack_require__(69);\nvar classof = __webpack_require__(142);\nvar $export = __webpack_require__(26);\nvar isObject = __webpack_require__(45);\nvar aFunction = __webpack_require__(99);\nvar anInstance = __webpack_require__(438);\nvar forOf = __webpack_require__(439);\nvar speciesConstructor = __webpack_require__(199);\nvar task = __webpack_require__(200).set;\nvar microtask = __webpack_require__(441)();\nvar newPromiseCapabilityModule = __webpack_require__(144);\nvar perform = __webpack_require__(201);\nvar userAgent = __webpack_require__(442);\nvar promiseResolve = __webpack_require__(202);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(22)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(443)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(100)($Promise, PROMISE);\n__webpack_require__(444)(PROMISE);\nWrapper = __webpack_require__(11)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(203)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5wcm9taXNlLmpzPzA5N2MiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIExJQlJBUlkgPSByZXF1aXJlKCcuL19saWJyYXJ5Jyk7XG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgY2xhc3NvZiA9IHJlcXVpcmUoJy4vX2NsYXNzb2YnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgYW5JbnN0YW5jZSA9IHJlcXVpcmUoJy4vX2FuLWluc3RhbmNlJyk7XG52YXIgZm9yT2YgPSByZXF1aXJl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ZXN1bHQgPSB2YWx1ZTtcbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChkb21haW4pIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgcmVzdWx0ID0gaGFuZGxlcih2YWx1ZSk7IC8vIG1heSB0aHJvd1xuICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICAgICAgICBleGl0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocmVzdWx0ID09PSByZWFjdGlvbi5wcm9taXNlKSB7XG4gICAgICAgICAgICByZWplY3QoVHlwZUVycm9yKCdQcm9taXNlLWNoYWluIGN5Y2xlJykpO1xuICAgICAgICAgIH0gZWxzZSBpZiAodGhlbiA9IGlzVGhlbmFibGUocmVzdWx0KSkge1xuICAgICAgICAgICAgdGhlbi5jYWxsKHJlc3VsdCwgcmVzb2x2ZSwgcmVqZWN0KTtcbiAgICAgICAgICB9IGVsc2UgcmVzb2x2ZShyZXN1bHQpO1xuICAgICAgICB9IGVsc2UgcmVqZWN0KHZhbHVlKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgaWYgKGRvbWFpbiAmJiAhZXhpdGVkKSBkb21haW4uZXhpdCgpO1xuICAgICAgICByZWplY3QoZSk7XG4gICAgICB9XG4gICAgfTtcbiAgICB3aGlsZSAoY2hhaW4ubGVuZ3RoID4gaSkgcnVuKGNoYWluW2krK10pOyAvLyB2YXJpYWJsZSBsZW5ndGggLSBjYW4ndCB1c2UgZm9yRWFjaFxuICAgIHByb21pc2UuX2MgPSBbXTtcbiAgICBwcm9taXNlLl9uID0gZmFsc2U7XG4gICAgaWYgKGlzUmVqZWN0ICYmICFwcm9taXNlLl9oKSBvblVuaGFuZGxlZChwcm9taXNlKTtcbiAgfSk7XG59O1xudmFyIG9uVW5oYW5kbGVkID0gZnVuY3Rpb24gKHByb21pc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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///437\n")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1pbnN0YW5jZS5qcz9kOGFjIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBDb25zdHJ1Y3RvciwgbmFtZSwgZm9yYmlkZGVuRmllbGQpIHtcbiAgaWYgKCEoaXQgaW5zdGFuY2VvZiBDb25zdHJ1Y3RvcikgfHwgKGZvcmJpZGRlbkZpZWxkICE9PSB1bmRlZmluZWQgJiYgZm9yYmlkZGVuRmllbGQgaW4gaXQpKSB7XG4gICAgdGhyb3cgVHlwZUVycm9yKG5hbWUgKyAnOiBpbmNvcnJlY3QgaW52b2NhdGlvbiEnKTtcbiAgfSByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLWluc3RhbmNlLmpzXG4vLyBtb2R1bGUgaWQgPSA0Mzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///438\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(69);\nvar call = __webpack_require__(197);\nvar isArrayIter = __webpack_require__(198);\nvar anObject = __webpack_require__(41);\nvar toLength = __webpack_require__(133);\nvar getIterFn = __webpack_require__(143);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19mb3Itb2YuanM/MzU2YiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgY2FsbCA9IHJlcXVpcmUoJy4vX2l0ZXItY2FsbCcpO1xudmFyIGlzQXJyYXlJdGVyID0gcmVxdWlyZSgnLi9faXMtYXJyYXktaXRlcicpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBnZXRJdGVyRm4gPSByZXF1aXJlKCcuL2NvcmUuZ2V0LWl0ZXJhdG9yL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ZXJhdG9yLCBmLCBzdGVwLnZhbHVlLCBlbnRyaWVzKTtcbiAgICBpZiAocmVzdWx0ID09PSBCUkVBSyB8fCByZXN1bHQgPT09IFJFVFVSTikgcmV0dXJuIHJlc3VsdDtcbiAgfVxufTtcbmV4cG9ydHMuQlJFQUsgPSBCUkVBSztcbmV4cG9ydHMuUkVUVVJOID0gUkVUVVJOO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2Zvci1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///439\n")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8v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vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faW52b2tlLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///440\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar macrotask = __webpack_require__(200).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(77)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19taWNyb3Rhc2suanM/ZjM2MyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgbWFjcm90YXNrID0gcmVxdWlyZSgnLi9fdGFzaycpLnNldDtcbnZhciBPYnNlcnZlciA9IGdsb2JhbC5NdXRhdGlvbk9ic2VydmVyIHx8IGdsb2JhbC5XZWJLaXRNdXRhdGlvbk9ic2VydmVyO1xudmFyIHByb2Nlc3MgPSBnbG9iYWwucHJvY2VzcztcbnZhciBQcm9taXNlID0gZ2xvYmFsLlByb21pc2U7XG52YXIgaXNOb2RlID0gcmVxdWlyZSgnLi9fY29mJykocHJvY2VzcykgPT0gJ3Byb2Nlc3MnO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uICgpIHtcbiAgdmFyIGhlYWQsIGxhc3QsIG5vdGlmeTtcblxuICB2YXIgZmx1c2ggPSBmdW5jdGlvbiAoKSB7XG4gICAgdmFyIHBhcmVudCwgZm47XG4gICAgaWYgKGlzTm9kZSAmJiAocGFyZW50ID0gcHJvY2Vzcy5kb21haW4pKSBwYXJlbnQuZXhpdCgpO1xuICAgIHdoaWxlIChoZWFkKSB7XG4gICAgICBmbiA9IGhlYWQuZm47XG4gICAgICBoZWFkID0gaGVhZC5uZXh0O1xuICAgICAgdHJ5IHtcbiAgICAgICAgZm4oKTtcbiAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgaWYgKGhl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AiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///441\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL191c2VyLWFnZW50LmpzPzg5NDYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIG5hdmlnYXRvciA9IGdsb2JhbC5uYXZpZ2F0b3I7XG5cbm1vZHVsZS5leHBvcnRzID0gbmF2aWdhdG9yICYmIG5hdmlnYXRvci51c2VyQWdlbnQgfHwgJyc7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdXNlci1hZ2VudC5qc1xuLy8gbW9kdWxlIGlkID0gNDQyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///442\n")},function(module,exports,__webpack_require__){eval("var hide = __webpack_require__(63);\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19yZWRlZmluZS1hbGwuanM/YzQ3ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKHRhcmdldCwgc3JjLCBzYWZlKSB7XG4gIGZvciAodmFyIGtleSBpbiBzcmMpIHtcbiAgICBpZiAoc2FmZSAmJiB0YXJnZXRba2V5XSkgdGFyZ2V0W2tleV0gPSBzcmNba2V5XTtcbiAgICBlbHNlIGhpZGUodGFyZ2V0LCBrZXksIHNyY1trZXldKTtcbiAgfSByZXR1cm4gdGFyZ2V0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19yZWRlZmluZS1hbGwuanNcbi8vIG1vZHVsZSBpZCA9IDQ0M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///443\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(21);\nvar core = __webpack_require__(11);\nvar dP = __webpack_require__(44);\nvar DESCRIPTORS = __webpack_require__(51);\nvar SPECIES = __webpack_require__(22)('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtc3BlY2llcy5qcz82ZDFhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgREVTQ1JJUFRPUlMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpO1xudmFyIFNQRUNJRVMgPSByZXF1aXJlKCcuL193a3MnKSgnc3BlY2llcycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVkpIHtcbiAgdmFyIEMgPSB0eXBlb2YgY29yZVtLRVldID09ICdmdW5jdGlvbicgPyBjb3JlW0tFWV0gOiBnbG9iYWxbS0VZXTtcbiAgaWYgKERFU0NSSVBUT1JTICYmIEMgJiYgIUNbU1BFQ0lFU10pIGRQLmYoQywgU1BFQ0lFUywge1xuICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXM7IH1cbiAgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC1zcGVjaWVzLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///444\n")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(26);\nvar core = __webpack_require__(11);\nvar global = __webpack_require__(21);\nvar speciesConstructor = __webpack_require__(199);\nvar promiseResolve = __webpack_require__(202);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLmZpbmFsbHkuanM/MTJhMCJdLCJzb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Ly8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczcucHJvbWlzZS5maW5hbGx5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NDVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///445\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(26);\nvar newPromiseCapability = __webpack_require__(144);\nvar perform = __webpack_require__(201);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLnRyeS5qcz84Y2E1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLXByb21pc2UtdHJ5XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIG5ld1Byb21pc2VDYXBhYmlsaXR5ID0gcmVxdWlyZSgnLi9fbmV3LXByb21pc2UtY2FwYWJpbGl0eScpO1xudmFyIHBlcmZvcm0gPSByZXF1aXJlKCcuL19wZXJmb3JtJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUHJvbWlzZScsIHsgJ3RyeSc6IGZ1bmN0aW9uIChjYWxsYmFja2ZuKSB7XG4gIHZhciBwcm9taXNlQ2FwYWJpbGl0eSA9IG5ld1Byb21pc2VDYXBhYmlsaXR5LmYodGhpcyk7XG4gIHZhciByZXN1bHQgPSBwZXJmb3JtKGNhbGxiYWNrZm4pO1xuICAocmVzdWx0LmUgPyBwcm9taXNlQ2FwYWJpbGl0eS5yZWplY3QgOiBwcm9taXNlQ2FwYWJpbGl0eS5yZXNvbHZlKShyZXN1bHQudik7XG4gIHJldHVybiBwcm9taXNlQ2FwYWJpbGl0eS5wcm9taXNlO1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLnRyeS5qc1xuLy8gbW9kdWxlIGlkID0gNDQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///446\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(448);\nmodule.exports = __webpack_require__(11).Object.assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvYXNzaWduLmpzPzU3N2IiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmFzc2lnbicpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0LmFzc2lnbjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///447\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(26);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(449) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuYXNzaWduLmpzPzQ3OGMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4zLjEgT2JqZWN0LmFzc2lnbih0YXJnZXQsIHNvdXJjZSlcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GLCAnT2JqZWN0JywgeyBhc3NpZ246IHJlcXVpcmUoJy4vX29iamVjdC1hc3NpZ24nKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///448\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(68);\nvar gOPS = __webpack_require__(145);\nvar pIE = __webpack_require__(81);\nvar toObject = __webpack_require__(76);\nvar IObject = __webpack_require__(190);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(70)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtYXNzaWduLmpzPzRlOGQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gMTkuMS4yLjEgT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HZhciBpbmRleCA9IDE7XG4gIHZhciBnZXRTeW1ib2xzID0gZ09QUy5mO1xuICB2YXIgaXNFbnVtID0gcElFLmY7XG4gIHdoaWxlIChhTGVuID4gaW5kZXgpIHtcbiAgICB2YXIgUyA9IElPYmplY3QoYXJndW1lbnRzW2luZGV4KytdKTtcbiAgICB2YXIga2V5cyA9IGdldFN5bWJvbHMgPyBnZXRLZXlzKFMpLmNvbmNhdChnZXRTeW1ib2xzKFMpKSA6IGdldEtleXMoUyk7XG4gICAgdmFyIGxlbmd0aCA9IGtleXMubGVuZ3RoO1xuICAgIHZhciBqID0gMDtcbiAgICB2YXIga2V5O1xuICAgIHdoaWxlIChsZW5ndGggPiBqKSBpZiAoaXNFbnVtLmNhbGwoUywga2V5ID0ga2V5c1tqKytdKSkgVFtrZXldID0gU1trZXldO1xuICB9IHJldHVybiBUO1xufSA6ICRhc3NpZ247XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWFzc2lnbi5qc1xuLy8gbW9kdWxlIGlkID0gNDQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///449\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(451);\nvar $Object = __webpack_require__(11).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzP2Y1YjAiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eScpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0eShpdCwga2V5LCBkZXNjKSB7XG4gIHJldHVybiAkT2JqZWN0LmRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///450\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(26);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(51), 'Object', { defineProperty: __webpack_require__(44).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5LmpzPzk4MjkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi40IC8gMTUuMi4zLjYgT2JqZWN0LmRlZmluZVByb3BlcnR5KE8sIFAsIEF0dHJpYnV0ZXMpXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqICFyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpLCAnT2JqZWN0JywgeyBkZWZpbmVQcm9wZXJ0eTogcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZiB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///451\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.log = undefined;\n\nvar _loglevel = __webpack_require__(4);\n\nvar _loglevel2 = _interopRequireDefault(_loglevel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar a = _loglevel2.default.getLogger('address-allocation');\nvar b = _loglevel2.default.getLogger('Bus');\nvar c = _loglevel2.default.getLogger('MessageBus');\nvar d = _loglevel2.default.getLogger('CoreDiscovery');\nvar e = _loglevel2.default.getLogger('StorageManager');\nvar f = _loglevel2.default.getLogger('HypertyResourcesStorage');\nvar g = _loglevel2.default.getLogger('IdentityModule');\nvar h = _loglevel2.default.getLogger('PEP');\nvar i = _loglevel2.default.getLogger('P2PConnectionResolve');\nvar j = _loglevel2.default.getLogger('Registry');\nvar k = _loglevel2.default.getLogger('RuntimeUA');\nvar l = _loglevel2.default.getLogger('Loader');\nvar m = _loglevel2.default.getLogger('Descriptors');\nvar n = _loglevel2.default.getLogger('DataObjectsStorage');\nvar o = _loglevel2.default.getLogger('Subscription');\nvar p = _loglevel2.default.getLogger('SubscriptionManager');\nvar q = _loglevel2.default.getLogger('ObserverObject');\nvar r = _loglevel2.default.getLogger('ReporterObject');\nvar s = _loglevel2.default.getLogger('SynSubscription');\nvar t = _loglevel2.default.getLogger('SyncherManager');\nvar u = _loglevel2.default.getLogger('IdentityHandler');\nvar v = _loglevel2.default.getLogger('CryptoManager');\nvar x = _loglevel2.default.getLogger('Pipeline');\nvar f1 = _loglevel2.default.getLogger('Syncher');\nvar f2 = _loglevel2.default.getLogger('DataObjectObserver');\n\nexports.log = _loglevel2.default;\n\n/**\n 0 actual logging methods, ordered and available as:\n\n 0 - log.trace(msg)\n 1 - log.debug(msg)\n 2 - log.info(msg)\n 3 - log.warn(msg)\n 4 - log.error(msg)\n\n log.log(msg) is also available, as an alias for log.debug(msg), to improve compatibility with console, and make migration easier.\n\n Exact output formatting of these will depend on the console available in the current context of your application. For example, many environments will include a full stack trace with all trace() calls, and icons or similar to highlight other calls.\n\n These methods should never fail in any environment, even if no console object is currently available, and should always fall back to an available log method even if the specific method called (e.g. warn) isn't available.\n\n Be aware that all this means that these method won't necessarily always produce exactly the output you expect in every environment; loglevel only guarantees that these methods will never explode on you, and that it will call the most relevant method it can find, with your argument. Firefox is a notable example here: due to a current Firefox bug log.trace(msg) calls in Firefox will print only the stacktrace, and won't include any passed message arguments.\n\n*/\n\n// address-allocation\n\na.setLevel(3);\n\n// Bus\nb.setLevel(3);\n\n// MessageBus\nc.setLevel(3);\n\n// CoreDiscovery\nd.setLevel(5);\n\n// StorageManager\ne.setLevel(0);\n\n// HypertyResourcesStorage\nf.setLevel(3);\n\n// IdentityModule\ng.setLevel(3);\n\n// PEP\nh.setLevel(3);\n\n// P2PConnectionResolve\ni.setLevel(3);\n\n// Registry\nj.setLevel(3);\n\n// RuntimeUA\nk.setLevel(0);\n\n// Loader\nl.setLevel(3);\n\n// Descriptors\nm.setLevel(3);\n\n// DataObjectsStorage\nn.setLevel(0);\n\n// Subscription\no.setLevel(3);\n\n// SubscriptionManager\np.setLevel(3);\n\n// ObserverObject\nq.setLevel(0);\n\n// ReporterObject\nr.setLevel(0);\n\n// SynSubscription\ns.setLevel(3);\n\n// SyncherManager\nt.setLevel(0);\n\n// IdentityHandler\nu.setLevel(3);\n\n// CryptoManager\nv.setLevel(3);\n\n// Pipeline\nx.setLevel(3);\n\n// Syncher\nf1.setLevel(0);\n\n// Syncher DataObjectObserver\nf1.setLevel(0);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9sb2dMZXZlbHMuanM/ZjM5MSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgbG9nIGZyb20gJ2xvZ2xldmVsJztcblxuY29uc3QgYSA9IGxvZy5nZXRMb2dnZXIoJ2FkZHJlc3MtYWxsb2NhdGlvbicpO1xuY29uc3QgYiA9IGxvZy5nZXRMb2dnZXIoJ0J1cycpO1xuY29uc3QgYyA9IGxvZy5nZXRMb2dnZXIoJ01lc3NhZ2VCdXMnKTtcbmNvbnN0IGQgPSBsb2cuZ2V0TG9nZ2VyKCdDb3JlRGlzY292ZXJ5Jyk7XG5jb25zdCBlID0gbG9nLmdldExvZ2dlcignU3RvcmFnZU1hbmFnZXInKTtcbmNvbnN0IGYgPSBsb2cuZ2V0TG9nZ2VyKCdIeXBlcnR5UmVzb3VyY2VzU3Rvc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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0JBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///452\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _Sandbox = __webpack_require__(465);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nvar _HypertyInstance = __webpack_require__(212);\n\nvar _HypertyInstance2 = _interopRequireDefault(_HypertyInstance);\n\nvar _DomainRegistration = __webpack_require__(506);\n\nvar _DomainRegistration2 = _interopRequireDefault(_DomainRegistration);\n\nvar _P2PConnectionResolve = __webpack_require__(507);\n\nvar _P2PConnectionResolve2 = _interopRequireDefault(_P2PConnectionResolve);\n\nvar _utils = __webpack_require__(6);\n\n__webpack_require__(149);\n\nvar _Utils = __webpack_require__(213);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Registry'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n\n// import DiscoveryServiceFramework from './DiscoveryServiceFramework';\n\nvar STATUS = { CREATED: 'created', LIVE: 'live', DEPLOYING: 'deploying', DEPLOYED: 'deployed', PROGRESS: 'in-progress', DISCONNECTED: 'disconnected', FAILED: 'deployment-failed', DEAD: 'dead' };\n\n/*import IdentityManager from './IdentityManager';\nimport Discovery from './Discovery';*/\n\n/**\n* Runtime Registry Interface\n*/\n\nvar Registry = function () {\n\n /**\n * To initialise the Runtime Registry with the RuntimeURL that will be the basis to derive the internal runtime addresses when allocating addresses to internal runtime component. In addition, the Registry domain back-end to be used to remotely register Runtime components, is also passed as input parameter.\n * @param {MessageBus} msgbus msgbus\n * @param {HypertyRuntimeURL} runtimeURL runtimeURL\n * @param {AppSandbox} appSandbox appSandbox\n * @param {runtimeCatalogue} runtimeCatalogue runtimeCatalogue\n * @param {DomainURL} remoteRegistry remoteRegistry\n * @param {storageManager} storageManager\n */\n function Registry(runtimeURL, appSandbox, identityModule, runtimeCatalogue, runtimeCapabilities, storageManager, p2pHandlerURL, remoteRegistry) {\n (0, _classCallCheck3.default)(this, Registry);\n\n\n // how some functions receive the parameters for example:\n // new Registry('hyperty-runtime://sp1/123', appSandbox, idModule, remoteRegistry);\n // registry.registerStub(sandbox, 'sp1');\n // registry.registerHyperty(sandBox, 'hyperty-runtime://sp1/123');\n // registry.resolve('hyperty-runtime://sp1/123');\n\n if (!runtimeURL) throw new Error('runtimeURL is missing.');\n if (!storageManager) throw new Error('storageManager is missing.');\n\n /*if (!remoteRegistry) throw new Error('remoteRegistry is missing');*/\n\n var _this = this;\n\n _this.registryURL = runtimeURL + '/registry/';\n _this.appSandbox = appSandbox;\n _this.runtimeURL = runtimeURL;\n _this.p2pHandlerURL = p2pHandlerURL;\n _this.runtimeCatalogue = runtimeCatalogue;\n _this.remoteRegistry = remoteRegistry;\n _this.idModule = identityModule;\n _this.storageManager = storageManager;\n _this.runtimeCapabilities = runtimeCapabilities;\n _this.identifier = (0, _utils.generateGUID)();\n\n _this.hypertiesListToRemove = {};\n _this.hypertiesList = [];\n _this.remoteHypertyList = [];\n _this.remoteDataObjectList = [];\n _this.idpLegacyProxyList = {};\n\n _this.watchingYou = new _Utils.WatchingYou();\n _this.p2pHandlerStub = {};\n _this.p2pRequesterStub = _this.watchingYou.watch('p2pRequesterStub', {}, true);\n _this.p2pConnectionList = _this.watchingYou.watch('p2pConnectionList', {}, true);\n _this.p2pHandlerAssociation = {};\n\n _this.protostubsList = _this.watchingYou.watch('protostubsList', {}, true);\n _this.idpProxyList = _this.watchingYou.watch('idpProxyList', {}, true);\n _this.dataObjectList = {};\n _this.subscribedDataObjectList = {};\n _this.sandboxesList = { sandbox: {}, appSandbox: {} };\n _this.pepList = {};\n _this.registries = {};\n\n _this._domain = (0, _utils.divideURL)(_this.registryURL).domain;\n _this.sandboxesList.appSandbox[runtimeURL] = appSandbox;\n var p2pConnectionResolve = new _P2PConnectionResolve2.default(_this);\n\n _this._p2pConnectionResolve = p2pConnectionResolve;\n }\n\n (0, _createClass3.default)(Registry, [{\n key: '_getIdentityAssociated',\n value: function _getIdentityAssociated(type, hypertyURL) {\n var _this = this;\n\n for (var hyperty in _this.hypertiesList) {\n var value = _this.hypertiesList[hyperty];\n\n if (value._hypertyURL === hypertyURL) {\n switch (type) {\n case 'username':\n return value._user.username;\n case 'cn':\n return value._user.cn;\n case 'locale':\n return value._user.locale;\n case 'avatar':\n return value._user.avatar;\n case 'userURL':\n return value._user.userURL;\n case '.':\n return value._user;\n default:\n return '';\n }\n }\n }\n return '';\n }\n\n /**\n * This function is used to return the sandbox instance where the Application is executing. It is assumed there is just one App per Runtime instance.\n */\n\n }, {\n key: 'getAppSandbox',\n value: function getAppSandbox() {\n var _this = this;\n return _this.appSandbox;\n }\n\n /**\n * This function returns the user associated to the hyperty URL\n * @param {String} hypertyURL hyperty URL\n * @return {String} userURL user URL\n */\n\n }, {\n key: 'getHypertyOwner',\n value: function getHypertyOwner(hypertyURL) {\n\n var _this = this;\n var userURL = void 0;\n\n for (var index in _this.hypertiesList) {\n var hyperty = _this.hypertiesList[index];\n\n if (hyperty.hypertyURL === hypertyURL) {\n return hyperty.user.userURL;\n }\n }\n return userURL;\n }\n\n /**\n * This function returns the user associated to the hyperty URL\n * @param {String} dataObjectURL dataObjectURL URL\n * @return {String} userURL user URL\n */\n\n }, {\n key: 'getDataObjectReporter',\n value: function getDataObjectReporter(dataObjectURL) {\n\n var _this = this;\n var DOurl = (0, _utils.removePathFromURL)(dataObjectURL);\n for (var index in _this.dataObjectList) {\n var dataObject = _this.dataObjectList[index];\n\n if (dataObject.url === DOurl) {\n return dataObject.reporter;\n }\n }\n return null;\n }\n\n /**\n * returns the hyperty Name from a given url. This url could be from a dataObject or hyperty\n * @param {String} url hyperty or dataObject URL\n * @return {String} hypertyName hyperty Name\n */\n\n }, {\n key: 'getHypertyName',\n value: function getHypertyName(url) {\n var _this = this;\n\n var isHypertyURL = (0, _utils.divideURL)(url).type === 'hyperty';\n\n //value to be returned in the end\n var hypertyName = void 0;\n\n //if is not an hyperty, check if is a dataObject and obtain his reporter\n var hypertyURL = isHypertyURL ? url : _this.getReporterURLSynchonous(url);\n\n for (var index in _this.hypertiesList) {\n var hyperty = _this.hypertiesList[index];\n if (hyperty.hypertyURL === hypertyURL) {\n hypertyName = hyperty.objectName;\n break;\n }\n }\n return hypertyName;\n }\n\n /**\n * function to return the reporterURL associated with the dataobject URL\n * @param {String} dataObjectURL dataObjectURL\n * @return {String} reporterURL reporterURL\n */\n\n }, {\n key: 'getReporterURL',\n value: function getReporterURL(dataObjectURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n if (dataObject) {\n resolve(dataObject.reporter);\n } else {\n reject('No reporter was found');\n }\n });\n }\n\n /**\n * function to return the reporterURL associated with the dataobject URL. no promise returned\n * @param {String} dataObjectURL dataObjectURL\n * @return {String} reporterURL reporterURL\n */\n\n }, {\n key: 'getReporterURLSynchonous',\n value: function getReporterURLSynchonous(dataObjectURL) {\n var _this = this;\n\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n return dataObject ? dataObject.reporter : undefined;\n }\n\n /**\n * returns the hyperty URL that subscribed the dataObject\n * @param {String} url url format\n * @return {String} Hyperty URL subscribed to the URL\n */\n\n }, {\n key: 'getDataObjectSubscriberHyperty',\n value: function getDataObjectSubscriberHyperty(url) {\n var _this = this;\n\n return _this.subscribedDataObjectList[url];\n }\n\n /**\n * register a desired dataObject to subscribe\n * @param {String} dataObjectURL dataObject URL\n */\n\n }, {\n key: 'registerSubscribedDataObject',\n value: function registerSubscribedDataObject(dataObjectURL, hypertyURL) {\n var _this = this;\n if (_this.subscribedDataObjectList[dataObjectURL] === undefined) {\n _this.subscribedDataObjectList[dataObjectURL] = hypertyURL;\n }\n }\n\n /**\n * Function to return the list of pre authorised users received in the creation of a data object\n * @param {String} dataObjectURL dataObjectURL\n * @return {Array} preAuth List of pre authorised users\n */\n\n }, {\n key: 'getPreAuthSubscribers',\n value: function getPreAuthSubscribers(dataObjectURL) {\n var _this = this;\n var dataObject = _this.dataObjectList[dataObjectURL];\n var preAuth = [];\n\n if (dataObject) {\n preAuth = dataObject.authorise;\n }\n return preAuth;\n }\n\n /**\n * send requests to unregister all hyperties registered in domain registry\n * @return {Promise} return a promise if the result of unregistration all hyperties\n */\n\n }, {\n key: 'unregisterAllHyperties',\n value: function unregisterAllHyperties() {\n var _this = this;\n\n var unregisterResults = [];\n\n return new _promise2.default(function (resolve, reject) {\n\n for (var index in _this.hypertiesList) {\n var hyperty = _this.hypertiesList[index];\n var result = _this.unregisterHypertyInstance(hyperty.hypertyURL);\n unregisterResults.push(result);\n }\n\n _promise2.default.all(unregisterResults).then(function () {\n\n resolve('successfully unregistered all hyperties');\n }, function (error) {\n reject(error);\n });\n });\n }\n\n /**\n * function to unregister an hypertyInstance in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n }, {\n key: 'unregisterHypertyInstance',\n value: function unregisterHypertyInstance(hypertyInstance) {\n //TODO working but the user\n var _this = this;\n\n var closeMsg = { type: 'execute', from: _this.registryURL,\n to: hypertyInstance,\n body: { method: 'close' } };\n\n // Send message to hyperty to close\n _this._messageBus.postMessage(closeMsg, function (reply) {\n log.log('[Registry.unregisterHypertyInstance] Close Reply', reply);\n\n _this._domainRegistration.unregisterHyperty(hypertyInstance);\n });\n }\n\n /**\n * function to unregister a Data Object in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n }, {\n key: 'unregisterDataObject',\n value: function unregisterDataObject(url) {\n this._domainRegistration.unregisterDataObject(url);\n }\n\n /**\n * register a new subscriber in the dataObject registered\n * @param {String} dataObjectURL dataObject URL\n * @param {String} subscriberURL subscriber URL\n */\n\n }, {\n key: 'registerSubscriber',\n value: function registerSubscriber(dataObjectURL, subscriberURL) {\n var _this = this;\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n if (dataObject) {\n\n if (!dataObject.subscribers) dataObject.subscribers = [];\n\n dataObject.subscribers.push(subscriberURL);\n _this.dataObjectList[dataObjectURL] = dataObject;\n }\n }\n\n /**\n * get the subscribers registered within a dataObject\n * @param {String} dataObjectURL dataObject URL\n * @param {Array} Substribers List\n */\n\n }, {\n key: 'getDataObjectSubscribers',\n value: function getDataObjectSubscribers(dataObjectURL) {\n var _this = this;\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n if (dataObject) {\n return dataObject.subscribers;\n } else {\n throw 'No dataObject was found';\n }\n }\n\n /**\n * To register a new Data Object in the runtime which returns the dataObjectURL allocated to the new Data Object.\n * @param {String} identifier identifier\n * @param {String} dataObjectschema dataObjectschema\n * @param {String} dataObjectUrl dataObjectUrl\n * @param {String} dataObjectReporter dataObjectReporter\n * @param {Array} resources dataObject resources\n * @param {Array} authorise list of pre authorised authorised IDs\n */\n //registerDataObject(identifier, dataObjectschema, dataObjectUrl, dataObjectReporter, resources, addressURL, authorise) {\n\n }, {\n key: 'registerDataObject',\n value: function registerDataObject(objectRegistration) {\n var _this = this;\n\n var registration = (0, _utils.deepClone)(objectRegistration);\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.dataObjectList[objectRegistration.url] = objectRegistration;\n\n _this.storageManager.get('registry:DataObjectURLs').then(function (urlsList) {\n\n if (!urlsList) {\n urlsList = {};\n }\n\n //update the list with the new elements\n urlsList[objectRegistration.name + objectRegistration.schema + objectRegistration.resources + objectRegistration.reporter] = objectRegistration.url;\n\n // step to obtain the list of all URL registered to updated with the new one.\n _this.storageManager.set('registry:DataObjectURLs', 0, urlsList).then(function () {\n\n if (_this.isInterworkingProtoStub(registration.reporter)) {\n registration.interworking = true;\n }\n\n var domainRegistration = true;\n\n if (registration.hasOwnProperty(\"domain_registration\")) domainRegistration = registration.domain_registration;\n\n if (domainRegistration) _this._domainRegistration.registerDataObject(registration, objectRegistration.resume, _this.p2pHandlerStub).then(function (registered) {\n resolve(registered);\n });else resolve(registration);\n }).catch(function (reason) {\n log.error('[Registry registerDataObject] Error: ', reason);\n reject(reason);\n });\n });\n });\n }\n }, {\n key: '_getResourcesAndSchemes',\n value: function _getResourcesAndSchemes(descriptor) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var resources = void 0;\n\n // check if the hyperty resources is a vector or a string\n // TODO delete later when catalogue is fixed\n if (typeof descriptor.hypertyType === 'string') {\n resources = [];\n resources.push(descriptor.hypertyType);\n } else {\n resources = descriptor.hypertyType;\n }\n\n var objName = descriptor.objectName;\n\n var descriptorDataSchema = descriptor.dataObjects;\n var dataSchemasArray = [];\n\n //this will create a array with a Promise in each position\n for (var index in descriptorDataSchema) {\n dataSchemasArray.push(_this.runtimeCatalogue.getDataSchemaDescriptor(descriptorDataSchema[index]));\n }\n\n // as soon as the previous array is completed, this will wait for the resolve of all promises in the array\n _promise2.default.all(dataSchemasArray).then(function (dataSchemas) {\n\n var filteredDataSchemas = [];\n for (var _index in dataSchemas) {\n var dataSchema = dataSchemas[_index];\n filteredDataSchemas.push(dataSchema.sourcePackage.sourceCode.properties.scheme.constant);\n }\n\n // log.log('[Registry] Hyperty Schemas', filteredDataSchemas);\n // log.log('[Registry] Hyperty resources', resources);\n\n resolve({ resources: resources, dataSchema: filteredDataSchemas, name: objName });\n });\n });\n }\n\n /**\n * method that returns previously registered Hyperty or DataObjects URLS, for given characteristics\n * @param {JSON} info object or hyperty charateristics info\n * @return {addressURL} addressURL return the URL if there is any previousy registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkRegisteredURLs',\n value: function checkRegisteredURLs(info, reuseURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var objectType = info.reporter ? 'registry:DataObjectURLs' : 'registry:HypertyURLs';\n\n if (typeof reuseURL === 'string') {\n objectType = reuseURL && (0, _utils.divideURL)(reuseURL).type !== 'hyperty' ? 'registry:DataObjectURLs' : 'registry:HypertyURLs';\n }\n //debugger;\n _this.storageManager.get(objectType).then(function (urlsList) {\n\n if (!urlsList) {\n urlsList = {};\n }\n\n if (typeof reuseURL === 'string') {\n log.info('[Registry - checkRegisteredURLs] - look for ' + reuseURL + ' on ', urlsList);\n\n var searchResult = (0, _keys2.default)(urlsList).map(function (key) {\n var indexOf = urlsList[key].indexOf(reuseURL);\n return urlsList[key][indexOf];\n });\n\n log.info('[Registry - checkRegisteredURLs] - found ' + searchResult.length + ' results on ', searchResult);\n if (searchResult.length === 1) {\n return resolve(searchResult);\n } else {\n return resolve(undefined);\n }\n }\n\n if (objectType === 'registry:HypertyURLs') {\n _this._getResourcesAndSchemes(info).then(function (value) {\n if (urlsList[value.resources + value.dataSchema + value.name]) {\n // log.log('[Registry] reusage of hyperty URL');\n return resolve(urlsList[value.resources + value.dataSchema + value.name]);\n } else {\n // log.log('[Registry] no hyperty URL was previously registered ');\n return resolve(undefined);\n }\n });\n } else {\n\n var characteristics = info.name + info.schema + info.resources + info.reporter;\n\n if (urlsList[characteristics]) {\n // log.log('[Registry] reusage of dataObject URL');\n if (typeof urlsList[characteristics] === 'string') {\n var arrayToResolve = [];\n arrayToResolve.push(urlsList[characteristics]);\n return resolve(arrayToResolve);\n } else {\n return resolve(urlsList[characteristics]);\n }\n } else {\n // log.log('[Registry] no dataObject URL was previously registered');\n return resolve(undefined);\n }\n }\n });\n });\n }\n\n /**\n * To register a new Hyperty in the runtime which returns the HypertyURL allocated to the new Hyperty.\n * @param {Sandbox} sandbox sandbox\n * @param {HypertyCatalogueURL} HypertyCatalogueURL descriptor\n * @param {object} IdpConstraint - constraints to be used when selecting the identity to be associated with the Hyperty including origin, idp, and idHint.\n * @return {HypertyURL} HypertyURL\n */\n\n }, {\n key: 'registerHyperty',\n value: function registerHyperty(sandbox, descriptorURL, descriptor, addressURL, IdpConstraint) {\n var _this = this;\n\n var hypertyCapabilities = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.idModule.getIdentityAssertion(IdpConstraint).then(function (result) {\n\n var userProfile = result.userProfile;\n\n // log.log('[Registry registerHyperty] userProfile', userProfile);\n\n if (_this._messageBus === undefined) {\n reject('[Registry registerHyperty] MessageBus is undefined');\n } else {\n //call check if the protostub exist: to be removed\n /* _this.resolve(domainUrl).then(function(a) {\n // log.log('[Registry registerHyperty] stub to domain registry- ', a);*/\n\n _this.storageManager.get('registry:HypertyURLs').then(function (urlsList) {\n\n // log.log('[Registry registerHyperty] storageManager] - ', urlsList);\n\n _this._getResourcesAndSchemes(descriptor).then(function (value) {\n\n hypertyCapabilities = value;\n\n if (!urlsList) {\n urlsList = {};\n }\n\n urlsList[hypertyCapabilities.resources + hypertyCapabilities.dataSchema + hypertyCapabilities.name] = addressURL.address;\n _this.storageManager.set('registry:HypertyURLs', 0, urlsList).then(function () {\n\n //check whether the received sanbox e ApplicationSandbox or a normal sandbox\n if (sandbox.type === 'app') {\n _this.sandboxesList.appSandbox[addressURL.address[0]] = sandbox;\n } else if (sandbox.type === 'normal') {\n _this.sandboxesList.sandbox[addressURL.address[0]] = sandbox;\n } else {\n reject('Wrong SandboxType');\n }\n\n var p2pHandler = void 0;\n var p2pRequester = void 0;\n\n if ((0, _keys2.default)(_this.p2pHandlerStub).length !== 0) {\n p2pHandler = _this.p2pHandlerStub[_this.runtimeURL].url;\n p2pRequester = _runtimeUtils.runtimeUtils.runtimeDescriptor.p2pRequesterStub;\n }\n\n var hyperty = new _HypertyInstance2.default(_this.identifier, _this.registryURL, descriptorURL, descriptor, addressURL.address[0], userProfile, 'guid', _this.runtimeURL, 'ctx', p2pHandler, p2pRequester, hypertyCapabilities.dataSchema, hypertyCapabilities.resources);\n\n _this.hypertiesList.push(hyperty);\n\n /*--- start here move p2p and domain registry related features to a separated function.-------..*/\n\n var registrationAtdomain = true;\n\n if (descriptor.hasOwnProperty(\"_configuration\") && descriptor.configuration.hasOwnProperty(\"domain_registration\")) {\n registrationAtdomain = descriptor.configuration.domain_registration;\n }\n\n if (registrationAtdomain) _this._domainRegistration.registerHyperty(hyperty, addressURL.newAddress).then(function (registered) {\n resolve(registered);\n });else resolve({ url: hyperty.hypertyURL });\n\n /*------------------- END HERE MOVE DOMAIN REGISTRY ------------------*/\n }).catch(function (reason) {\n // log.log('[Registry registerHyperty] Error: ', reason);\n reject(reason);\n });\n });\n });\n }\n }, function (err) {\n reject('[Registry registerHyperty] ', err);\n });\n });\n }\n\n /**\n * To unregister a previously registered Hyperty\n * @param {HypertyURL} HypertyURL url url\n */\n\n }, {\n key: 'unregisterHyperty',\n value: function unregisterHyperty(url) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var found = false;\n var index = 0;\n\n for (index = 0; index < _this.hypertiesList.length; index++) {\n var hyperty = _this.hypertiesList[index];\n if (hyperty !== undefined) {\n if (hyperty.hypertyURL === url) {\n found = true;\n break;\n }\n }\n }\n\n if (found === false) {\n reject('Hyperty not found');\n } else {\n delete _this.hypertiesList[index];\n resolve('Hyperty successfully deleted');\n }\n });\n }\n\n /**\n * To discover protocol stubs available in the runtime for a certain domain. If available, it returns the runtime url for the protocol stub that connects to the requested domain. Required by the runtime BUS to route messages to remote servers or peers (do we need something similar for Hyperties?).\n * @param {DomainURL} DomainURL url\n * @return {RuntimeURL} RuntimeURL\n */\n\n }, {\n key: 'discoverProtostub',\n value: function discoverProtostub(url) {\n if (!url) throw new Error('Parameter url needed');\n var _this = this;\n\n var dividedURL = (0, _utils.divideURL)(url);\n var domainURL = dividedURL.domain;\n\n if (_this.protostubsList.hasOwnProperty(domainURL) && _this.protostubsList[domainURL].status === STATUS.LIVE) {\n return _this.protostubsList[domainURL];\n } else {\n\n _this.protostubsList[domainURL] = {\n status: STATUS.DEPLOYING\n };\n\n throw new Error('[Registry - discoverProtoStub ] Message Node Protostub Not Found. Creating one');\n }\n }\n\n /**\n * To discover protocol stubs available in the runtime for a certain remote runtime URL. If available, it returns the runtime url for the protocol stub that connects to the requested domain.\n * Required by the runtime BUS to route messages to remote servers or peers (do we need something similar for Hyperties?).\n * @param {RuntimeURL} RuntimeURL url\n * @return {p2pRequester} RuntimeURL\n */\n\n }, {\n key: 'discoverP2PStub',\n value: function discoverP2PStub(runtimeURL) {\n var _this = this;\n\n if (runtimeURL) {\n\n if (_this.p2pRequesterStub.hasOwnProperty(runtimeURL) && _this.p2pRequesterStub[runtimeURL].status === STATUS.LIVE) {\n return _this.p2pRequesterStub[runtimeURL];\n } else {\n _this.p2pRequesterStub[runtimeURL] = {\n status: STATUS.CREATED\n };\n\n throw new Error('[Registry - discoverP2PStub ] P2P Requester Stub Not Found. Creating one');\n }\n } else {\n\n if (_this.p2pHandlerStub.hasOwnProperty(_this.runtimeURL)) {\n return _this.p2pHandlerStub[_this.runtimeURL];\n } else {\n _this.p2pHandlerStub[_this.runtimeURL] = {\n status: STATUS.CREATED\n };\n\n throw new Error('[Registry - discoverP2PStub ] P2P Handler Stub Not Found.');\n }\n }\n }\n\n /**\n * To register a new Protocol Stub in the runtime including as input parameters the function to postMessage, the DomainURL that is connected with the stub, which returns the RuntimeURL allocated to the new ProtocolStub.\n * @param {Sandbox} Sandbox\n * @param {stubID} Domain or hyperty runtime to register the stub\n * @param {descriptorURL} Catalogue URL of the Protostub descriptor\n * @param {descriptor} Protostub descriptor\n * @return {RuntimeProtoStubURL}\n */\n\n }, {\n key: 'registerStub',\n value: function registerStub(sandbox, stubID, p2pConfig, descriptorURL, descriptor) {\n var _this = this;\n\n var _stubDescriptor = descriptor;\n\n return new _promise2.default(function (resolve, reject) {\n\n var runtimeProtoStubURL = void 0;\n\n //check if messageBus is registered in registry or not\n if (_this._messageBus === undefined) {\n reject('MessageBus not found on registerStub');\n }\n\n log.info('[Registry - registerStub] - stubID ', stubID);\n\n /* if (!stubID.indexOf('msg-node.')) {\n stubID = stubID.substring(stubID.indexOf('.') + 1);\n }*/\n\n var P2PRequesterStub = void 0;\n\n if (p2pConfig) {\n\n if (p2pConfig.hasOwnProperty('isHandlerStub') && p2pConfig.isHandlerStub) {\n runtimeProtoStubURL = _this.p2pHandlerURL;\n\n _this.p2pHandlerStub[stubID] = {\n url: runtimeProtoStubURL,\n status: STATUS.CREATED\n };\n\n _this.p2pHandlerAssociation[_this.runtimeURL] = [];\n\n _this.sandboxesList.sandbox[runtimeProtoStubURL] = sandbox;\n log.info('[Registry - registerStub - P2PHandlerStub] - ', stubID, ' - ', runtimeProtoStubURL);\n resolve(_this.p2pHandlerStub[stubID]);\n } else {\n P2PRequesterStub = p2pConfig.p2pRequesterStub;\n runtimeProtoStubURL = 'runtime://' + (0, _utils.divideURL)(p2pConfig.remoteRuntimeURL).domain + '/p2prequester/' + (0, _utils.generateGUID)();\n log.info('[Registry - registerStub - P2PRequesterStub] - ', P2PRequesterStub, ' - ', runtimeProtoStubURL);\n\n // to be clarified what is this p2pHandlerAssociation\n _this.p2pHandlerAssociation[_this.runtimeURL].push(runtimeProtoStubURL);\n _this.p2pRequesterStub[stubID] = {\n url: runtimeProtoStubURL,\n status: STATUS.CREATED\n };\n\n _this.sandboxesList.sandbox[runtimeProtoStubURL] = sandbox;\n\n //Setup P2P Requester path into MN\n\n var msg = {\n type: 'subscribe',\n from: _this.registryURL,\n to: 'domain://msg-node.' + _this._domain + '/sm',\n body: {\n subscribe: [runtimeProtoStubURL],\n source: _this.registryURL\n }\n };\n\n _this._messageBus.postMessage(msg, function (reply) {\n // log.log('[Registry - register Stub] p2pRequester path setup: ', reply);\n });\n\n resolve(_this.p2pRequesterStub[stubID]);\n }\n } else {\n console.log('[Registry - registerStub - Normal Stub] descriptor', descriptor);\n\n if (!(typeof descriptor === 'undefined' ? 'undefined' : (0, _typeof3.default)(descriptor)) === 'string' && descriptor.hasOwnProperty('_interworking') && descriptor._interworking) {\n runtimeProtoStubURL = 'runtime://' + stubID + '/protostub/' + 'scheme1';\n } else {\n runtimeProtoStubURL = 'runtime://' + stubID + '/protostub/' + (0, _utils.generateGUID)();\n }\n\n log.info('[Registry - registerStub - Normal Stub] - ', stubID);\n\n // TODO: Optimize this\n _this.protostubsList[stubID] = {\n url: runtimeProtoStubURL,\n status: STATUS.DEPLOYING\n };\n\n if (descriptorURL) {\n _this.protostubsList[stubID].descriptorURL = descriptorURL;\n }\n\n if (_stubDescriptor && _stubDescriptor.interworking) {\n _this.protostubsList[stubID].interworking = _stubDescriptor.interworking;\n }\n\n _this.sandboxesList.sandbox[runtimeProtoStubURL] = sandbox;\n\n resolve(_this.protostubsList[stubID]);\n }\n\n // resolve(runtimeProtoStubURL);\n\n _this._messageBus.addListener(runtimeProtoStubURL + '/status', function (msg) {\n _this._onProtostubStatusEvent(msg);\n });\n });\n }\n\n /**\n * To Process status events fired by protostubs\n * @param {Message} message Event Message\n */\n\n }, {\n key: '_onProtostubStatusEvent',\n value: function _onProtostubStatusEvent(msg) {\n\n var _this = this;\n\n // log.log('[Registry onProtostubStatusEvent]: ', msg);\n\n var runtimeProtoStubURL = msg.from;\n\n if (!msg.to.includes('/status')) {\n log.error('[Registry onProtostubStatusEvent] Not Status Event: ', msg);\n return;\n } else {\n // broadcast Protostub status event to all Hyperties\n var from = msg.from;\n msg.from = _this.runtimeURL;\n msg.to = _this.runtimeURL + '/status';\n msg.body.resource = from;\n _this._messageBus.postMessage(msg);\n }\n\n // process status events from message node protostubs\n\n if (runtimeProtoStubURL.includes('/protostub/')) {\n\n // TODO: uncomment below when protostubs are updated with new status value \"live\"\n (0, _keys2.default)(_this.protostubsList).filter(function (key) {\n return _this.protostubsList[key].url === runtimeProtoStubURL;\n }).map(function (key) {\n _this.protostubsList[key].status = msg.body.value;\n\n // log.log('[Registry - onProtostubStatusEvent] - Protostub status: ', _this.protostubsList[key]);\n });\n } else {\n // process status events from p2p connections\n\n if (msg.body.resource) {\n var remoteRuntimeURL = msg.body.resource;\n\n if (_this.p2pConnectionList[remoteRuntimeURL]) {\n _this.p2pConnectionList[remoteRuntimeURL].status = msg.body.value;\n _this.p2pConnectionList[remoteRuntimeURL].url = runtimeProtoStubURL;\n } else {\n\n var p2pConnection = {\n status: msg.body.value,\n url: runtimeProtoStubURL\n };\n\n _this.p2pConnectionList[remoteRuntimeURL] = p2pConnection;\n }\n\n // log.log('[Registry - onProtostubStatusEvent] - P2PConnection status: ', _this.p2pConnectionList[remoteRuntimeURL]);\n\n // Update P2P Requester protostub if it is coming from there\n if (runtimeProtoStubURL.includes('/p2prequester/')) {\n _this.p2pRequesterStub[remoteRuntimeURL].status = msg.body.value;\n\n // log.log('[Registry - onProtostubStatusEvent] - P2P Requester status: ', _this.p2pRequesterStub[remoteRuntimeURL]);\n } else {\n // if from P2PHandler with status disconencted, lets remove from p2pConnectionList\n if (msg.body.value === 'disconnected') delete _this.p2pConnectionList[remoteRuntimeURL];\n }\n } else {\n if (runtimeProtoStubURL.includes('/p2prequester/')) {\n // It is an event from P2P Requester without mandatory \"resource\" field\n log.error('[Registry onProtostubStatusEvent] resource missing: ', msg);\n return;\n } else {\n // It is an event from P2P Handler\n _this.p2pHandlerStub[_this.runtimeURL].status = msg.body.value;\n\n // log.log('[Registry - onProtostubStatusEvent] - P2PHandler Stub status: ', _this.p2pHandlerStub[_this.runtimeURL]);\n }\n }\n }\n }\n\n /**\n * To unregister a previously registered protocol stub\n * @param {HypertyRuntimeURL} HypertyRuntimeURL hypertyRuntimeURL\n */\n\n }, {\n key: 'unregisterStub',\n value: function unregisterStub(hypertyRuntimeURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.protostubsList.hasOwnProperty(hypertyRuntimeURL)) {\n delete _this.protostubsList[hypertyRuntimeURL];\n resolve('ProtostubURL removed');\n } else {\n reject('Error on unregisterStub: Hyperty not found');\n }\n });\n }\n\n /**\n * To register a new Identity Provider proxy in the runtime including as input parameters the function to postMessage, the DomainURL that is connected with the stub, which returns the RuntimeURL allocated to the new ProtocolStub.\n * @param {Sandbox} Sandbox\n * @param {DomainURL} DomainURL service provider domain\n * @return {RuntimeIdpProxyURL}\n */\n\n }, {\n key: 'registerIdpProxy',\n value: function registerIdpProxy(sandbox, domainURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var idpProxyStubURL = void 0;\n\n //check if messageBus is registered in registry or not\n if (_this._messageBus === undefined) {\n reject('MessageBus not found on registerStub');\n }\n\n idpProxyStubURL = 'domain-idp://' + domainURL + '/stub/' + (0, _utils.generateGUID)();\n\n // TODO: Optimize this\n _this.idpProxyList[domainURL] = {\n url: idpProxyStubURL,\n status: STATUS.DEPLOYING\n };\n\n _this.sandboxesList.sandbox[idpProxyStubURL] = sandbox;\n\n // sandbox.addListener('*', function(msg) {\n // _this._messageBus.postMessage(msg);\n // });\n\n resolve(idpProxyStubURL);\n\n _this._messageBus.addListener(idpProxyStubURL + '/status', function (msg) {\n _this._onIdpProxyStatusEvent(msg);\n });\n });\n }\n\n /**\n * To Process status events fired by Idp Proxies\n * @param {Message} message Event Message\n */\n\n }, {\n key: '_onIdpProxyStatusEvent',\n value: function _onIdpProxyStatusEvent(msg) {\n\n var _this = this;\n\n // log.log('[Registry onIdpProxyStatusEvent]: ', msg);\n\n var idpProxyURL = msg.from;\n\n if (!msg.to.includes('/status')) {\n log.error('[Registry onIdpProxyStatusEvent] Not Status Event: ', msg);\n return;\n }\n\n (0, _keys2.default)(_this.idpProxyList).filter(function (key) {\n return _this.idpProxyList[key].url === idpProxyURL;\n }).map(function (key) {\n _this.idpProxyList[key].status = msg.body.value;\n\n // log.log('[Registry - onIdpProxyStatusEvent] - Idp Proxy status: ', _this.idpProxyList[key]);\n });\n }\n\n /**\n * To discover idpProxy stubs available in the runtime for a certain domain. If available, it returns the runtime url for the idpProxy stub that connects to the requested domain. Required by the runtime BUS to route messages to remote servers or peers\n * @param {DomainURL} DomainURL url\n * @return {RuntimeURL} RuntimeURL idpProxyUrl\n */\n\n }, {\n key: 'discoverIdpProxy',\n value: function discoverIdpProxy(url) {\n if (!url) throw new Error('Parameter url needed');\n var _this = this;\n\n var dividedURL = (0, _utils.divideURL)(url);\n var domainURL = dividedURL.domain;\n\n if (_this.idpProxyList.hasOwnProperty(domainURL) && _this.idpProxyList[domainURL].status === STATUS.LIVE) {\n return _this.idpProxyList[domainURL];\n } else {\n\n _this.idpProxyList[domainURL] = {\n status: STATUS.PROGRESS\n };\n\n throw new Error('[Registry - discoverIdpProxy ] Idp Proxy Not Found. Creating one');\n }\n }\n\n /**\n * To register a new Policy Enforcer in the runtime including as input parameters the function to postMessage, the HypertyURL associated with the PEP, which returns the RuntimeURL allocated to the new Policy Enforcer component.\n * @param {Message.Message} postMessage postMessage\n * @param {HypertyURL} HypertyURL hyperty\n * @return {HypertyRuntimeURL} HypertyRuntimeURL\n */\n\n }, {\n key: 'registerPEP',\n value: function registerPEP(postMessage, hyperty) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n //TODO check what parameter in the postMessage the pep is.\n _this.pepList[hyperty] = postMessage;\n resolve('PEP registered with success');\n });\n }\n\n /**\n * To unregister a previously registered protocol stub\n * @param {HypertyRuntimeURL} HypertyRuntimeURL HypertyRuntimeURL\n */\n\n }, {\n key: 'unregisterPEP',\n value: function unregisterPEP(HypertyRuntimeURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var result = _this.pepList[HypertyRuntimeURL];\n\n if (result === undefined) {\n reject('Pep Not found.');\n } else {\n resolve('PEP successfully removed.');\n }\n });\n }\n\n /**\n * To discover sandboxes available in the runtime for a certain domain and a certain set of capabilities. Required by the runtime UA to avoid more than one sandbox for the same domain.\n * @param {DomainURL} DomainURL url\n * @return {RuntimeSandbox} RuntimeSandbox\n */\n\n }, {\n key: 'getSandbox',\n value: function getSandbox(url, constraints) {\n if (!url) throw new Error('Parameter url needed');\n\n // log.log('[Registry getSandbox] getSandbox for: ', url, ' and capabilities: ', constraints);\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n var request = void 0;\n\n //first try to find the url in the appSandbox list\n request = _this.sandboxesList.appSandbox[url];\n\n //if no appSandbox was found, try to search in the normal sandboxes list\n if (!request) {\n request = _this.sandboxesList.sandbox[url];\n\n if (!request) {\n\n var domain = void 0;\n\n if (url.includes('://')) {\n domain = (0, _utils.divideURL)(url).domain;\n } else {\n domain = url;\n }\n\n // search in the sandboxes list for a entry containing the domain given\n for (var sandbox in _this.sandboxesList.sandbox) {\n //todo: uncomment sandbox constraints match condition with runtime sharing\n if (sandbox.includes(domain) && _this.sandboxesList.sandbox[sandbox].matches(constraints)) {\n var _ret = function () {\n var current = _this.sandboxesList.sandbox[sandbox];\n var match = (0, _keys2.default)(constraints).filter(function (constraint) {\n return constraint === 'browser' && current.type === _Sandbox.SandboxType.NORMAL || constraint === 'windowSanbox' && current.type === _Sandbox.SandboxType.WINDOW;\n }).length > 0 ? true : false;\n\n if (match) {\n request = current;\n }\n return 'break';\n }();\n\n if (_ret === 'break') break;\n }\n }\n }\n }\n\n if (!request) {\n reject('no sandbox found for: ' + url);\n } else {\n resolve(request);\n }\n });\n }\n }, {\n key: 'resolveNormalStub',\n value: function resolveNormalStub(url) {\n // log.log('resolveNormalStub ' + url);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //split the url to find the domainURL. deals with the url for example as:\n //\"hyperty-runtime://sp1/protostub/123\",\n var dividedURL = (0, _utils.divideURL)(url);\n var domainUrl = dividedURL.domain;\n var type = dividedURL.type;\n\n if (url.includes(_this.runtimeURL)) {\n log.error('[Registry - resolve] URL to be resolved should have listeners ', url);\n reject('[Registry - resolve] URL to be resolved should have listeners ', url);\n }\n\n // resolve the domain protostub in case of a message to global registry\n if (url.includes('global://registry')) {\n domainUrl = _this._domain;\n } else {\n if (!domainUrl.indexOf('msg-node.') || !domainUrl.indexOf('registry.')) {\n domainUrl = domainUrl.substring(domainUrl.indexOf('.') + 1);\n }\n }\n\n _this.isLegacy(url).then(function (isLegacy) {\n\n // if legacy it should resolve for .\n if (isLegacy && type !== 'domain-idp') {\n domainUrl = type + '.' + (0, _utils.getUserIdentityDomain)(url);\n }\n\n log.info('[Registry.resolve] domainUrl:', domainUrl);\n\n var registredComponent = void 0;\n\n if (type === 'domain-idp') {\n registredComponent = _this.idpProxyList.hasOwnProperty(domainUrl) ? _this.idpProxyList[domainUrl] : false;\n } else {\n registredComponent = _this.protostubsList.hasOwnProperty(domainUrl) ? _this.protostubsList[domainUrl] : false;\n }\n\n log.info('[Registry.resolve] registred:', registredComponent);\n\n // TODO since the protostubs have other states this should be revised, because the status could change from DEPLOYED to LIVE\n // TODO and this validation will trigger a new load of IDPProxy or Protostub;\n if (registredComponent && registredComponent.hasOwnProperty('status') && (registredComponent.status === STATUS.DEPLOYED || registredComponent.status === STATUS.CREATED || registredComponent.status === STATUS.LIVE || registredComponent.status === STATUS.DISCONNECTED)) {\n log.info('[Registry.resolve] Resolved: ', registredComponent.url, registredComponent.status);\n resolve(registredComponent.url);\n } else {\n //todo: use switch-case to support other types of stubs\n if (type === 'domain-idp') {\n\n // The IdP Proxy does not exist, let's prepare its deployment by watching its status\n\n _this.watchingYou.observe('idpProxyList', function (change) {\n\n // log.log('[Registry - resolveNormalStub] idpProxyList changed ' + _this.idpProxyList);\n\n var keypath = change.keypath;\n\n if (keypath.includes('status')) keypath = keypath.replace('.status', '');\n\n if (keypath === domainUrl && change.name === 'status' && change.newValue === STATUS.CREATED) {\n // log.log('[Registry - resolveNormalStub] idpProxyList is live ' + _this.idpProxyList[domainUrl]);\n resolve(_this.idpProxyList[domainUrl].url);\n }\n });\n\n if (!registredComponent) {\n // this process will load the idp proxy, because is not yet registered;\n log.info('[Registry.resolveNormalStub] deploy new IDPProxy: ', domainUrl);\n _this.loader.loadIdpProxy(domainUrl).then(function () {\n\n log.info('[Registry.resolveNormalStub] IdP Proxy deployed: ', _this.idpProxyList[domainUrl]);\n }).catch(function (reason) {\n log.error('[Registry.resolve] Error resolving Load IDPProxy: ', reason);\n _this.idpProxyList[domainUrl].status = 'deployment-failed';\n reject(reason);\n });\n }\n } else {\n\n // The protoStub does not exist, let's prepare its deployment by watching its status\n\n _this.watchingYou.observe('protostubsList', function (change) {\n\n // log.log('[Registry - resolveNormalStub] protostubsList changed ' + _this.protostubsList);\n\n var keypath = change.keypath;\n\n if (keypath.includes('status')) keypath = keypath.replace('.status', '');\n\n if (keypath === domainUrl && change.name === 'status' && change.newValue === STATUS.CREATED) {\n // log.log('[Registry - resolve] protostub is live ' + _this.protostubsList[domainUrl]);\n resolve(_this.protostubsList[domainUrl].url);\n }\n });\n\n if (!registredComponent) {\n // lets deploy the protostub\n log.info('[Registry.resolve] trigger new ProtocolStub: ', domainUrl);\n _this.loader.loadStub(domainUrl).then(function () {\n\n // log.log('[Registry - resolveNormalStub] Stub deployed: ', _this.protostubsList[domainUrl]);\n }).catch(function (reason) {\n log.error('[Registry.resolveNormalStub] Error resolving Load ProtocolStub: ', reason);\n reject(reason);\n });\n }\n }\n }\n }).catch(function (reason) {\n log.error('[Registry.resolve] Error resolving islegacy: ', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * To verify if source is valid and to resolve target runtime url address if needed (eg protostub runtime url in case the message is to be dispatched to a remote endpoint).\n * @param {URL.URL} url url\n * @return {Promise} Promise \n */\n\n }, {\n key: 'resolve',\n value: function resolve(msg) {\n log.info('[Registry - Resolve] - ', msg);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var url = msg.to ? msg.to : msg;\n\n var p2p = msg.body && msg.body.p2p ? msg.body.p2p : false;\n\n // log.log('P2P: ', p2p, url);\n // log.log('P2P - p2pHandlerStub: ', !_this.p2pHandlerStub[_this.runtimeURL], _this.p2pHandlerStub, _this.runtimeURL);\n // log.log('P2P - isBackendServiceURL: ', isBackendServiceURL(url), isBackendServiceURL, url);\n // log.log('P2P - includes runtimeURL: ', url.includes(_this.runtimeURL));\n // log.log('P2P - includes p2phandler: ', url.includes('/p2phandler/'));\n // log.log('P2P - includes p2prequester: ', url.includes('/p2prequester/'));\n\n // Skip p2p procedure when not supported by the Runtime or for backend services\n\n if (!_this.p2pHandlerStub[_this.runtimeURL] || (0, _utils.isBackendServiceURL)(url) || url.includes(_this.runtimeURL) || url.includes('/p2phandler/') || url.includes('/p2prequester/')) {\n\n log.info('[Registry - resolve] - Resolve normal stub: ', _this.p2pHandlerStub, _this.runtimeURL, (0, _utils.isBackendServiceURL)(url), p2p, url);\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n } else {\n\n log.info('[Registry - resolve] - checkP2P: ', p2p, url, _this._p2pConnectionResolve);\n _this._p2pConnectionResolve.checkP2P(msg).then(function (registeredP2P) {\n\n // log.log('[Registry - resolve] found registered P2P: ', registeredP2P);\n\n var p2pConnection = _this.p2pConnectionList[registeredP2P.runtime];\n\n if (!p2pConnection) {\n p2pConnection = registeredP2P;\n _this.p2pConnectionList[registeredP2P.runtime] = p2pConnection;\n }\n\n switch (p2pConnection.status) {\n case STATUS.LIVE:\n msg.body.peer = registeredP2P.runtime;\n resolve(p2pConnection.url, msg);\n break;\n case STATUS.CREATED: // p2p connection setup is ongoing, use MN Stub\n case STATUS.PROGRESS:\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n break;\n case STATUS.DISCONNECTED:\n // p2p connection stub was disconnected, let's ask to connect again\n log.info('[Registry - Resolve] - p2pConnection is disconnected lets try to reconnect');\n _this._p2pConnectionResolve.reconnectP2PRequester(p2pConnection).then(function (returnURL) {\n // log.log('[Registry - Resolve] - was reconnected with p2pRequesterStubt: ', returnURL);\n resolve(returnURL);\n }, function (reason) {\n log.info('[Registry - Resolve] - Reason: ', reason);\n\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n });\n break;\n default:\n\n log.info('[Registry - resolve] - P2P: ', p2p);\n if (!p2p) {\n // no p2p connection exists and the message sender does not ask one. Lets use the MN Stub\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n } else {\n _this._setupP2PRequester(registeredP2P).then(function (returnURL) {\n // no p2p connection exists but the message sender is asking one. Lets try to setup one\n resolve(returnURL);\n }, function (reason) {\n log.info('[Registry - Resolve] - Reason: ', reason);\n\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n });\n }\n break;\n }\n }, function (reason) {\n log.info('[Registry - Resolve] - Reason: ', reason);\n\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n });\n }\n });\n }\n }, {\n key: '_setupP2PRequester',\n value: function _setupP2PRequester(input) {\n var _this = this;\n\n log.log('[Registry._setupP2PConnection] loadStub with p2pRequester: ', input);\n\n return new _promise2.default(function (resolve, reject) {\n\n var remoteRuntime = input.runtime;\n\n var p2pConfig = { remoteRuntimeURL: remoteRuntime, p2pHandler: input.p2pHandler, p2pRequesterStub: true };\n\n // lets prepare the p2pRequesterSTub deployment by setting an observer to its status changes\n\n _this.watchingYou.observe('p2pRequesterStub', function (change) {\n\n log.log('[Registry._setupP2PConnection] p2pRequesterStubs changed ' + _this.p2pRequesterStub);\n\n if (change.keypath.split('.')[0] === remoteRuntime && change.name === 'status' && change.newValue === STATUS.LIVE) {\n log.log('[Registry._setupP2PConnection] p2pRequester is live ' + _this.p2pRequesterStub[remoteRuntime]);\n resolve(_this.p2pRequesterStub[remoteRuntime].url);\n }\n });\n\n // stub load\n _this.loader.loadStub(input.p2pRequester, p2pConfig).then(function () {\n\n log.log('[Registry._setupP2PConnection] p2pRequester deployed: ', _this.p2pRequesterStub[remoteRuntime]);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n\n /**\n * To verify if url is for a legacy service.\n * @param {URL.URL} url url\n * @return {boolean}\n */\n\n }, {\n key: 'isLegacy',\n value: function isLegacy(url) {\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (url === _this._domain) {\n return resolve(false);\n }\n\n log.log('[Registry] [Registry.Registry.isLegacy] ', url);\n\n // TODO: to be defined in the runtime configuration\n var nonLegacy = ['hyperty-runtime', 'domain', 'global', 'hyperty'];\n\n var urlDivided = (0, _utils.divideURL)(url);\n\n if (nonLegacy.indexOf(urlDivided.type) !== -1 || urlDivided.domain === _this._domain) {\n return resolve(false);\n }\n\n // process User URLs\n if (url.split('@').length > 1) {\n var domain = urlDivided.domain;\n\n // log.log('[Registry] [Registry.Registry.isLegacy] domain: ', domain);\n if (_this.idpLegacyProxyList.hasOwnProperty(domain)) {\n\n var result = _this.idpLegacyProxyList[domain];\n\n if (result.interworking) {\n return resolve(result.interworking);\n } else {\n return resolve(false);\n }\n }\n\n _this._loader.descriptors.getIdpProxyDescriptor(domain).then(function (result) {\n\n // log.log('[Registry] [Registry.Registry.isLegacy] Legacy stub descriptor: ', result);\n\n if (result.interworking) {\n _this.idpLegacyProxyList[domain] = result;\n resolve(result.interworking);\n } else {\n resolve(false);\n }\n }).catch(function (reason) {\n log.warn('problem loading idp proxy descriptor for domain:', domain, ' because ', reason);\n reject(reason);\n });\n } else {\n // process protostub URLs\n resolve(_this.isInterworkingProtoStub(url));\n }\n });\n }\n\n /**\n * To verify if URL is locally registered or not.\n * @param {URL.URL} url url\n * @return {boolean}\n */\n\n }, {\n key: 'isLocal',\n value: function isLocal(url) {\n\n var runtimeScheme = ['hyperty-runtime', 'runtime'];\n var hypertyScheme = ['hyperty'];\n var urlScheme = url.split('://')[0];\n\n // Process Runtime Core URLs.\n // Messages originated from protostubs should also not include the runtimeURL in its URL.\n\n if (runtimeScheme.indexOf(urlScheme) !== -1) {\n return url.includes(this.runtimeURL);\n }\n\n // Process Hyperty URLs\n // Todo: hypertiesList should be an object not an array\n\n if (hypertyScheme.indexOf(urlScheme) !== -1) {\n\n for (var index in this.hypertiesList) {\n var hyperty = this.hypertiesList[index];\n if (hyperty.hypertyURL === url) {\n return true;\n }\n }\n\n return false;\n }\n\n // Process Data Object URLs\n\n if (url.includes('/subscription')) {\n url = url.substring(0, url.indexOf('/subscription'));\n }\n\n var dataObject = this.dataObjectList[url];\n\n if (dataObject) {\n if (dataObject.interworking) {\n return !dataObject.interworking;\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * To verify if protostub is to interwork with a legacy domain.\n * @param {URL.URL} runtimeProtostubURL The runtime URL of the Protostub\n * @return {boolean}\n */\n\n }, {\n key: 'isInterworkingProtoStub',\n value: function isInterworkingProtoStub(runtimeProtostubURL) {\n\n var _this = this;\n\n if (typeof runtimeProtostubURL === 'boolean') {\n return false;\n }\n\n if (!runtimeProtostubURL.includes('/protostub/')) {\n return false;\n }\n\n var filtered = (0, _keys2.default)(_this.protostubsList).filter(function (key) {\n return _this.protostubsList[key].url === runtimeProtostubURL;\n }).map(function (key) {\n\n if (_this.protostubsList[key].hasOwnProperty('interworking')) {\n return _this.protostubsList[key].interworking;\n } else {\n return false;\n }\n })[0];\n\n return filtered;\n }\n }, {\n key: 'loader',\n set: function set(loader) {\n var _this = this;\n _this._loader = loader;\n },\n get: function get() {\n var _this = this;\n return _this._loader;\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n\n _this._messageBus.addListener(_this.registryURL, function (msg) {\n\n // log.log('[Registry listener] ', msg);\n\n var isHyperty = (0, _utils.isHypertyURL)(msg.from);\n var hasCriteria = msg.body.hasOwnProperty('criteria');\n var isURLResource = void 0;\n var isUserResource = void 0;\n var isHypertyResource = void 0;\n\n if (msg.body.hasOwnProperty('resource') && msg.body.resource !== '.') {\n isURLResource = (0, _utils.isURL)(msg.body.resource);\n isUserResource = (0, _utils.isUserURL)(msg.body.resource);\n isHypertyResource = (0, _utils.isHypertyURL)(msg.body.resource);\n }\n var isDelete = msg.type === 'delete';\n var hasName = void 0;\n var hasUser = void 0;\n\n if (msg.body.hasOwnProperty('value')) {\n hasName = msg.body.value.hasOwnProperty('name');\n hasUser = msg.body.value.hasOwnProperty('user');\n }\n\n if (msg.type === 'response') {\n log.error('[Register listener] skipping ', msg);\n return;\n }\n\n // msg sent by identity manager library\n var userUrl = _this._getIdentityAssociated(msg.body.resource, msg.body.criteria);\n\n var reply = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: { resource: userUrl } };\n reply.body.code = userUrl ? 200 : 404;\n\n _this._messageBus.postMessage(reply);\n });\n\n // Install AddressAllocation\n var addressAllocation = _AddressAllocation2.default.instance;\n _this.addressAllocation = addressAllocation;\n\n _this._domainRegistration = new _DomainRegistration2.default(_this.runtimeURL, _this.registryURL, _this._domain, messageBus);\n\n // log.log('[Registry - AddressAllocation] - ', addressAllocation);\n }\n }]);\n return Registry;\n}();\n\nexports.default = Registry;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9SZWdpc3RyeS5qcz82MTZlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktT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saWNhdGlvblNhbmRib3ggb3IgYSBub3JtYWwgc2FuZGJveFxuICAgICAgICAgICAgICAgIGlmIChzYW5kYm94LnR5cGUgPT09ICdhcHAnKSB7XG4gICAgICAgICAgICAgICAgICBfdGhpcy5zYW5kYm94ZXNMaXN0LmFwcFNhbmRib3hbYWRkcmVzc1VSTC5hZGRyZXNzWzBdXSA9IHNhbmRib3g7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzYW5kYm94LnR5cGUgPT09ICdub3JtYWwnKSB7XG4gICAgICAgICAgICAgICAgICBfdGhpcy5zYW5kYm94ZXNMaXN0LnNhbmRib3hbYWRkcmVzc1VSTC5hZGRyZXNzWzBdXSA9IHNhbmRib3g7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIHJlamVjdCgnV3JvbmcgU2FuZGJveFR5cGUnKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgcDJwSGFuZGxlcjtcbiAgICAgICAgICAgICAgICBsZXQgcDJwUmVxdWVzdGVyO1xuXG4gICAgICAgICAgICAgICAgaWYgKE9iamVjdC5rZXlzKF90aGlzLnAycEhhbmRsZXJTdHViKS5sZW5ndGggIT09IDApIHtcbiAgICAgICAgICAgICAgICAgIHAycEhhbmRsZXIgPSBfdGhpcy5wMnBIYW5kbGVyU3R1YltfdGhpcy5ydW50aW1lVVJMXS51cmw7XG4gICAgICAgICAgICAgICAgICBwMnBSZXF1ZXN0ZXIgPSBydW50aW1lVXRpbHMucnVudGltZURlc2NyaXB0b3IucDJwUmVxdWVzdGVyU3R1YjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBsZXQgaHlwZXJ0eSA9IG5ldyBIeXBlcnR5SW5zdGFuY2UoX3RoaXMuaWRlbnRpZmllciwgX3RoaXMucmVnaXN0cnlVUkwsIGRlc2NyaXB0b3JVUkwsIGRlc2NyaXB0b3IsXG4gICAgICAgICAgICAgICAg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ICAgIGxldCBkb21haW47XG5cbiAgICAgICAgICBpZiAodXJsLmluY2x1ZGVzKCc6Ly8nKSkge1xuICAgICAgICAgICAgZG9tYWluID0gZGl2aWRlVVJMKHVybCkuZG9tYWluO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkb21haW4gPSB1cmw7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gc2VhcmNoIGluIHRoZSBzYW5kYm94ZXMgbGlzdCBmb3IgYSBlbnRyeSBjb250YWluaW5nIHRoZSBkb21haW4gZ2l2ZW5cbiAgICAgICAgICBmb3IgKGxldCBzYW5kYm94IGluIF90aGlzLnNhbmRib3hlc0xpc3Quc2FuZGJveCkge1xuICAgICAgICAgICAgLy90b2RvOiB1bmNvbW1lbnQgc2FuZGJveCBjb25zdHJhaW50cyBtYXRjaCBjb25kaXRpb24gd2l0aCBydW50aW1lIHNoYXJpbmdcbiAgICAgICAgICAgIGlmIChzYW5kYm94LmluY2x1ZGVzKGRvbWFpbikgJiYgX3RoaXMuc2FuZGJveGVzTGlzdC5zYW5kYm94W3NhbmRib3hdLm1hdGNoZXMoY29uc3RyYWludHMpKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGN1cnJlbnQgPSBfdGhpcy5zYW5kYm94ZXNMaXN0LnNhbmRib3hbc2FuZGJveF07XG4gICAgICAgICAgICAgIGNvbnN0IG1hdGNoID0gT2JqZWN0LmtleXMoY29uc3RyYWludHMpLmZpbHRlcihjb25zdHJhaW50ID0+IHtcbiAgICAgICAgICAgICAgICByZXR1cm4gKGNvbnN0cmFpbnQgPT09ICdicm93c2VyJyAmJiBjdXJyZW50LnR5cGUgPT09IFNhbmRib3hUeXBlLk5PUk1BTCkgfHxcbiAgICAgICAgICAgICAgICAgICAgICAoY29uc3RyYWludCA9PT0gJ3dpbmRvd1NhbmJveCcgJiYgY3VycmVudC50eXBlID09PSBTYW5kYm94VHlwZS5XSU5ET1cpO1xuXG4gICAgICAgICAgICAgIH0pLmxlb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Vja1AyUChtc2cpLnRoZW4oKHJlZ2lzdGVyZWRQMlApID0+IHtcblxuICAgICAgICAgIC8vIGxvZy5sb2coJ1tSZWdpc3RyeSAtIHJlc29sdmVdIGZvdW5kIHJlZ2lzdGVyZWQgUDJQOiAnLCByZWdpc3RlcmVkUDJQKTtcblxuICAgICAgICAgIGxldCBwMnBDb25uZWN0aW9uID0gX3RoaXMucDJwQ29ubmVjdGlvbkxpc3RbcmVnaXN0ZXJlZFAyUC5ydW50aW1lXTtcblxuICAgICAgICAgIGlmICghcDJwQ29ubmVjdGlvbikge1xuICAgICAgICAgICAgcDJwQ29ubmVjdGlvbiA9IHJlZ2lzdGVyZWRQMlA7XG4gICAgICAgICAgICBfdGhpcy5wMnBDb25uZWN0aW9uTGlzdFtyZWdpc3RlcmVkUDJQLnJ1bnRpbWVdID0gcDJwQ29ubmVjdGlvbjtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICBzd2l0Y2ggKHAycENvbm5lY3Rpb24uc3RhdHVzKSB7XG4gICAgICAgICAgICBjYXNlIFNUQVRVUy5MSVZFOlxuICAgICAgICAgICAgICBtc2cuYm9keS5wZWVyID0gcmVnaXN0ZXJlZFAyUC5ydW50aW1lO1xuICAgICAgICAgICAgICByZXNvbHZlKHAycENvbm5lY3Rpb24udXJsLCBtc2cpO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgU1RBVFVTLkNSRUFURUQ6IC8vIHAycCBjb25uZWN0aW9uIHNldHVwIGlzIG9uZ29pbmcsIHVzZSBNTiBTdHViXG4gICAgICAgICAgICBjYXNlIFNUQVRVUy5QUk9HUkVTUzpcbiAgICAgICAgICAgICAgX3RoaXMucmVzb2x2ZU5vcm1hbFN0dWIodXJsKS50aGVuKChyZXR1cm5VUkwpID0+IHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHJldHVyblVSTCk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGNhc2UgU1RBVFVTLkRJU0NPTk5FQ1RFRDogLy8gcDJwIGNvbm5lY3Rpb24gc3R1YiB3YXMgZGlzY29ubmVjdGVkLCBsZXQncyBhc2sgdG8gY29ubmVjdCBhZ2FpblxuICAgICAgICAgICAgICBsb2cuaW5mbygnW1JlZ2lzdHJ5IC0gUmVzb2x2ZV0gLSBwMnBDb25uZWN0aW9uIGlzIGRpc2Nvbm5lY3RlZCBsZXRzIHRyeSB0byByZWNvbm5lY3QnKTtcbiAgICAgICAgICAgICAgX3RoaXMuX3AycENvbm5lY3Rpb25SZXNvbHZlLnJlY29ubmVjdFAyUFJlcXVlc3RlcihwMnBDb25uZWN0aW9uKS50aGVuKChyZXR1cm5VUkwpID0+IHtcbiAgICAgICAgICAgICAgICAvLyBsb2cubG9nKCdbUmVnaXN0cnkgLSBSZXNvbHZlXSAtIHdhcyByZWNvbm5lY3RlZCB3aXRoIHAycFJlcXVlc3RlclN0dWJ0OiAnLCByZXR1cm5VUkwpO1xuICAgICAgICAgICAgICAgIHJlc29sdmUocmV0dXJuVVJMKTtcbiAgICAgICAgICAgICAgfSwgKHJlYXNvbikgPT4ge1xuICAgICAgICAgICAgICAgIGxvZy5pbmZvKCdbUmVnaXN0cnkgLSBSZXNvbHZlXSAtIFJlYXNvbjogJywgcmVhc29uKTtcblxuICAgICAgICAgICAgICAgIF90aGlzLnJlc29sdmVOb3JtYWxTdHViKHVybCkudGhlbigocmV0dXJuVVJMKSA9PiB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKHJldHVyblVSTCk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIGRlZmF1bHQ6XG5cbiAgICAgICAgICAgICAgbG9nLmluZm8oJ1tSZWdpc3RyeSAtIHJlc29sdmVdIC0gUDJQOiAnLCBwMnApO1xuICAgICAgICAgICAgICBpZiAoIXAycCkgeyAvLyBubyBwMnAgY29ubmVjdGlvbiBleGlzdHMgYW5kIHRoZSBtZXNzYWdlIHNlbmRlciBkb2VzIG5vdCBhc2sgb25lLiBMZXRzIHVzZSB0aGUgTU4gU3R1YlxuICAgICAgICAgICAgICAgIF90aGlzLnJlc29sdmVOb3JtYWxTdHViKHVybCkudGhlbigocmV0dXJuVVJMKSA9PiB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKHJldHVyblVSTCk7XG4gICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBfdGhpcy5fc2V0dXBQMlBSZXF1ZXN0ZXIocmVnaXN0ZXJlZFAyUCkudGhlbigocmV0dXJuVVJMKSA9PiB7IC8vIG5vIHAycCBjb25uZWN0aW9uIGV4aXN0cyBidXQgdGhlIG1lc3NhZ2Ugc2VuZGVyIGlzIGFza2luZyBvbmUuIExldHMgdHJ5IHRvIHNldHVwIG9uZVxuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXR1cm5VUkwpO1xuICAgICAgICAgICAgICAgIH0sIChyZWFzb24pID0+IHtcbiAgICAgICAgICAgICAgICAgIGxvZy5pbmZvKCdbUmVnaXN0cnkgLSBSZXNvbHZlXSAtIFJlYXNvbjogJywgcmVhc29uKTtcblxuICAgICAgICAgICAgICAgICAgX3RoaXMucmVzb2x2ZU5vcm1hbFN0dWIodXJsKS50aGVuKChyZXR1cm5VUkwpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShyZXR1cm5VUkwpO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgfVxuICAgICAgICB9LCAocmVhc29uKSA9PiB7XG4gICAgICAgICAgbG9nLmluZm8oJ1tSZWdpc3RyeSAtIFJlc29sdmVdIC0gUmVhc29uOiAnLCByZWFzb24pO1xuXG4gICAgICAgICAgX3RoaXMuc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0E7QUFDQTtBQUNBOzs7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFoL0NBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBMDZDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///453\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(455), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9zeW1ib2wvaXRlcmF0b3IuanM/NjczOCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vc3ltYm9sL2l0ZXJhdG9yXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC9pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNDU0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///454\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(80);\n__webpack_require__(101);\nmodule.exports = __webpack_require__(146).f('iterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3IuanM/ZmU3ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5zdHJpbmcuaXRlcmF0b3InKTtcbnJlcXVpcmUoJy4uLy4uL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL193a3MtZXh0JykuZignaXRlcmF0b3InKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///455\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(457), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9zeW1ib2wuanM/ZTUwNSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vc3ltYm9sXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC5qc1xuLy8gbW9kdWxlIGlkID0gNDU2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///456\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(458);\n__webpack_require__(192);\n__webpack_require__(463);\n__webpack_require__(464);\nmodule.exports = __webpack_require__(11).Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaW5kZXguanM/MDcwNyJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5zeW1ib2wnKTtcbnJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC50by1zdHJpbmcnKTtcbnJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvcicpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpLlN5bWJvbDtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDQ1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///457\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(21);\nvar has = __webpack_require__(62);\nvar DESCRIPTORS = __webpack_require__(51);\nvar $export = __webpack_require__(26);\nvar redefine = __webpack_require__(194);\nvar META = __webpack_require__(459).KEY;\nvar $fails = __webpack_require__(70);\nvar shared = __webpack_require__(136);\nvar setToStringTag = __webpack_require__(100);\nvar uid = __webpack_require__(98);\nvar wks = __webpack_require__(22);\nvar wksExt = __webpack_require__(146);\nvar wksDefine = __webpack_require__(147);\nvar enumKeys = __webpack_require__(460);\nvar isArray = __webpack_require__(461);\nvar anObject = __webpack_require__(41);\nvar isObject = __webpack_require__(45);\nvar toIObject = __webpack_require__(50);\nvar toPrimitive = __webpack_require__(140);\nvar createDesc = __webpack_require__(79);\nvar _create = __webpack_require__(141);\nvar gOPNExt = __webpack_require__(462);\nvar $GOPD = __webpack_require__(148);\nvar $DP = __webpack_require__(44);\nvar $keys = __webpack_require__(68);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(205).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(81).f = $propertyIsEnumerable;\n __webpack_require__(145).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(78)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(63)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5zeW1ib2wuanM/N2Q2NyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBFQ01BU2NyaXB0IDYgc3ltYm9scyBzaGltXG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgREVTQ1JJUFRPUlMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciByZWRlZmluZSA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lJyk7XG52YXIgTUVUQSA9IHJlcXVpcmUoJy4vX21ldGEnKS5LRVk7XG52YXIgJGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBzaGFyZWQgPSByZXF1aXJlKCcuL19zaGFyZWQnKTtcbnZhciBzZXRUb1N0cmluZ1RhZyA9IHJlcXVpcmUoJy4vX3NldC10by1zdHJpbmctdGFnJyk7XG52YXIgdWlkID0gcmVxdWlyZSgnLi9fdWlkJyk7XG52YXIgd2tzID0gcmVxdWlyZSgnLi9fd2tzJyk7XG52YXIgd2tzRXh0ID0gcmVxdWlyZSgnLi9fd2tzLWV4dCcpO1xudmFyIHdrc0RlZmluZSA9IHJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKTtcbnZhciBlbnVtS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0ta2V5cycpO1xudmFyIGlzQXJyYXkgPSByZXF1aXJlKCcuL19pcy1hcnJheScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZ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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///458\n")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(98)('meta');\nvar isObject = __webpack_require__(45);\nvar has = __webpack_require__(62);\nvar setDesc = __webpack_require__(44).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(70)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU5LmpzI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RVRBLFxuICBORUVEOiBmYWxzZSxcbiAgZmFzdEtleTogZmFzdEtleSxcbiAgZ2V0V2VhazogZ2V0V2VhayxcbiAgb25GcmVlemU6IG9uRnJlZXplXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX21ldGEuanNcbi8vIG1vZHVsZSBpZCA9IDQ1OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///459\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(68);\nvar gOPS = __webpack_require__(145);\nvar pIE = __webpack_require__(81);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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UNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///460\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(77);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1hcnJheS5qcz9lZDQzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMi4yIElzQXJyYXkoYXJndW1lbnQpXG52YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gaXNBcnJheShhcmcpIHtcbiAgcmV0dXJuIGNvZihhcmcpID09ICdBcnJheSc7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///461\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(50);\nvar gOPN = __webpack_require__(205).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi1leHQuanM/NDZiNyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYWxsYmFjayBmb3IgSUUxMSBidWdneSBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyB3aXRoIGlmcmFtZSBhbmQgd2luZG93XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIGdPUE4gPSByZXF1aXJlKCcuL19vYmplY3QtZ29wbicpLmY7XG52YXIgdG9TdHJpbmcgPSB7fS50b1N0cmluZztcblxudmFyIHdpbmRvd05hbWVzID0gdHlwZW9mIHdpbmRvdyA9PSAnb2JqZWN0JyAmJiB3aW5kb3cgJiYgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXNcbiAgPyBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyh3aW5kb3cpIDogW107XG5cbnZhciBnZXRXaW5kb3dOYW1lcyA9IGZ1bmN0aW9uIChpdCkge1xuICB0cnkge1xuICAgIHJldHVybiBnT1BOKGl0KTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB3aW5kb3dOYW1lcy5zbGljZSgpO1xuICB9XG59O1xuXG5tb2R1bGUuZXhwb3J0cy5mID0gZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlOYW1lcyhpdCkge1xuICByZXR1cm4gd2luZG93TmFtZXMgJiYgdG9TdHJpbmcuY2FsbChpdCkgPT0gJ1tvYmplY3QgV2luZG93XScgPyBnZXRXaW5kb3dOYW1lcyhpdCkgOiBnT1BOKHRvSU9iamVjdChpdCkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi1leHQuanNcbi8vIG1vZHVsZSBpZCA9IDQ2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///462\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(147)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanM/Mzk4OSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL193a3MtZGVmaW5lJykoJ2FzeW5jSXRlcmF0b3InKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ2M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///463\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(147)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZS5qcz80MTY3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKSgnb2JzZXJ2YWJsZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5vYnNlcnZhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA0NjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///464\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SandboxType = undefined;\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _SandboxRegistry = __webpack_require__(475);\n\nvar _SandboxRegistry2 = _interopRequireDefault(_SandboxRegistry);\n\nvar _MiniBus2 = __webpack_require__(504);\n\nvar _MiniBus3 = _interopRequireDefault(_MiniBus2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\nvar SandboxType = exports.SandboxType = { APP: 'app', NORMAL: 'normal', WINDOW: 'window' };\n\n/**\n * @author micaelpedrosa@gmail.com\n * Base class to implement external sandbox component\n */\n\nvar Sandbox = function (_MiniBus) {\n (0, _inherits3.default)(Sandbox, _MiniBus);\n\n function Sandbox(capabilities) {\n (0, _classCallCheck3.default)(this, Sandbox);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (Sandbox.__proto__ || (0, _getPrototypeOf2.default)(Sandbox)).call(this));\n\n var _this = _this2;\n\n if (capabilities) {\n _this.capabilities = capabilities;\n }\n\n return _this2;\n }\n\n /**\n * Deploy an instance of the component into the sandbox.\n * @param {string} componentSourceCode Component source code (Hyperty, ProtoStub, etc)\n * @param {URL} componentURL Hyperty, ProtoStub, or any other component address.\n * @param {Config} configuration Config parameters of the component\n * @return {Promise} return deployed if successful, or any other string with an error\n */\n\n\n (0, _createClass3.default)(Sandbox, [{\n key: 'deployComponent',\n value: function deployComponent(componentSourceCode, componentURL, configuration) {\n\n var _this = this;\n\n // let messageFactory = _this.messageFactory;\n\n return new _promise2.default(function (resolve, reject) {\n //FLOW-OUT: deploy message for the internal SandboxRegistry -> _onDeploy\n var deployMessage = {\n type: 'create', from: _SandboxRegistry2.default.ExternalDeployAddress, to: _SandboxRegistry2.default.InternalDeployAddress,\n body: { url: componentURL, sourceCode: componentSourceCode, config: configuration }\n };\n\n //send message into the sandbox internals and wait for reply\n _this.postMessage(deployMessage, function (reply) {\n if (reply.body.code === 200) {\n //is this response complaint with the spec?\n resolve('deployed');\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n\n /**\n * Remove the instance of a previously deployed component.\n * @param {URL} componentURL Hyperty, ProtoStub, or any other component address.\n * @return {Promise} return undeployed if successful, or any other string with an error\n */\n\n }, {\n key: 'removeComponent',\n value: function removeComponent(componentURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //FLOW-OUT: un-deploy message for the internal SandboxRegistry -> _onRemove\n var removeMessage = {\n type: 'delete', from: _SandboxRegistry2.default.ExternalDeployAddress, to: _SandboxRegistry2.default.InternalDeployAddress,\n body: { url: componentURL }\n };\n\n //send message into the sandbox internals and wait for reply\n _this.postMessage(removeMessage, function (reply) {\n if (reply.body.code === 200) {\n //is this response complaint with the spec?\n resolve('undeployed');\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n\n /**\n * Matches Sandbox capabilities against provided capabilities. Used to check if sandbox provides all required capabilities\n * @param {RuntimeCapabilities} constraints set of RuntimeCapabilities to match with.\n * @return {boolean} return true if constraints are matched false otherwise\n */\n\n }, {\n key: 'matches',\n value: function matches(constraints) {\n var _this = this;\n\n var filtered = (0, _keys2.default)(constraints).filter(function (key) {\n return !(_this.capabilities[key] && _this.capabilities[key] === constraints[key]);\n });\n\n if (filtered.length === 0) {\n return true;\n } else {\n return !constraints[filtered];\n }\n }\n }]);\n return Sandbox;\n}(_MiniBus3.default);\n\nexports.default = Sandbox;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zYW5kYm94L1NhbmRib3guanM/MGEzMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5v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QUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFDQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBOzs7QUF0RkE7QUFDQTtBQXlGQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///465\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(467);\nmodule.exports = __webpack_require__(11).Object.getPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LXByb3RvdHlwZS1vZi5qcz83ZDJlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3QuZ2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2dldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDQ2NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///466\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(76);\nvar $getPrototypeOf = __webpack_require__(196);\n\n__webpack_require__(138)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qcz8yYTFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi45IE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdwbycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldFByb3RvdHlwZU9mJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gZnVuY3Rpb24gZ2V0UHJvdG90eXBlT2YoaXQpIHtcbiAgICByZXR1cm4gJGdldFByb3RvdHlwZU9mKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDY3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///467\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(469), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz85MjIwIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZlwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///468\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(470);\nmodule.exports = __webpack_require__(11).Object.setPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz84YmYwIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5zZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Quc2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L3NldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDQ2OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///469\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(26);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(471).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qcz83YjE4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMy4xOSBPYmplY3Quc2V0UHJvdG90eXBlT2YoTywgcHJvdG8pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IHNldFByb3RvdHlwZU9mOiByZXF1aXJlKCcuL19zZXQtcHJvdG8nKS5zZXQgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDQ3MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///470\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(45);\nvar anObject = __webpack_require__(41);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(69)(Function.call, __webpack_require__(148).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtcHJvdG8uanM/NjVhNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBXb3JrcyB3aXRoIF9fc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bHNlIHNldChPLCBwcm90byk7XG4gICAgICAgIHJldHVybiBPO1xuICAgICAgfTtcbiAgICB9KHt9LCBmYWxzZSkgOiB1bmRlZmluZWQpLFxuICBjaGVjazogY2hlY2tcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2V0LXByb3RvLmpzXG4vLyBtb2R1bGUgaWQgPSA0NzFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///471\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(473), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvY3JlYXRlLmpzPzNhZjQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGVcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2NyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gNDcyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///472\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(474);\nvar $Object = __webpack_require__(11).Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvY3JlYXRlLmpzP2EwY2UiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZScpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBjcmVhdGUoUCwgRCkge1xuICByZXR1cm4gJE9iamVjdC5jcmVhdGUoUCwgRCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDQ3M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///473\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(26);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(141) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuY3JlYXRlLmpzP2IwNWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4yIC8gMTUuMi4zLjUgT2JqZWN0LmNyZWF0ZShPIFssIFByb3BlcnRpZXNdKVxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IGNyZWF0ZTogcmVxdWlyZSgnLi9fb2JqZWN0LWNyZWF0ZScpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDQ3NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///474\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _SandboxFactory = __webpack_require__(476);\n\nvar _SandboxFactory2 = _interopRequireDefault(_SandboxFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author micaelpedrosa@gmail.com\n * Internal component registry of all sandboxes.\n * Process internal request's for component deploy.\n */\nvar SandboxRegistry = function () {\n /* private\n _components: \n */\n\n function SandboxRegistry(bus) {\n (0, _classCallCheck3.default)(this, SandboxRegistry);\n\n var _this = this;\n\n _this._bus = bus;\n _this._factory = new _SandboxFactory2.default(bus);\n _this._components = {};\n\n bus.addListener(SandboxRegistry.InternalDeployAddress, function (msg) {\n console.log('SandboxRegistry-RCV: ', msg);\n // let responseMsg = {\n // id: msg.id, type: 'response', from: SandboxRegistry.InternalDeployAddress, to: SandboxRegistry.ExternalDeployAddress\n // };\n\n switch (msg.type) {\n case 'create':\n _this._onDeploy(msg);break;\n case 'delete':\n _this._onRemove(msg);break;\n }\n });\n }\n\n (0, _createClass3.default)(SandboxRegistry, [{\n key: '_responseMsg',\n value: function _responseMsg(msg, code, value) {\n\n var _this = this;\n\n // let messageFactory = _this.messageFactory;\n\n //FLOW-OUT: generic response message to external Sandbox (deploy and un-deploy responses)\n var responseMsg = {\n id: msg.id, type: 'response', from: SandboxRegistry.InternalDeployAddress, to: SandboxRegistry.ExternalDeployAddress\n };\n\n // Chanege the origin message, because the response;\n // msg.from = SandboxRegistry.InternalDeployAddress;\n // msg.to = SandboxRegistry.ExternalDeployAddress;\n\n var body = {};\n if (code) body.code = code;\n if (value) body.desc = value;\n\n responseMsg.body = body;\n\n // return messageFactory.createResponse(msg, code, value);\n return responseMsg;\n }\n\n //FLOW-IN: message from the runtime core Sandbox -> deployComponent\n\n }, {\n key: '_onDeploy',\n value: function _onDeploy(msg) {\n var _this = this;\n var config = msg.body.config;\n var componentURL = msg.body.url;\n var sourceCode = msg.body.sourceCode;\n var responseCode = void 0;\n var responseDesc = void 0;\n\n if (!_this._components.hasOwnProperty(componentURL)) {\n try {\n console.log('SandboxRegistry-onDeploy: ', msg);\n _this._components[componentURL] = _this._create(componentURL, sourceCode, config, _this._factory);\n responseCode = 200;\n } catch (error) {\n responseCode = 500;\n responseDesc = error;\n }\n } else {\n responseCode = 500;\n responseDesc = 'Instance ' + componentURL + ' already exist!';\n }\n\n var responseMsg = _this._responseMsg(msg, responseCode, responseDesc);\n _this._bus.postMessage(responseMsg);\n }\n\n //FLOW-IN: message from the runtime core Sandbox -> removeComponent\n\n }, {\n key: '_onRemove',\n value: function _onRemove(msg) {\n var _this = this;\n var componentURL = msg.body.url;\n var responseCode = void 0;\n var responseDesc = void 0;\n\n if (_this._components.hasOwnProperty(componentURL)) {\n //remove component from the pool and all listeners\n delete _this._components[componentURL];\n _this._bus.removeAllListenersOf(componentURL);\n responseCode = 200;\n } else {\n responseCode = 500;\n responseDesc = 'Instance ' + componentURL + ' doesn\\'t exist!';\n }\n\n var responseMsg = _this._responseMsg(msg, responseCode, responseDesc);\n\n _this._bus.postMessage(responseMsg);\n }\n\n /**\n * This method should be implemented by the internal sandbox code.\n * @param {ComponentURL} url URL used for the instance\n * @param {string} sourceCode Code of the component\n * @param {Config} config Configuration parameters\n * @return {Object} Returns instance of the component or throw an error \"throw 'error message'\"\n */\n\n }, {\n key: '_create',\n value: function _create(url, sourceCode, config, factory) {\n //implementation specific\n /* example code:\n eval(sourceCode);\n return activate(url, _this._bus, config);\n */\n }\n }, {\n key: 'components',\n get: function get() {\n return this._components;\n }\n }]);\n return SandboxRegistry;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n/**\n * @author micaelpedrosa@gmail.com\n * Base class to implement internal deploy manager of components.\n */\n\n\nSandboxRegistry.ExternalDeployAddress = 'hyperty-runtime://sandbox/external';\nSandboxRegistry.InternalDeployAddress = 'hyperty-runtime://sandbox/internal';\n\nexports.default = SandboxRegistry;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zYW5kYm94L1NhbmRib3hSZWdpc3RyeS5qcz9lZTFjIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGh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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7Ozs7O0FBT0E7QUFDQTtBQUNBOzs7O0FBSUE7OztBQXpGQTtBQUFBO0FBQUE7OztBQTFEQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXNCQTs7Ozs7O0FBZ0lBO0FBQ0E7QUFDQTtBQUNBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///475\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Syncher = __webpack_require__(477);\n\nvar _Syncher2 = _interopRequireDefault(_Syncher);\n\nvar _NotificationHandler = __webpack_require__(490);\n\nvar _NotificationHandler2 = _interopRequireDefault(_NotificationHandler);\n\nvar _utils = __webpack_require__(6);\n\nvar _IdentityManager = __webpack_require__(491);\n\nvar _IdentityManager2 = _interopRequireDefault(_IdentityManager);\n\nvar _Discovery = __webpack_require__(492);\n\nvar _Discovery2 = _interopRequireDefault(_Discovery);\n\nvar _RegistrationStatus = __webpack_require__(150);\n\nvar _RegistrationStatus2 = _interopRequireDefault(_RegistrationStatus);\n\nvar _Search = __webpack_require__(494);\n\nvar _Search2 = _interopRequireDefault(_Search);\n\nvar _ContextObserver = __webpack_require__(495);\n\nvar _ContextObserver2 = _interopRequireDefault(_ContextObserver);\n\nvar _ContextReporter = __webpack_require__(496);\n\nvar _ContextReporter2 = _interopRequireDefault(_ContextReporter);\n\nvar _MessageBodyIdentity = __webpack_require__(497);\n\nvar _MessageBodyIdentity2 = _interopRequireDefault(_MessageBodyIdentity);\n\nvar _ChatManager = __webpack_require__(499);\n\nvar _ChatManager2 = _interopRequireDefault(_ChatManager);\n\nvar _ChatController = __webpack_require__(210);\n\nvar _ChatController2 = _interopRequireDefault(_ChatController);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Internal component to instantiate framework functionalities.\n */\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\nvar SandboxFactory = function () {\n /* private\n _components: \n */\n\n function SandboxFactory(bus) {\n (0, _classCallCheck3.default)(this, SandboxFactory);\n\n var _this = this;\n _this._bus = bus;\n _this._divideURL = _utils.divideURL;\n }\n\n (0, _createClass3.default)(SandboxFactory, [{\n key: 'createSyncher',\n value: function createSyncher(owner, bus, config) {\n return new _Syncher2.default(owner, bus, config);\n }\n }, {\n key: 'createIdentityManager',\n value: function createIdentityManager(hypertyURL, runtimeURL, bus) {\n var _this = this;\n return new _IdentityManager2.default(hypertyURL, runtimeURL, bus);\n }\n }, {\n key: 'createDiscovery',\n value: function createDiscovery(hypertyURL, runtimeURL, bus) {\n var _this = this;\n return new _Discovery2.default(hypertyURL, runtimeURL, bus);\n }\n }, {\n key: 'createSearch',\n value: function createSearch(discovery, identityManager) {\n var _this = this;\n return new _Search2.default(discovery, identityManager);\n }\n }, {\n key: 'createContextObserver',\n value: function createContextObserver(hypertyURL, bus, config, schemes) {\n return new _ContextObserver2.default(hypertyURL, bus, config, schemes, this);\n }\n }, {\n key: 'createContextReporter',\n value: function createContextReporter(hypertyURL, bus, config) {\n var _this = this;\n return new _ContextReporter2.default(hypertyURL, bus, config, this);\n }\n }, {\n key: 'createNotificationHandler',\n value: function createNotificationHandler(bus) {\n var _this = this;\n return new _NotificationHandler2.default(bus);\n }\n }, {\n key: 'createMessageBodyIdentity',\n value: function createMessageBodyIdentity(username, userURL, picture, name, locale, idp, assertion, profile) {\n return new _MessageBodyIdentity2.default(username, userURL, picture, name, locale, idp, assertion, profile);\n }\n }, {\n key: 'createChatManager',\n value: function createChatManager(hypertyURL, bus, configuration, syncher) {\n return new _ChatManager2.default(hypertyURL, bus, configuration, syncher, this);\n }\n }, {\n key: 'createChatController',\n value: function createChatController(syncher, discovery, domain, search, identity, manager) {\n return new _ChatController2.default(syncher, discovery, domain, search, identity, manager);\n }\n }, {\n key: 'createRegistrationStatus',\n value: function createRegistrationStatus(observer, runtimeURL, chatUrl, bus) {\n return new _RegistrationStatus2.default(observer, runtimeURL, chatUrl, bus);\n }\n }, {\n key: 'divideURL',\n get: function get() {\n return this._divideURL;\n }\n }]);\n return SandboxFactory;\n}();\n\nexports.default = SandboxFactory;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zYW5kYm94L1NhbmRib3hGYWN0b3J5LmpzPzQ3ODQiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4qIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS5cbiogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0XG4qXG4qICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wXG4qXG4qIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3Jp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Ozs7O0FBSUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBTUE7QUFDQTtBQUVBOzs7QUFQQTtBQUNBO0FBQ0E7Ozs7O0FBWUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///476\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DataObjectReporter = __webpack_require__(479);\n\nvar _DataObjectReporter2 = _interopRequireDefault(_DataObjectReporter);\n\nvar _DataObjectObserver = __webpack_require__(488);\n\nvar _DataObjectObserver2 = _interopRequireDefault(_DataObjectObserver);\n\nvar _DataProvisional = __webpack_require__(489);\n\nvar _DataProvisional2 = _interopRequireDefault(_DataProvisional);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Syncher'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* The main class for the syncher package.\n* The Syncher is a singleton class per Hyperty/URL and it is the owner of all created Data Sync Objects according to the Reporter - Observer pattern.\n* Main functionality is to create reporters and to subscribe to existing ones.\n*/\nvar Syncher = function () {\n /* private\n _owner: URL\n _bus: MiniBus\n _subURL: URL\n _reporters: \n _observers: \n _provisionals: \n ----event handlers----\n _onNotificationHandler: (event) => void\n _onResume: (event) => void\n */\n\n /**\n * Constructor that should be used by the Hyperty owner\n * @param {HypertyURL} owner - Hyperty URL owner. An URL allocated by the runtime that uniquely identifies the Hyperty.\n * @param {MiniBus} bus - An instance of the MiniBus provided in the sandbox. When an object (Reporter or Observed) is created, the SyncherManager will add a listener in the MiniBus to receive/send Messages of that object.\n * @param {JSON} config - Configuration data. The only required field for now is the runtimeURL.\n */\n function Syncher(owner, bus, config) {\n (0, _classCallCheck3.default)(this, Syncher);\n\n var _this = this;\n\n _this._owner = owner;\n _this._bus = bus;\n\n _this._subURL = config.runtimeURL + '/sm';\n _this._runtimeUrl = config.runtimeURL;\n\n _this._p2pHandler = config.p2pHandler;\n _this._p2pRequester = config.p2pRequester;\n\n _this._reporters = {};\n _this._observers = {};\n _this._provisionals = {};\n\n bus.addListener(owner, function (msg) {\n //ignore msg sent by himself\n if (msg.from !== owner) {\n log.info('[Syncher] Syncher-RCV: ', msg, _this);\n switch (msg.type) {\n case 'forward':\n _this._onForward(msg);break;\n case 'create':\n _this._onRemoteCreate(msg);break;\n case 'delete':\n _this._onRemoteDelete(msg);break;\n case 'execute':\n _this._onExecute(msg);break;\n }\n }\n });\n }\n\n /**\n * The owner of the Syncher and all created reporters.\n * @type {HypertyURL}\n */\n\n\n (0, _createClass3.default)(Syncher, [{\n key: 'create',\n\n\n /**\n * Request a DataObjectReporter creation. The URL will be be requested by the allocation mechanism.\n * @param {SchemaURL} schema - Hyperty Catalogue URL address that can be used to retrieve the JSON-Schema describing the Data Object schema\n * @param {HypertyURL[]} observers - List of hyperties that are pre-authorized for subscription\n * @param {JSON} initialData - Initial data of the reporter\n * @param {boolean} store - (Optional) if true, object will be stored by the runtime\n * @param {boolean} p2p - (Optional) if true, data synchronisation stream will use p2p connection as much as possible\n * @param {string} name - (Optional) the name of the dataobject\n * @param {MessageBodyIdentity} identity - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @param {SyncMetadata} input - (optional) all metadata required to sunc the Data Object.\n * @return {Promise} Return Promise to a new Reporter. The reporter can be accepted or rejected by the PEP\n */\n value: function create(schema, observers, initialData) {\n var store = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var p2p = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n var name = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'no name';\n var identity = arguments[6];\n var input = arguments[7];\n\n\n if (!schema) throw Error('[Syncher - Create] - You need specify the data object schema');\n if (!observers) throw Error('[Syncher - Create] -The observers should be defined');\n\n var _this = this;\n input = input || {};\n var createInput = (0, _assign2.default)({}, input);\n\n createInput.p2p = p2p;\n createInput.store = store;\n createInput.schema = schema;\n createInput.authorise = observers;\n createInput.p2pHandler = _this._p2pHandler;\n createInput.p2pRequester = _this._p2pRequester;\n initialData ? createInput.data = (0, _utils.deepClone)(initialData) : createInput.data = {};\n createInput.name = name.length === 0 ? 'no name' : name;\n createInput.reporter = input.hasOwnProperty('reporter') && typeof input.reporter !== 'boolean' ? input.reporter : _this._owner;\n createInput.resume = false;\n if (input) {\n createInput.mutual = input.hasOwnProperty('mutual') ? input.mutual : true;\n createInput.name = input.hasOwnProperty('name') ? input.name : createInput.name;\n } else {\n createInput.mutual = true;\n }\n\n if (input.hasOwnProperty('reuseURL')) {\n createInput.resource = input.reuseURL;\n }\n\n if (identity) {\n createInput.identity = identity;\n }\n\n //Object.assign(createInput, {resume: false});\n //debugger;\n log.log('[syncher - create] - create Reporter - createInput: ', createInput);\n\n return _this._create(createInput);\n }\n\n /**\n * Request a DataObjectReporter creation. The URL will be be requested by the allocation mechanism.\n * @param {Object} criteria - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @return {Promise[]} Return a promise with a list of DataObjectReporter to be resumed;\n */\n\n }, {\n key: 'resumeReporters',\n value: function resumeReporters(criteria) {\n var _this = this;\n log.log('[syncher - create] - resume Reporter - criteria: ', criteria);\n\n (0, _assign2.default)(criteria, { resume: true });\n\n return _this._resumeCreate(criteria);\n }\n\n /**\n * Request a subscription to an existent reporter object.\n * @param {SchemaURL} schema - Hyperty Catalogue URL address that can be used to retrieve the JSON-Schema describing the Data Object schema\n * @param {ObjectURL} objURL - Address of the existent reporter object to be observed\n * @param {Boolean} [store=false] - Save the subscription on the Syncher Manager for further resume (Default is false)\n * @param {Boolean} [p2p=false] - Info about if should use p2p connection (Default is false)\n * @param {Boolean} [mutual=true] - Info about if messages of this object should be encrypted (Default is true)\n * @param {MessageBodyIdentity} identity - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @return {Promise} Return Promise to a new observer. It's associated with the reporter.\n */\n\n //TODO: use input JSON param with all optional parameters similar to create\n\n }, {\n key: 'subscribe',\n value: function subscribe(schema, objURL) {\n var store = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n var p2p = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var mutual = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;\n var domain_subscription = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : true;\n var identity = arguments[6];\n\n var _this = this;\n var criteria = {};\n\n criteria.p2p = p2p;\n criteria.store = store;\n criteria.schema = schema;\n criteria.domain_subscription = domain_subscription;\n\n criteria.resource = objURL;\n if (identity) {\n criteria.identity = identity;\n }\n\n //TODO: For Further Study\n criteria.mutual = mutual;\n\n log.log('[syncher - subscribe] - subscribe criteria: ', criteria);\n\n (0, _assign2.default)(criteria, { resume: false });\n\n return _this._subscribe(criteria);\n }\n\n /**\n * Request a subscription to an existent reporter object.\n * @param {criteria} criteria - Information to discovery the observer object\n * @return {Promise} Return Promise to a new observer. It's associated with the reporter.\n */\n\n }, {\n key: 'resumeObservers',\n value: function resumeObservers(criteria) {\n var _this = this;\n var _criteria = criteria || {};\n\n (0, _assign2.default)(_criteria, { resume: true });\n\n return _this._resumeSubscribe(_criteria);\n }\n\n /**\n * Request a read action on the reporter object\n * @param {ObjectURL} objURL - URL of the reporter object to be read\n * @return {Promise} Return Promise to last available data of the reporter\n */\n\n }, {\n key: 'read',\n value: function read(objURL, criteria) {\n var _this = this;\n console.log('[Syncher.read] ', objURL);\n\n return new _promise2.default(function (resolve, reject) {\n // in case the object is synched in a remote storage, lets sync with it\n /* if (_this._observers[objURL] && _this._observers[objURL].metadata.hasOwnProperty('backup') && _this._observers[objURL].metadata.backup) {\n \n let readMsg = {\n type: 'read', from: _this._owner, to: _this._subURL, \n body: { resource: objURL}\n };\n \n if (criteria) readMsg.body.criteria = criteria;\n \n let callback = (reply) => {\n return _this._readCallBack(reply, resolve, reject);\n };\n \n _this._bus.postMessage(readMsg, callback, false);\n \n } else {*/\n _this._readReporter(objURL).then(function (result) {\n resolve(result);\n });\n // }\n });\n }\n }, {\n key: '_readCallBack',\n value: function _readCallBack(reply, resolve, reject) {\n var _this = this;\n\n console.log('[Syncher.read] reply: ', reply);\n\n var childrens = {};\n var value = {};\n var n = 0;\n\n if (reply.body.code < 300) {\n if (!reply.body.value.hasOwnProperty('responses')) {\n _this._bus.removeResponseListener(reply.from, reply.id);\n resolve(reply.body.value);\n } else {\n //data object is sent in separated messages\n if (n === 0) {\n //initial response without childrens\n value = reply.body.value;\n ++n;\n } else {\n // received response contains childrens\n delete reply.body.value.responses;\n var children = void 0;\n for (children in reply.body.value) {\n if (!childrens.hasOwnProperty(children)) childrens[children] = {};\n (0, _assign2.default)(childrens[children], reply.body.value[children]);\n }\n ++n;\n if (n === value.responses) {\n value.childrenObjects = childrens;\n delete value.responses;\n _this._bus.removeResponseListener(reply.from, reply.id);\n resolve(value);\n }\n }\n }\n } else {\n\n reject(reply.body.desc);\n }\n }\n }, {\n key: '_readReporter',\n value: function _readReporter(objURL) {\n var _this = this;\n\n //FLOW-OUT: this message will be sent directly to reporter object (maybe there is no listener available, so it will be resolved with MessageBus -> resolve)\n //will reach the remote object in DataObjectReporter -> _onRead\n var readMsg = {\n type: 'read', from: _this._owner, to: objURL\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._bus.postMessage(readMsg, function (reply) {\n return _this._readCallBack(reply, resolve, reject);\n }, false);\n });\n }\n\n /**\n * Setup the callback to process create and delete events of remove Reporter objects.\n * This is releated to the messagens sent by create to the observers Hyperty array.\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onNotification',\n value: function onNotification(callback) {\n this._onNotificationHandler = callback;\n }\n\n /**\n * Setup the callback to process close events from the runtime.\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onClose',\n value: function onClose(callback) {\n this._onClose = callback;\n }\n }, {\n key: '_create',\n value: function _create(input) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var reporterInput = (0, _assign2.default)({}, input);\n\n var resume = input.resume;\n\n reporterInput.created = new Date().toISOString();\n reporterInput.runtime = _this._runtimeUrl;\n\n var requestValue = (0, _utils.deepClone)(reporterInput);\n\n delete requestValue.p2p;\n delete requestValue.store;\n delete requestValue.observers;\n delete requestValue.identity;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onCreate\n //debugger;\n var requestMsg = {\n type: 'create', from: _this._owner, to: _this._subURL,\n body: { resume: resume, value: requestValue }\n };\n\n requestMsg.body.schema = reporterInput.schema;\n\n if (reporterInput.p2p) requestMsg.body.p2p = reporterInput.p2p;\n if (reporterInput.store) requestMsg.body.store = reporterInput.store;\n if (reporterInput.identity) requestMsg.body.identity = reporterInput.identity;\n\n log.log('[syncher._create]: ', reporterInput, requestMsg);\n\n //request create to the allocation system. Can be rejected by the PolicyEngine.\n _this._bus.postMessage(requestMsg, function (reply) {\n log.log('[syncher - create] - create-response: ', reply);\n if (reply.body.code === 200) {\n //reporter creation accepted\n reporterInput.url = reply.body.resource;\n\n /* if (reply.body.p2pHandler) reporterInput.p2pHandler = reply.body.p2pHandler;\n if (reply.body.p2pRequester) reporterInput.p2pRequester = reply.body.p2pRequester;*/\n\n reporterInput.status = 'live'; // pch: do we ned this?\n reporterInput.syncher = _this;\n reporterInput.childrens = reply.body.childrenResources;\n\n var newObj = _this._reporters[reporterInput.url];\n\n if (!newObj) {\n newObj = new _DataObjectReporter2.default(reporterInput);\n _this._reporters[reporterInput.url] = newObj;\n }\n\n newObj.inviteObservers(input.authorise, input.p2p);\n\n resolve(newObj);\n } else {\n //reporter creation rejected\n reject(reply.body.desc);\n }\n });\n });\n }\n }, {\n key: '_resumeCreate',\n value: function _resumeCreate(criteria) {\n var _this2 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var resume = criteria.resume;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onCreate\n var requestMsg = {\n type: 'create', from: _this._owner, to: _this._subURL,\n body: { resume: resume }\n };\n\n log.log('[syncher - create]: ', criteria, requestMsg);\n if (criteria) {\n requestMsg.body.value = criteria;\n if (criteria.hasOwnProperty('reporter')) {\n requestMsg.body.value.reporter = criteria.reporter;\n } else {\n requestMsg.body.value.reporter = _this._owner;\n }\n }\n\n if (criteria.p2p) requestMsg.body.p2p = criteria.p2p;\n if (criteria.store) requestMsg.body.store = criteria.store;\n if (criteria.observers) requestMsg.body.authorise = criteria.observers;\n if (criteria.identity) requestMsg.body.identity = criteria.identity;\n\n log.log('[syncher._resumeCreate] - resume message: ', requestMsg);\n\n //debugger;\n\n //request create to the allocation system. Can be rejected by the PolicyEngine.\n\n _this._bus.postMessage(requestMsg, function (reply) {\n log.log('[syncher._resumeCreate] - create-resumed-response: ', reply);\n if (reply.body.code === 200) {\n //debugger;\n var listOfReporters = reply.body.value;\n\n for (var index in listOfReporters) {\n\n var dataObject = listOfReporters[index];\n\n //reporter creation accepted\n\n dataObject.data = (0, _utils.deepClone)(dataObject.data) || {};\n\n if (dataObject.childrenObjects) {\n dataObject.childrenObjects = (0, _utils.deepClone)(dataObject.childrenObjects);\n }\n\n dataObject.mutual = false;\n dataObject.resume = true;\n dataObject.status = 'live'; // pch: do we ned this?\n dataObject.syncher = _this;\n\n log.log('[syncher._resumeCreate] - create-resumed-dataObjectReporter', dataObject);\n\n var newObj = new _DataObjectReporter2.default(dataObject);\n\n if (dataObject.childrenObjects) {\n newObj.resumeChildrens(dataObject.childrenObjects);\n }\n _this._reporters[dataObject.url] = newObj;\n }\n\n resolve(_this._reporters);\n if (_this2._onReportersResume) _this2._onReportersResume(_this2._reporters);\n } else if (reply.body.code === 404) {\n resolve({});\n } else {\n //reporter creation rejected\n reject(reply.body.desc);\n }\n });\n });\n }\n }, {\n key: '_subscribe',\n value: function _subscribe(input) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onLocalSubscribe\n var subscribeMsg = {\n type: 'subscribe', from: _this._owner, to: _this._subURL,\n body: {}\n };\n\n // Hyperty request to be an Observer\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#hyperty-request-to-be-an-observer\n\n // Resume Subscriptions for the same Hyperty URL\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-the-same-hyperty-url\n\n // Resume Subscriptions for a certain user and data schema independently of the Hyperty URL.\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-a-certain-user-and-data-schema-independently-of-the-hyperty-url\n if (input) {\n if (input.hasOwnProperty('p2p')) subscribeMsg.body.p2p = input.p2p;\n if (input.hasOwnProperty('store')) subscribeMsg.body.store = input.store;\n if (input.hasOwnProperty('schema')) subscribeMsg.body.schema = input.schema;\n if (input.hasOwnProperty('identity')) subscribeMsg.body.identity = input.identity;\n if (input.hasOwnProperty('resource')) subscribeMsg.body.resource = input.resource;\n if (input.hasOwnProperty('domain_subscription')) subscribeMsg.body.domain_subscription = input.domain_subscription;\n }\n\n subscribeMsg.body.resume = input.resume;\n\n //TODO: For Further Study\n if (input.hasOwnProperty('mutual')) subscribeMsg.body.mutual = input.mutual;\n\n log.log('[syncher_subscribe] - subscribe message: ', input, subscribeMsg);\n\n //request subscription\n //Provisional data is applied to the DataObjectObserver after confirmation. Or discarded if there is no confirmation.\n //for more info see the DataProvisional class documentation.\n _this._bus.postMessage(subscribeMsg, function (reply) {\n log.log('[syncher] - subscribe-response: ', reply);\n\n var objURL = reply.body.resource;\n\n var newProvisional = _this._provisionals[objURL];\n delete _this._provisionals[objURL];\n if (newProvisional) newProvisional._releaseListeners();\n\n if (reply.body.code < 200) {\n log.log('[syncher] - new DataProvisional: ', reply.body.childrenResources, objURL);\n newProvisional = new _DataProvisional2.default(_this._owner, objURL, _this._bus, reply.body.childrenResources);\n _this._provisionals[objURL] = newProvisional;\n } else if (reply.body.code === 200) {\n log.log('[syncher] - new Data Object Observer: ', reply, _this._provisionals);\n\n var observerInput = reply.body.value;\n\n observerInput.syncher = _this;\n observerInput.p2p = input.p2p;\n observerInput.store = input.store;\n observerInput.identity = input.identity;\n observerInput.resume = false;\n\n // todo: For Further Study\n observerInput.mutual = input.mutual;\n\n //observerInput.children = newProvisional.children;\n\n //TODO: mutual For Further Study\n var newObj = _this._observers[objURL];\n if (!newObj) {\n newObj = new _DataObjectObserver2.default(observerInput);\n _this._observers[objURL] = newObj;\n } else {\n newObj.sync();\n }\n\n log.log('[syncher] - new Data Object Observer already exist: ', newObj);\n\n resolve(newObj);\n\n if (newProvisional) {\n newProvisional.apply(newObj);\n }\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n }, {\n key: '_resumeSubscribe',\n value: function _resumeSubscribe(criteria) {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onLocalSubscribe\n var subscribeMsg = {\n type: 'subscribe', from: _this._owner, to: _this._subURL,\n body: {}\n };\n\n // Hyperty request to be an Observer\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#hyperty-request-to-be-an-observer\n\n // Resume Subscriptions for the same Hyperty URL\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-the-same-hyperty-url\n\n // Resume Subscriptions for a certain user and data schema independently of the Hyperty URL.\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-a-certain-user-and-data-schema-independently-of-the-hyperty-url\n if (criteria) {\n if (criteria.hasOwnProperty('p2p')) subscribeMsg.body.p2p = criteria.p2p;\n if (criteria.hasOwnProperty('store')) subscribeMsg.body.store = criteria.store;\n if (criteria.hasOwnProperty('schema')) subscribeMsg.body.schema = criteria.schema;\n if (criteria.hasOwnProperty('identity')) subscribeMsg.body.identity = criteria.identity;\n if (criteria.hasOwnProperty('resource')) subscribeMsg.body.resource = criteria.url;\n }\n\n subscribeMsg.body.resume = criteria.resume;\n\n //TODO: For Further Study\n var mutual = criteria.mutual;\n if (criteria.hasOwnProperty('mutual')) subscribeMsg.body.mutual = mutual;\n\n log.log('[syncher] - subscribe message: ', criteria, subscribeMsg);\n\n //request subscription\n //Provisional data is applied to the DataObjectObserver after confirmation. Or discarded if there is no confirmation.\n //for more info see the DataProvisional class documentation.\n _this._bus.postMessage(subscribeMsg, function (reply) {\n log.log('[syncher] - subscribe-resumed-response: ', reply);\n\n var objURL = reply.body.resource;\n\n var newProvisional = _this._provisionals[objURL];\n delete _this._provisionals[objURL];\n if (newProvisional) newProvisional._releaseListeners();\n\n if (reply.body.code < 200) {\n // todo: check if this is needed for the resume\n\n log.log('[syncher] - resume new DataProvisional: ', reply, objURL);\n newProvisional = new _DataProvisional2.default(_this._owner, objURL, _this._bus, reply.body.childrenResources);\n _this._provisionals[objURL] = newProvisional;\n } else if (reply.body.code === 200) {\n\n var listOfObservers = reply.body.value;\n\n for (var index in listOfObservers) {\n\n var dataObject = listOfObservers[index];\n log.log('[syncher] - Resume Object Observer: ', reply, dataObject, _this._provisionals);\n\n if (dataObject.childrenObjects) {\n dataObject.childrenObjects = (0, _utils.deepClone)(dataObject.childrenObjects);\n }\n\n dataObject.data = (0, _utils.deepClone)(dataObject.data) || {};\n dataObject.resume = true;\n dataObject.syncher = _this;\n\n //TODO: mutual For Further Study\n log.log('[syncher._resumeSubscribe] - create new dataObject: ', dataObject);\n var newObj = new _DataObjectObserver2.default(dataObject);\n\n if (dataObject.childrenObjects) {\n newObj.resumeChildrens(dataObject.childrenObjects);\n }\n log.log('[syncher._resumeSubscribe] - new dataObject', newObj);\n _this._observers[newObj.url] = newObj;\n\n if (_this._provisionals[newObj.url]) {\n _this._provisionals[newObj.url].apply(newObj);\n }\n\n //lets sync with Reporter\n // it was commented to let hyperties decide when to sync\n //newObj.sync();\n }\n\n resolve(_this._observers);\n\n if (_this3._onObserversResume) _this3._onObserversResume(_this._observers);\n } else if (reply.body.code === 404) {\n resolve({});\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n\n //FLOW-IN: message received from a local runtime ReporterObject -> _onRemoteSubscribe\n\n }, {\n key: '_onForward',\n value: function _onForward(msg) {\n var _this = this;\n\n var reporter = _this._reporters[msg.body.to];\n reporter._onForward(msg);\n }\n\n //FLOW-IN: message received from a remote Syncher -> create (this is actually an invitation to subscribe)\n\n }, {\n key: '_onRemoteCreate',\n value: function _onRemoteCreate(msg) {\n var _this = this;\n var resource = msg.from.slice(0, -13); //remove \"/subscription\" from the URL\n var dividedURL = (0, _utils.divideURL)(resource);\n var domain = dividedURL.domain;\n\n var event = {\n type: msg.type,\n from: msg.body.source,\n url: resource,\n domain: domain,\n schema: msg.body.schema,\n value: msg.body.value,\n identity: msg.body.identity,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType }\n });\n }\n };\n\n if (_this._onNotificationHandler) {\n log.info('[Syncher] NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler(event);\n }\n }\n\n //FLOW-IN: message received from a remote DataObjectReporter -> delete\n\n }, {\n key: '_onRemoteDelete',\n value: function _onRemoteDelete(msg) {\n var _this = this;\n\n //remove \"/subscription\" from the URL\n var resource = msg.body.resource;\n\n var object = _this._observers[resource];\n\n var unsubscribe = {\n from: _this.owner,\n to: _this._subURL,\n id: msg.id,\n type: 'unsubscribe',\n body: { resource: msg.body.resource }\n };\n\n _this._bus.postMessage(unsubscribe);\n\n delete _this._observers[resource];\n\n if (object) {\n var event = {\n type: msg.type,\n url: resource,\n identity: msg.body.identity,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //TODO: any other different options for the release process, like accept but nor release local?\n if (lType === 200) {\n object.delete();\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType, source: _this._owner }\n });\n }\n };\n\n if (_this._onNotificationHandler) {\n log.log('NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler(event);\n }\n } else {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 404, source: _this._owner }\n });\n }\n }\n\n // close event received from runtime registry\n\n }, {\n key: '_onExecute',\n value: function _onExecute(msg) {\n var _this = this;\n\n var reply = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n };\n\n if ((msg.from === _this._runtimeUrl + '/registry/' || msg.from === _this._runtimeUrl + '/registry') && msg.body && msg.body.method && msg.body.method === 'close' && _this._onClose) {\n var event = {\n type: 'close',\n\n ack: function ack(type) {\n if (type) {\n reply.body.code = type;\n }\n\n //send ack response message\n _this._bus.postMessage(reply);\n }\n };\n\n log.info('[Syncher] Close-EVENT: ', event);\n _this._onClose(event);\n } else {\n _this._bus.postMessage(reply);\n }\n }\n\n /**\n * Callback system to trigger the resumed reporters\n * @param {Function} callback - function callback which will be invoked\n * @return {Object} Return one object with all resumed reporters;\n */\n\n }, {\n key: 'onReportersResume',\n value: function onReportersResume(callback) {\n this._onReportersResume = callback;\n }\n\n /**\n * Callback system to trigger the resumed observers\n * @param {Function} callback - function callback which will be invoked\n * @return {Object} Return one object with all resumed observers;\n */\n\n }, {\n key: 'onObserversResume',\n value: function onObserversResume(callback) {\n this._onObserversResume = callback;\n }\n }, {\n key: 'owner',\n get: function get() {\n return this._owner;\n }\n\n /**\n * All owned reporters, the ones that were created by a create\n * @type {Object}\n */\n\n }, {\n key: 'reporters',\n get: function get() {\n return this._reporters;\n }\n\n /**\n * All owned observers, the ones that were created by a local subscription\n * @type {Object}\n */\n\n }, {\n key: 'observers',\n get: function get() {\n return this._observers;\n }\n }]);\n return Syncher;\n}();\n\nexports.default = Syncher;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;char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1xuXG4gICAgICAgIGxldCByZWFkTXNnID0ge1xuICAgICAgICAgIHR5cGU6ICdyZWFkJywgZnJvbTogX3RoaXMuX293bmVyLCB0bzogX3RoaXMuX3N1YlVSTCwgXG4gICAgICAgICAgYm9keTogeyByZXNvdXJjZTogb2JqVVJMfVxuICAgICAgICB9O1xuXG4gICAgICAgIGlmIChjcml0ZXJpYSkgcmVhZE1zZy5ib2R5LmNyaXRlcmlhID0gY3JpdGVyaWE7XG5cbiAgICAgICAgICBsZXQgY2FsbGJhY2sgPSAocmVwbHkpID0+IHtcbiAgICAgICAgICAgIHJldHVybiBfdGhpcy5fcmVhZENhbGxCYWNrKHJlcGx5LCByZXNvbHZlLCByZWplY3QpO1xuICAgICAgICAgIH07XG4gICAgXG4gICAgICAgICAgX3RoaXMuX2J1cy5wb3N0TWVzc2FnZShyZWFkTXNnLCBjYWxsYmFjaywgZmFsc2UpO1xuICAgIFxuICAgICAgfSBlbHNlIHsqL1xuICAgICAgICBfdGhpcy5fcmVhZFJlcG9ydGVyKG9ialVSTCkudGhlbigocmVzdWx0KT0+IHtcbiAgICAgICAgcmVzb2x2ZShyZXN1bHQpO1xuICAgICAgfSk7XG4vLyAgICB9XG5cbiAgICB9KTtcblxuICB9XG5cbiAgX3JlYWRDYWxsQmFjayhyZXBseSwgcmVzb2x2ZSxyZWplY3QpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgICBjb25zb2xlLmxvZygnW1N5bmNoZXIucmVhZF0gcmVwbHk6ICcsIHJlcGx5KTtcblxuICAgICAgbGV0IGNoaWxkcmVucyA9IHt9O1xuICAgICAgbGV0IHZhbHVlID0ge307XG4gICAgICBsZXQgbiA9IDA7XG5cbiAgICAgIGlmIChyZXBseS5ib2R5LmNvZGUgPCAzMDApIHtcbiAgICAgICAgaWYgKCFyZXBseS5ib2R5LnZhbHVlLmhhc093blByb3BlcnR5KCdyZXNwb25zZXMnKSkge1xuICAgICAgICAgIF90aGlzLl9idXMucmVt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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTEE7QUFDQTtBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQXJCQTtBQUNBO0FBdUJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFWQTtBQUNBO0FBWUE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7OztBQUtBO0FBQ0E7QUFDQTs7O0FBbHRCQTtBQUFBO0FBQUE7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQUE7QUFBQTs7Ozs7QUEwc0JBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///477\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(11);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9qc29uL3N0cmluZ2lmeS5qcz9hYTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpO1xudmFyICRKU09OID0gY29yZS5KU09OIHx8IChjb3JlLkpTT04gPSB7IHN0cmluZ2lmeTogSlNPTi5zdHJpbmdpZnkgfSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHN0cmluZ2lmeShpdCkgeyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gIHJldHVybiAkSlNPTi5zdHJpbmdpZnkuYXBwbHkoJEpTT04sIGFyZ3VtZW50cyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSA0Nzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///478\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _DataObject2 = __webpack_require__(206);\n\nvar _DataObject3 = _interopRequireDefault(_DataObject2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectReporter'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n * The class returned from the Syncher create call.\n * To be used as a reporter point, changes will be submited to DataObjectObserver instances.\n */\nvar DataObjectReporter = function (_DataObject) {\n (0, _inherits3.default)(DataObjectReporter, _DataObject);\n\n /* private\n _subscriptions: \n ----event handlers----\n _onSubscriptionHandler: (event) => void\n _onResponseHandler: (event) => void\n _onReadHandler: (event) => void\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the Syncher.create method\n */\n\n //constructor(syncher, url, created, reporter, runtime, schema, name, initialStatus, initialData, childrens, mutual = true, resumed = false, description, tags, resources, observerStorage, publicObservation) {\n function DataObjectReporter(input) {\n (0, _classCallCheck3.default)(this, DataObjectReporter);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (DataObjectReporter.__proto__ || (0, _getPrototypeOf2.default)(DataObjectReporter)).call(this, input));\n\n var _this = _this2;\n\n _this._subscriptions = {};\n\n _this._syncObj.observe(function (event) {\n log.log('[Syncher.DataObjectReporter] ' + _this.url + ' publish change: ', event);\n _this._onChange(event);\n });\n\n _this._allocateListeners();\n\n _this.invitations = []; // array of promises with pending invitations\n _this._childrenSizeThreshold = 50000; // to be used when replying to sync requests to ensure each response msg is not too large\n\n return _this2;\n }\n\n (0, _createClass3.default)(DataObjectReporter, [{\n key: '_allocateListeners',\n value: function _allocateListeners() {\n (0, _get3.default)(DataObjectReporter.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectReporter.prototype), '_allocateListeners', this).call(this);\n var _this = this;\n\n _this._objectListener = _this._bus.addListener(_this._url, function (msg) {\n log.log('[Syncher.DataObjectReporter] listener ' + _this._url + ' Received: ', msg);\n switch (msg.type) {\n case 'response':\n _this._onResponse(msg);break;\n case 'read':\n _this._onRead(msg);break;\n case 'execute':\n _this._onExecute(msg);break;\n case 'create':\n _this._onChildCreate(msg);break; // to create child objects that were sent whenn offline\n }\n });\n\n _this._runtimeStatusListener = _this._bus.addListener(_this._syncher._runtimeUrl + '/status', function (evt) {\n console.log('[Syncher.DataObjectReporter] runtime status event received ' + evt);\n\n if (evt.body && evt.body.resource && evt.body.resource === _this._url && evt.body.value && evt.body.value.backupRevision) {\n // broadcast backupRevision update\n\n _this.data.backupRevision = evt.body.value.backupRevision;\n console.log('[Syncher.DataObjectReporter] DO updated with backup revision ' + _this.data.backupRevision);\n }\n });\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n (0, _get3.default)(DataObjectReporter.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectReporter.prototype), '_releaseListeners', this).call(this);\n var _this = this;\n\n _this._objectListener.remove();\n }\n\n /**\n * Send invitations (create messages) to hyperties, observers list.\n * @param {HypertyURL[]} observers List of Hyperty URL's\n */\n\n }, {\n key: 'inviteObservers',\n value: function inviteObservers(observers, p2p) {\n var _this = this;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onCreate\n // TODO: remove value and add resources? should similar to 1st create\n\n var toInvite = observers;\n\n // let invitePromises = [];\n\n /* observers.forEach((observer)=> {\n if (!_this.invitations[observer]) {\n toInvite.push(observer);\n _this.invitations[observer] = observer;\n }\n });*/\n\n if (toInvite.length > 0) {\n log.log('[Syncher.DataObjectReporter] InviteObservers ', toInvite, _this._metadata);\n\n toInvite.forEach(function (observer) {\n\n var invitation = new _promise2.default(function (resolve, reject) {\n\n var inviteMsg = {\n type: 'create', from: _this._syncher._owner, to: _this._syncher._subURL,\n body: { resume: false, resource: _this._url, schema: _this._schema, value: _this._metadata, authorise: [observer] }\n };\n\n if (p2p) inviteMsg.body.p2p = p2p;\n\n if (!_this.data.mutual) inviteMsg.body.mutual = _this.data.mutual;\n\n _this._bus.postMessage(inviteMsg, function (reply) {\n log.log('[Syncher.DataObjectReporter] Invitation reply ', reply);\n\n var result = {\n invited: observer,\n code: reply.body && reply.body.code ? reply.body.code : 500,\n desc: reply.body && reply.body.desc ? reply.body.desc : 'Unknown'\n };\n\n if (result.code < 300) resolve(result);else if (result.code >= 300) reject(result);\n });\n });\n\n _this.invitations.push(invitation);\n });\n\n // return(invitePromises);\n }\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n if (_this._heartBeat) _this._heartBeat.stop();\n\n _this._deleteChildrens().then(function (result) {\n log.log(result);\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onDelete\n var deleteMsg = {\n type: 'delete', from: _this._owner, to: _this._syncher._subURL,\n body: { resource: _this._url }\n };\n\n _this._bus.postMessage(deleteMsg, function (reply) {\n log.log('DataObjectReporter-DELETE: ', reply);\n if (reply.body.code === 200) {\n _this._releaseListeners();\n delete _this._syncher._reporters[_this._url];\n\n //_this._syncObj.unobserve();\n _this._syncObj = {};\n }\n });\n });\n }\n\n /**\n * Subscriptions requested and accepted to this reporter\n * @type {Object}\n */\n\n }, {\n key: 'onSubscription',\n\n\n /**\n * Setup the callback to process subscribe and unsubscribe notifications\n * @param {function(event: MsgEvent)} callback function to receive events\n */\n value: function onSubscription(callback) {\n this._onSubscriptionHandler = callback;\n }\n\n /**\n * Setup the callback to process response notifications of the create's\n * @param {function(event: MsgEvent)} callback function to receive events\n */\n\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n this._onResponseHandler = callback;\n }\n\n /**\n * Setup the callback to process read notifications\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onRead',\n value: function onRead(callback) {\n this._onReadHandler = callback;\n }\n\n /**\n * Setup the callback to process execute notifications\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onExecute',\n value: function onExecute(callback) {\n this._onExecuteHandler = callback;\n }\n\n //FLOW-IN: message received from parent Syncher -> _onForward\n\n }, {\n key: '_onForward',\n value: function _onForward(msg) {\n var _this = this;\n\n log.log('DataObjectReporter-RCV: ', msg);\n switch (msg.body.type) {\n case 'subscribe':\n _this._onSubscribe(msg);break;\n case 'unsubscribe':\n _this._onUnSubscribe(msg);break;\n }\n }\n\n //FLOW-IN: message received from this -> _onForward: emitted by a remote Syncher -> subscribe\n\n }, {\n key: '_onSubscribe',\n value: function _onSubscribe(msg) {\n var _this = this;\n var hypertyUrl = msg.body.from;\n var dividedURL = (0, _utils.divideURL)(hypertyUrl);\n var domain = dividedURL.domain;\n var mutual = true;\n\n if (msg.body.hasOwnProperty('mutual') && !msg.body.mutual) mutual = false;\n\n log.log('[DataObjectReporter._onSubscribe]', msg, domain, dividedURL);\n\n var event = {\n type: msg.body.type,\n url: hypertyUrl,\n\n domain: domain,\n\n identity: msg.body.identity,\n\n nutual: mutual,\n\n accept: function accept() {\n //create new subscription\n var sub = { url: hypertyUrl, status: 'live' };\n _this._subscriptions[hypertyUrl] = sub;\n if (_this.metadata.subscriptions) {\n _this.metadata.subscriptions.push(sub.url);\n }\n\n var msgValue = (0, _utils.deepClone)(_this._metadata);\n msgValue.data = (0, _utils.deepClone)(_this.data);\n msgValue.version = _this._version;\n\n //process and send childrens data\n // let childrenValues = {};\n //\n // if (_this._childrenObjects) {\n // Object.keys(_this._childrenObjects).forEach((childrenId) => {\n // let childrenData = _this._childrenObjects[childrenId];\n // childrenValues[childrenId] = deepClone(childrenData);\n // });\n // msgValue.childrenObjects = childrenValues;\n // }\n\n var sendMsg = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, schema: _this._schema, value: msgValue }\n };\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual') && !msg.body.mutual) {\n sendMsg.body.mutual = msg.body.mutual; // TODO: remove?\n _this.data.mutual = false;\n }\n\n if (_this._heartBeat) {\n sendMsg.body.value.childrenObjects = {};\n sendMsg.body.value.childrenObjects.heartbeat = _this._heartBeat.heartbeat;\n }\n\n console.log('[DataObjectReporter._onSubscribe.accept] sending response: ', sendMsg);\n\n //send ok response message\n _this._bus.postMessage(sendMsg);\n\n return sub;\n },\n\n reject: function reject(reason) {\n //send reject response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 403, desc: reason }\n });\n }\n };\n\n if (_this._onSubscriptionHandler) {\n log.log('SUBSCRIPTION-EVENT: ', event);\n _this._onSubscriptionHandler(event);\n }\n }\n\n //FLOW-IN: message received from this -> _onForward: emitted by a remote DataObjectObserver -> unsubscribe\n\n }, {\n key: '_onUnSubscribe',\n value: function _onUnSubscribe(msg) {\n var _this = this;\n var hypertyUrl = msg.body.from;\n var dividedURL = (0, _utils.divideURL)(hypertyUrl);\n var domain = dividedURL.domain;\n\n log.log('[DataObjectReporter._onUnSubscribe]', msg, domain, dividedURL);\n\n //let sub = _this._subscriptions[hypertyUrl];\n delete _this._subscriptions[hypertyUrl];\n delete _this.invitations[hypertyUrl];\n\n var event = {\n type: msg.body.type,\n url: hypertyUrl,\n domain: domain,\n identity: msg.body.identity\n };\n\n // TODO: check if the _onSubscriptionHandler it is the same of the subscriptions???\n if (_this._onSubscriptionHandler) {\n log.log('UN-SUBSCRIPTION-EVENT: ', event);\n _this._onSubscriptionHandler(event);\n }\n }\n\n //FLOW-IN: message received from ReporterURL address: emited by a remote Syncher -> _onRemoteCreate -> event.ack\n\n }, {\n key: '_onResponse',\n value: function _onResponse(msg) {\n var _this = this;\n\n var event = {\n type: msg.type,\n url: msg.from,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n log.log('RESPONSE-EVENT: ', event);\n _this._onResponseHandler(event);\n }\n }\n\n //FLOW-IN: message received from ReporterURL address: emited by a remote Syncher -> read\n\n }, {\n key: '_onRead',\n value: function _onRead(msg) {\n var _this = this;\n var childrensSize = (0, _stringify2.default)(_this.childrensJSON).length;\n\n var largeObject = childrensSize > _this._childrenSizeThreshold ? true : false;\n\n var event = {\n type: msg.type,\n url: msg.from,\n\n accept: function accept() {\n if (largeObject) _this._syncReplyForLargeData(msg);else _this._syncReply(msg);\n },\n\n reject: function reject(reason) {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 401, desc: reason }\n });\n }\n };\n\n // if the requester is an authorised observer, the data object is responded otherwise an event is triggered\n var subscriptions = [];\n\n if (_this.metadata.subscriptions) {\n subscriptions = _this.metadata.subscriptions;\n } else if (_this._subscriptions) {\n subscriptions = (0, _keys2.default)(_this._subscriptions).map(function (key) {\n return _this._subscriptions[key].url;\n });\n }\n\n if (subscriptions.indexOf(msg.from) != -1) {\n if (largeObject) _this._syncReplyForLargeData(msg);else _this._syncReply(msg);\n } else if (_this._onReadHandler) {\n log.log('READ-EVENT: ', event);\n _this._onReadHandler(event);\n }\n }\n }, {\n key: '_syncReply',\n value: function _syncReply(msg) {\n var _this = this;\n\n var objectValue = (0, _utils.deepClone)(_this.metadata);\n\n objectValue.data = (0, _utils.deepClone)(_this.data);\n objectValue.childrenObjects = (0, _utils.deepClone)(_this.childrensJSON);\n\n objectValue.version = _this._version;\n\n var response = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, value: objectValue }\n };\n\n _this._bus.postMessage(response);\n }\n\n // This function is only used if the data object to be synched has childrenOjects too large\n\n }, {\n key: '_syncReplyForLargeData',\n value: function _syncReplyForLargeData(msg) {\n //set attribute with number of spllited messages\n var _this = this;\n\n // lets set the initial message with no childObjects\n\n var objectValue = (0, _utils.deepClone)(_this.metadata);\n\n objectValue.data = (0, _utils.deepClone)(_this.data);\n\n objectValue.version = _this._version;\n\n delete objectValue.childrenObjects;\n\n var children = void 0;\n var values = []; // array of values to be sent in separated responses\n var childrenValue = {}; // value to be used in each response\n\n for (child in _this._childrenObjects) {\n // let child;\n childrenValue[child] = {};\n // for (child in _this._childrenObjects[children]) {\n if ((0, _stringify2.default)(childrenValue).length > _this._childrenSizeThreshold) {\n //childrenValue big enough to be sent in a response message\n values.push(childrenValue);\n // childrenValue = {};\n // childrenValue[child] = {};\n }\n childrenValue[child] = {};\n childrenValue[child].value = _this._childrenObjects[child].metadata;\n childrenValue[child].identity = _this._childrenObjects[child].identity;\n // }\n }\n\n values.push(childrenValue);\n\n objectValue.responses = values.length + 1; //number of responses to be sent\n\n var initialResponse = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 100, value: objectValue }\n };\n\n _this._bus.postMessage(initialResponse);\n\n values.forEach(function (value) {\n\n var response = (0, _utils.deepClone)(initialResponse);\n\n response.body.value = value;\n\n response.body.value.responses = objectValue.responses;\n\n setTimeout(function () {\n _this._bus.postMessage(response);\n }, 50);\n\n // should put a timeout?\n });\n }\n\n // Execute request received\n\n }, {\n key: '_onExecute',\n value: function _onExecute(msg) {\n var _this = this;\n\n if (!msg.body.method) throw '[DataObjectReporter._onExecute] method missing ', msg;\n\n var response = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n };\n\n var event = {\n type: msg.type,\n url: msg.from,\n method: msg.body.method,\n params: msg.body.params,\n\n accept: function accept() {\n _this._bus.postMessage(response);\n },\n\n reject: function reject(reason) {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 401, desc: reason }\n });\n }\n };\n\n if (_this._onExecuteHandler) {\n log.log('[DataObjectReporter] EXECUTE-EVENT: ', event);\n _this._onExecuteHandler(event);\n }\n }\n }, {\n key: 'subscriptions',\n get: function get() {\n return this._subscriptions;\n }\n }, {\n key: 'childrensJSON',\n get: function get() {\n var _this = this;\n var childrens = {};\n\n // let children;\n\n // for (children in _this._childrenObjects) {\n var child = void 0;\n // childrens[children] = {};\n for (child in _this._childrenObjects) {\n childrens[child] = {};\n childrens[child].value = _this._childrenObjects[child].metadata;\n childrens[child].identity = _this._childrenObjects[child].identity;\n }\n // }\n\n return childrens;\n }\n }]);\n return DataObjectReporter;\n}(_DataObject3.default /* implements SyncStatus */);\n\nexports.default = DataObjectReporter;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9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3RoaXMuX21ldGFkYXRhLCBhdXRob3Jpc2U6IFtvYnNlcnZlcl0gfVxuICAgICAgICAgIH07XG5cbiAgICAgICAgICBpZiAocDJwKSBpbnZpdGVNc2cuYm9keS5wMnAgPSBwMnA7XG5cbiAgICAgICAgICBpZiAoIV90aGlzLmRhdGEubXV0dWFsKSBpbnZpdGVNc2cuYm9keS5tdXR1YWwgPSBfdGhpcy5kYXRhLm11dHVhbDtcblxuICAgICAgICAgIF90aGlzLl9idXMucG9zdE1lc3NhZ2UoaW52aXRlTXNnLCAocmVwbHkpPT57XG4gICAgICAgICAgICBsb2cubG9nKCdbU3luY2hlci5EYXRhT2JqZWN0UmVwb3J0ZXJdIEludml0YXRpb24gcmVwbHkgJywgcmVwbHkpO1xuXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgICBpbnZpdGVkOiBvYnNlcnZlcixcbiAgICAgICAgICAgICAgY29kZTogcmVwbHkuYm9keSAmJiByZXBseS5ib2R5LmNvZGUgPyByZXBseS5ib2R5LmNvZGUgOiA1MDAsXG4gICAgICAgICAgICAgIGRlc2M6IHJlcGx5LmJvZHkgJiYgcmVwbHkuYm9keS5kZXNjID8gcmVwbHkuYm9keS5kZXNjIDogJ1Vua25vd24nXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAocmVzdWx0LmNvZGUgPCAzMDApIHJlc29sdmUocmVzdWx0KTtcbiAgICAgICAgICAgIGVsc2UgaWYgKHJlc3VsdC5jb2RlID49IDMwMCkgcmVqZWN0KHJlc3VsdCk7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuXG4gICAgICAgIF90aGlzLmludml0YXRpb25zLnB1c2goaW52aXRhdGlvbik7XG5cbiAgICAgIH0pO1xuXG4gICAgICAvLyAgICAgIHJldHVybihpbnZpdGVQcm9taXNlcyk7XG5cbiAgICB9XG4gIH1cblxuICAvKipcbiAgICogUmVsZWFzZSBhbmQgZGVsZXRlIG9iamVjdCB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UFDQTtBQUNBO0FBQ0E7QUFGQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFmQTtBQUNBO0FBaUJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQTlWQTtBQUFBO0FBQUE7OztBQXdOQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQS9ZQTtBQUNBO0FBdWdCQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///479\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(481), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzJiYTEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2dldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gNDgwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///480\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(482);\nvar $Object = __webpack_require__(11).Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n return $Object.getOwnPropertyDescriptor(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzcyNzkiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvcicpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSkge1xuICByZXR1cm4gJE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ4MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///481\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(50);\nvar $getOwnPropertyDescriptor = __webpack_require__(148).f;\n\n__webpack_require__(138)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzg4ODkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjYgT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihPLCBQKVxudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciAkZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKS5mO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldE93blByb3BlcnR5RGVzY3JpcHRvcicsIGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcihpdCwga2V5KSB7XG4gICAgcmV0dXJuICRnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodG9JT2JqZWN0KGl0KSwga2V5KTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ4MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///482\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Class to handle Children Data Object Heart beats \n * required to manage synchronisation with remote storage servers.\n */\nvar HeartBeat = function () {\n /* private\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the DataObject constructor\n */\n function HeartBeat(bus, hypertyUrl, runtimeUrl, dataObject) {\n var heartBeatRate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 60;\n (0, _classCallCheck3.default)(this, HeartBeat);\n\n var _this = this;\n\n function throwMandatoryParmMissingError(par) {\n throw '[HeartBeat] ' + par + ' mandatory parameter is missing';\n }\n\n bus ? _this._bus = bus : throwMandatoryParmMissingError('bus');\n dataObject ? _this._dataObject = dataObject : throwMandatoryParmMissingError('dataObject');\n heartBeatRate ? _this._heartBeatRate = heartBeatRate : throwMandatoryParmMissingError('heartBeatRate');\n runtimeUrl ? _this._runtimeUrl = runtimeUrl : throwMandatoryParmMissingError('runtimeUrl');\n hypertyUrl ? _this._hypertyUrl = hypertyUrl : throwMandatoryParmMissingError('hypertyUrl');\n\n _this._stop = {\n heartBeat: false,\n sync: function sync(bus) {\n var stopSyncMsg = {\n from: hypertyUrl,\n to: runtimeUrl + '/sm',\n type: 'execute',\n body: {\n method: 'stopSync',\n params: [dataObject.url]\n }\n };\n\n console.log('[Heartbeat.stop.sync()] sending msg:', stopSyncMsg);\n\n bus.postMessage(stopSyncMsg);\n }\n\n };\n }\n\n (0, _createClass3.default)(HeartBeat, [{\n key: 'start',\n value: function start() {\n var lastHeartbeat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n\n this.heartbeat = lastHeartbeat;\n\n console.log('[HeartBeat] starting ... ', lastHeartbeat);\n\n var isHeartBeatActive = this._isHeartBeatActive(this.heartBeat, this._heartBeatRate * 2);\n\n if (!isHeartBeatActive) {\n console.log('[HeartBeat] heart beats are disabled for ', this._dataObject);\n\n // Is disabled: lets start observer heart beat and start synching with remote storage server\n this._stop.heartBeat = this._startHeartBeat(this._heartBeatRate);\n console.log('[HeartBeat] ', this._hypertyUrl, ' started synching with remote storage server');\n this._startSync();\n } else {\n // heart beat is active, \n // it means the data object is already being synchronised with remote storage server\n // we only need to watch the heart beat and try to replace it in case it fails.\n this._watchHeartBeat(this._heartBeatRate, true, this._onHertbeatStopped);\n }\n }\n }, {\n key: 'stop',\n value: function stop() {\n if (this._stop.heartBeat) this._stop.heartBeat();\n\n this._stop.sync(this._bus);\n }\n }, {\n key: 'onNewHeartbeat',\n value: function onNewHeartbeat(heartbeat) {\n this.heartbeat = heartbeat;\n }\n }, {\n key: '_isHeartBeatActive',\n value: function _isHeartBeatActive(lastHeartbeat, maxHeartBeatInterval) {\n var lastHeartPeriodInterval = (0, _utils.secondsSinceEpoch)() - lastHeartbeat;\n console.log('[HeartBeat._isHeartBeatActive] now - lastHeartBeat', lastHeartPeriodInterval);\n\n console.log('[HeartBeat._isHeartBeatActive] ', !(lastHeartPeriodInterval > maxHeartBeatInterval * 2));\n return !(lastHeartPeriodInterval > maxHeartBeatInterval * 2);\n }\n }, {\n key: '_startHeartBeat',\n value: function _startHeartBeat(rate) {\n var _this = this;\n\n var msg = {\n from: _this._hypertyUrl,\n to: _this._dataObject.url + '/children/',\n type: 'create',\n body: {\n resource: 'heartbeat',\n mutual: false,\n value: (0, _utils.secondsSinceEpoch)()\n }\n };\n console.log('[HeartBeat._startHeartBeat] starting ... ');\n\n this._bus.postMessage(msg);\n\n this.heartbeat = (0, _utils.secondsSinceEpoch)();\n\n var id = setInterval(function () {\n\n var msg = {\n from: _this._hypertyUrl,\n to: _this._dataObject.url + '/children/',\n type: 'create',\n body: {\n resource: 'heartbeat',\n mutual: false,\n value: (0, _utils.secondsSinceEpoch)()\n }\n };\n console.log('[HeartBeat] ', msg);\n _this._bus.postMessage(msg);\n this.heartbeat = (0, _utils.secondsSinceEpoch)();\n }, rate * 1000);\n\n // returns function to stop the heart beat\n\n return function () {\n clearInterval(id);\n };\n }\n }, {\n key: '_startSync',\n value: function _startSync() {\n\n console.log('[HeartBeat._startSync] starting observer sync ', this._dataObject.data);\n var backupRevision = this._dataObject.data.backupRevision;\n console.log('[HeartBeat._startSync] backupRevision ', backupRevision);\n var msg = {\n from: this._hypertyUrl,\n to: this._runtimeUrl + '/sm',\n type: 'execute',\n body: {\n method: 'sync',\n params: [this._dataObject.url, backupRevision]\n }\n };\n\n console.log('[HeartBeat._startSync] sending msg ', msg);\n\n this._bus.postMessage(msg);\n }\n }, {\n key: '_watchHeartBeat',\n value: function _watchHeartBeat(rate, onWatchingIsEnabled, callback) {\n // qdo o heartBeat terminar chama callback \n // usa heartBeat Rating para iniciar timer no respectivo \n // campo do DO chamando isHeartBeatActive()\n var _this = this;\n\n var syncFun = callback;\n console.log('[HeartBeat._watchHeartBeat] started watching ', _this.heartBeat);\n\n //let heartBeat = type + 'HeartBeat';\n\n var watcher = setInterval(function () {\n\n if (onWatchingIsEnabled && !_this._isHeartBeatActive(_this.heartBeat, _this._heartBeatRate)) {\n console.log('[HeartBeat._watchHeartBeat] has stopped ', _this._dataObject.data);\n\n clearInterval(watcher);\n syncFun(_this);\n } else if (!onWatchingIsEnabled && this._isHeartBeatActive(_this.heartBeat, _this._heartBeatRate)) {\n console.log('[HeartBeat._watchHeartBeat] has changed to disabled ', _this._dataObject.data);\n\n clearInterval(watcher);\n syncFun();\n }\n }, rate * 1000 * 2);\n }\n }, {\n key: '_onHertbeatStopped',\n value: function _onHertbeatStopped(_this) {\n\n _this._startHeartBeat(_this._heartBeatRate);\n _this._startSync();\n }\n }, {\n key: 'heartBeat',\n get: function get() {\n if (this.heartbeat) return this.heartbeat;else return 0;\n }\n }]);\n return HeartBeat;\n}();\n\nexports.default = HeartBeat;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0hlYXJ0QmVhdC5qcz8yODUzIl0sInNvdXJjZXNDb250ZW50IjpbIlxuXG5pbXBvcnQgeyBzZWNvbmRzU2luY2VFcG9jaCB9IGZyb20gJy4uL3V0aWxzL3V0aWxzLmpzJztcblxuLyoqXG4gKiBDbGFzcyB0byBoYW5kbGUgQ2hpbGRyZW4gRGF0YSBPYmplY3QgSGVhcnQgYmVhdHMgXG4gKiByZXF1aXJlZCB0byBtYW5hZ2Ugc3luY2hyb25pc2F0aW9uIHdpdGggcmVtb3RlIHN0b3JhZ2Ugc2VydmVycy5cbiAqL1xuY2xhc3MgSGVhcnRCZWF0IHtcbiAgLyogcHJpdmF0ZVxuXG4gICovXG5cbiAgLyoqXG4gICAqIEBpZ25vcmVcbiAgICogU2hvdWxkIG5vdCBiZSB1c2VkIGRpcmVjdGx5IGJ5IEh5cGVydGllcy4gSXQncyBjYWxsZWQgYnkgdGhlIERhdGFPYmplY3QgY29uc3RydWN0b3JcbiAgICovXG4gIGNvbnN0cnVjdG9yKGJ1cywgaHlwZXJ0eVVybCwgcnVudGltZVVybCwgZGF0YU9iamVjdCwgaGVhcnRCZWF0UmF0ZS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pack-internal:///483\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _FileHypertyResource = __webpack_require__(485);\n\nvar _FileHypertyResource2 = _interopRequireDefault(_FileHypertyResource);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HypertyResourceFactory = function () {\n\n /**\n * HypertyResourceFactory constructor\n *\n */\n\n function HypertyResourceFactory() {\n (0, _classCallCheck3.default)(this, HypertyResourceFactory);\n }\n\n (0, _createClass3.default)(HypertyResourceFactory, [{\n key: 'createHypertyResource',\n value: function createHypertyResource(isSender, type, metadata) {\n var newHypertyResource = void 0;\n\n switch (type) {\n case 'file':\n newHypertyResource = new _FileHypertyResource2.default(isSender, metadata);\n break;\n default:\n throw new Error('[HypertyResourceFactory.createHypertyResource] not supported type: ', type);\n break;\n }\n\n return newHypertyResource;\n }\n }, {\n key: 'createHypertyResourceWithContent',\n value: function createHypertyResourceWithContent(isSender, type, content, metadata) {\n var newHypertyResource = void 0;\n\n return new _promise2.default(function (resolve) {\n\n switch (type) {\n case 'file':\n newHypertyResource = new _FileHypertyResource2.default(isSender, metadata);\n break;\n default:\n reject();\n break;\n }\n\n newHypertyResource.init(content).then(function () {\n return newHypertyResource.save(); // skip save?\n }).then(function () {\n resolve(newHypertyResource);\n });\n });\n }\n }]);\n return HypertyResourceFactory;\n}(); /**\n * The Hyperty Resource Data Model is used to model resouces handled by Hyperties and Data Objects including chat messages, files, real time human audio and video..\n *\n */\n\nexports.default = HypertyResourceFactory;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64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S0E7QUFBQTtBQUVBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTkE7QUFDQTtBQVFBO0FBRUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQU5BO0FBQ0E7QUFRQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTs7O0FBeERBOzs7OztBQTJEQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///484\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _HypertyResource2 = __webpack_require__(486);\n\nvar _HypertyResource3 = _interopRequireDefault(_HypertyResource2);\n\nvar _utils = __webpack_require__(6);\n\nvar _ImageTools = __webpack_require__(487);\n\nvar _ImageTools2 = _interopRequireDefault(_ImageTools);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('FileHypertyResource'); /**\n * The Hyperty Resource Data Model is used to model resouces handled by Hyperties and Data Objects including chat messages, files, real time human audio and video..\n *\n */\n\n// Log System\n\nvar FileHypertyResource = function (_HypertyResource) {\n (0, _inherits3.default)(FileHypertyResource, _HypertyResource);\n\n /**\n * FileHypertyResource constructor\n *\n * @param {URL} owner HypertyURL of the Hyperty handling this resource\n * @param {URL} runtime Runtime URL where this resource is hosted\n * @param {Bus} bus sandbox message bus\n * @param {DataObject} parent Parent Data Object where the HypertyResource is handled as a child\n * @param {File} file file to be encoded as HypertyResource\n * @param {Boolean} isReporter indicates if parent is Reporter or an Observer\n * @param {Array} input optional input parameters\n */\n\n function FileHypertyResource(isSender, input) {\n (0, _classCallCheck3.default)(this, FileHypertyResource);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (FileHypertyResource.__proto__ || (0, _getPrototypeOf2.default)(FileHypertyResource)).call(this, isSender, input));\n\n var _this = _this2;\n\n _this.metadata.resourceType = 'file';\n\n return _this2;\n }\n\n (0, _createClass3.default)(FileHypertyResource, [{\n key: 'init',\n value: function init(file) {\n var _this = this;\n\n if (!file) throw new Error('[FileHypertyResource.constructor] missing mandatory *file* input ');\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._metadata.name = file.name;\n _this._metadata.lastModified = file.lastModified;\n _this._metadata.size = file.size;\n _this._metadata.mimetype = file.type;\n\n log.log('[FileHypertyResource.init] file: ', file);\n\n if (_this._isSender) {\n\n var mimetype = file.type.split('/')[0];\n\n switch (mimetype) {\n case 'image':\n _this._getImagePreview(file).then(function (preview) {\n _this._metadata.preview = preview;\n _this._content = file;\n resolve();\n });\n break;\n default:\n _this._content = file;\n resolve();\n break;\n }\n\n // if too big lets store as File and asArray Buffer\n\n // if (file.size > _this.arraybufferSizeLimit) {\n /* } else {\n let reader = new FileReader();\n reader.onload = function(theFile) {\n log.log('[FileHypertyResource.init] file loaded ', theFile);\n _this._content = theFile.target.result;\n resolve();\n }\n reader.readAsArrayBuffer(file);\n }*/\n } else {\n _this._content = file.content;\n if (file.preview) _this._metadata.preview = file.preview;\n resolve();\n }\n });\n }\n }, {\n key: '_getImagePreview',\n value: function _getImagePreview(image) {\n var reader = new FileReader();\n return new _promise2.default(function (resolve, reject) {\n\n _ImageTools2.default.resize(image, {\n width: 100, // maximum width\n height: 100 // maximum height\n }, function (blob, didItResize) {\n // didItResize will be true if it managed to resize it, otherwise false (and will return the original file as 'blob')\n if (didItResize) {\n reader.readAsDataURL(blob);\n\n reader.onload = function (theImage) {\n resolve(theImage.target.result);\n };\n } else {\n log.warn('[FileHypertyResource._getImagePreview] unable to create image preview from original image ');\n resolve(undefined);\n }\n });\n });\n }\n }, {\n key: 'toMessage',\n\n\n /**\n * Share file as a data object child of a data object parent\n *\n * @param {string} children Data Object Parent children name where the file is shared\n */\n\n /* share(children) {\n let _this = this;\n \n return new Promise(function(resolve, reject) {\n //to be improved and adapted\n \n if (!_this._isSender) return reject('[FileHypertyResource.share] Observers can not share files');\n \n let file2share = _this._metadata;\n file2share.type = _this._type;\n \n _this._parent.addChild(children, file2share).then(function(dataObjectChild) {\n log.log('[FileHypertyResource.share] object child: ', dataObjectChild);\n \n let sharedFile = dataObjectChild.data;\n \n resolve(sharedFile);\n \n }).catch(function(reason) {\n log.error('Reason:', reason);\n reject(reason);\n });\n \n });\n \n }*/\n\n /**\n * Returns file content optimised to be displayed in a message line\n *\n * @param {string} children Data Object Parent children name where the file is shared\n */\n\n value: function toMessage() {\n //TODO: to be implemented. It should return HTML with img attribute as a thumbnail plus the name.\n }\n }, {\n key: 'name',\n get: function get() {\n var _this = this;\n return _this._metadata.name;\n }\n }, {\n key: 'preview',\n get: function get() {\n var _this = this;\n return _this._metadata.preview;\n }\n }]);\n return FileHypertyResource;\n}(_HypertyResource3.default);\n\nexports.default = FileHypertyResource;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0ZpbGVIeXBlcnR5UmVzb3VyY2UuanM/ZjM5YiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogVGhlIEh5cGVydHkgUmVzb3VyY2UgRGF0YSBNb2RlbCBpcyB1c2VkIHRvIG1vZGVsIHJlc291Y2VzIGhhbmRsZWQgYnkgSHlwZXJ0aWVzIGFuZCBEYXRhIE9iamVjdHMgaW5jbHVkaW5nIGNoYXQgbWVzc2FnZXMsIGZpbGVzLCByZWFsIHRpbWUgaHVtYW4gYXVkaW8gYW5kIHZpZGVvLi5cbipcbiovXG5cbi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignRmlsZUh5cGVydHlSZXNvdXJjZScpO1xuXG5pbXBvcnQgSHlwZXJ0eVJlc291cmNlIGZyb20gJy4vSHlwZXJ0eVJlc291cmNlJztcbmltcG9ydCB7IGRlZXBDbG9uZSB9IGZyb20gJy4uL3V0aWxzL3V0aWxzLmpzJztcbmltcG9ydCBJbWFnZVRvb2xzIGZyb20gJy4uL3V0aWxzL0ltYWdlVG9vbHMuanMnO1xuXG5cbmNsYXNzIEZpbGVIeXBlcnR5UmVzb3VyY2UgZXh0ZW5kcyBIeXBlcnR5UmVzb3VyY2Uge1xuXG4gIC8qKlxuICAqIEZpbGVIeXBlcnR5UmVzb3VyY2UgY29uc3RydWN0b3JcbiAgKlxuICAqIEBwYXJhbSAge1VSTH0gb3duZXIgSHlwZXJ0eVVSTCBvZiB0aGUgSHlwZXJ0eSBoYW5kbGluZyB0aGlzIHJlc291cmNlXG4gICogQHBhcmFtICB7VVJMfSByd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BQU1BOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUEyQkE7Ozs7OztBQU1BO0FBQ0E7QUFDQTs7O0FBbkRBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBdEhBO0FBQ0E7QUFxS0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///485\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DataObjectChild2 = __webpack_require__(208);\n\nvar _DataObjectChild3 = _interopRequireDefault(_DataObjectChild2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('HypertyResource'); /**\n * The Hyperty Resource Data Model is used to model resouces handled by Hyperties and Data Objects including chat messages, files, real time human audio and video..\n *\n */\n\n// Log System\n\nvar HypertyResource = function (_DataObjectChild) {\n (0, _inherits3.default)(HypertyResource, _DataObjectChild);\n\n /**\n * HypertyResource constructor\n *\n * @param {URL} localRuntimeURL RuntimeURL of local runtime\n * @param {URL} input.owner HypertyURL of the Hyperty handling this resource\n * @param {URL} input.runtime Runtime URL where this resource is hosted\n * @param {Bus} input.bus sandbox message bus\n * @param {DataObject} input.parent Parent Data Object where the HypertyResource is handled as a child\n * @param {Boolean} isSender indicates if parent is Reporter or an Observer\n * @param {Array} input optional input parameters\n */\n\n function HypertyResource(isSender, input) {\n (0, _classCallCheck3.default)(this, HypertyResource);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (HypertyResource.__proto__ || (0, _getPrototypeOf2.default)(HypertyResource)).call(this, input));\n\n var _this = _this2;\n\n _this.arraybufferSizeLimit = 5242880; //above this limit content is not saved as ArrayBuffer\n\n _this._isSender = isSender;\n\n _this._localStorageURL = _this._parentObject._syncher._runtimeUrl + '/storage';\n\n return _this2;\n }\n\n (0, _createClass3.default)(HypertyResource, [{\n key: 'save',\n\n\n /*\n set parent(parent) {\n let _this = this;\n _this._parent = parent;\n }*/\n\n value: function save() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n from: _this._owner,\n to: _this._localStorageURL,\n type: 'create',\n body: { value: (0, _utils.deepClone)(_this._metadata) }\n };\n\n var callback = function callback(reply) {\n log.info('[HypertyResource.save] reply: ', reply);\n _this._bus.removeResponseListener(_this._owner, reply.id);\n if (reply.body.code === 200) {\n if (reply.body.value) {\n if (!_this._metadata.contentURL) _this._metadata.contentURL = [];\n _this._metadata.contentURL.push(reply.body.value);\n }\n resolve();\n } else reject(reply.body.code + ' ' + reply.body.desc);\n };\n\n msg.body.value.content = _this._content;\n\n _this._bus.postMessage(msg, callback, false);\n });\n }\n\n /**\n * Function to Read HypertyResource\n *\n * @param {} callback callback to be called with progress information in terms of percentage\n * @return {Promise} input optional input parameters\n */\n\n }, {\n key: 'read',\n value: function read(callback) {\n var _this = this;\n log.info('[HypertyResource.read] ', this);\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.content) {\n resolve(_this);\n } else {\n\n //TODO: use an iteration to get online runtime storages when some are offline\n var storage = _this._getBestContentURL(_this._metadata.contentURL);\n\n log.log('Storage:', storage);\n\n var msg = {\n from: _this._owner,\n to: storage.url,\n type: 'read',\n body: { resource: storage.url + '/' + storage.resource, p2p: true }\n };\n\n if (_this.metadata.p2pRequester && _this.metadata.p2pHandler) {\n msg.body.p2pRequester = _this.metadata.p2pRequester;\n msg.body.p2pHandler = _this.metadata.p2pHandler;\n }\n\n // get the resource first on the Local Hyperty Resource Storage;\n _this._getBestResource(msg, callback).then(function (reply) {\n log.info('[HypertyResource] - get locally the resource:', reply);\n resolve(_this);\n }).catch(function (reply) {\n\n log.warn('[HypertyResource] - get locally the resource fail', reply);\n\n // Generate new message to not use the same id of the last one;\n var msg = {\n from: _this._owner,\n to: storage.remoteURL,\n type: 'read',\n body: { resource: storage.remoteURL + '/' + storage.resource, p2p: true }\n };\n\n if (_this.metadata.p2pRequester && _this.metadata.p2pHandler) {\n msg.body.p2pRequester = _this.metadata.p2pRequester;\n msg.body.p2pHandler = _this.metadata.p2pHandler;\n }\n\n // get the resource on the Remote Hyperty Resource Storage;\n _this._getBestResource(msg, callback).then(function (reply) {\n log.warn('[HypertyResource] - get remotely the resource', reply);\n resolve(_this);\n }).catch(function (reply) {\n log.warn('[HypertyResource] - get remotely the resource fail', reply);\n reject(reply.body.code + ' ' + reply.body.desc);\n });\n });\n }\n });\n }\n }, {\n key: '_getBestResource',\n value: function _getBestResource(msg, inProgressCallback) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var waitForResponse = setTimeout(function () {\n\n // If Reporter does not reply the promise is rejected\n _this._bus.removeResponseListener(_this._owner, id);\n\n msg.body.code = 408;\n msg.body.desc = 'Response timeout';\n\n return reject(msg);\n }, 3000);\n\n var callback = function callback(reply) {\n log.log('[HypertyResource.read] reply: ', reply);\n var id = reply.id;\n\n clearTimeout(waitForResponse);\n\n switch (reply.body.code) {\n case 200:\n _this._content = reply.body.value.content;\n\n // save locally if not too big\n if (reply.body.value.size < _this.arraybufferSizeLimit) {\n _this.save();\n }\n\n _this._bus.removeResponseListener(_this._owner, id);\n resolve(reply);\n\n break;\n\n case 183:\n inProgressCallback(reply.body.value);\n break;\n\n default:\n _this._bus.removeResponseListener(_this._owner, id);\n reject(reply);\n break;\n }\n };\n\n var id = _this._bus.postMessage(msg, callback, false);\n });\n }\n\n // Remove Hyperty from the local storage\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n log.info('[HypertyResource.delete]', _this.metadata);\n\n var msg = {\n from: _this._owner,\n to: _this._localStorageURL,\n type: 'delete',\n body: { resources: _this.metadata.contentURL }\n };\n\n return new _promise2.default(function (resolve) {\n _this._bus.postMessage(msg, function (reply) {\n if (reply.body.code < 300) resolve(true);else resolve(false);\n });\n });\n }\n }, {\n key: '_getBestContentURL',\n value: function _getBestContentURL(contentURLList) {\n\n var _this = this;\n\n var contentURL = contentURLList[0];\n var splitedResource = contentURL.substr(contentURL.lastIndexOf('/') + 1);\n var url = _this._localStorageURL; // contentURL.substr(0, contentURL.lastIndexOf('/'));\n var remoteResource = contentURL.substr(0, contentURL.lastIndexOf('/'));\n\n return { url: url, resource: splitedResource, remoteURL: remoteResource };\n }\n }, {\n key: 'resourceType',\n get: function get() {\n var _this = this;\n return _this.metadata.resourceType;\n }\n }, {\n key: 'mimetype',\n get: function get() {\n var _this = this;\n return _this._metadata.type;\n }\n }, {\n key: 'content',\n get: function get() {\n var _this = this;\n return _this._content;\n }\n }, {\n key: 'contentURL',\n get: function get() {\n var _this = this;\n return _this._metadata.contentURL;\n }\n }, {\n key: 'shareable',\n get: function get() {\n var _this = this;\n var shareable = (0, _get3.default)(HypertyResource.prototype.__proto__ || (0, _getPrototypeOf2.default)(HypertyResource.prototype), 'metadata', this);\n shareable.resourceType = _this.resourceType;\n return shareable;\n }\n }]);\n return HypertyResource;\n}(_DataObjectChild3.default);\n\nexports.default = HypertyResource;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0h5cGVydHlSZXNvdXJjZS5qcz82NWVjIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBUaGUgSHlwZXJ0eSBSZXNvdXJjZSBEYXRhIE1vZGVsIGlzIHVzZWQgdG8gbW9kZWwgcmVzb3VjZXMgaGFuZGxlZCBieSBIeXBlcnRpZXMgYW5kIERhdGEgT2JqZWN0cyBpbmNsdWRpbmcgY2hhdCBtZXNzYWdlcywgZmlsZXMsIHJlYWwgdGltZSBodW1hbiBhdWRpbyBhbmQgdmlkZW8uLlxuKlxuKi9cblxuLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdIeXBlcnR5UmVzb3VyY2UnKTtcblxuaW1wb3J0IHsgZGVlcENsb25lIH0gZnJvbSAnLi4vdXRpbHMvdXRpbHMuanMnO1xuaW1wb3J0IERhdGFPYmplY3RDaGlsZCBmcm9tICcuLi9zeW5jaGVyL0RhdGFPYmplY3RDaGlsZC5qcyc7XG5cbmNsYXNzIEh5cGVydHlSZXNvdXJjZSBleHRlbmRzIERhdGFPYmplY3RDaGlsZCB7XG5cbiAgLyoqXG4gICogSHlwZXJ0eVJlc291cmNlIGNvbnN0cnVjdG9yXG4gICpcbiAgKiBAcGFyYW0gIHtVUkx9IGxvY2FsUnVudGltZVVSTCBSdW50aW1lVVJMIG9mIGxvY2FsIHJ1bnRpbWVcbiAgKiBAcGFyY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R5LmRlc2MgPSAnUmVzcG9uc2UgdGltZW91dCdcblxuICAgICAgICByZXR1cm4gcmVqZWN0KG1zZyk7XG5cbiAgICAgIH0sIDMwMDApO1xuXG4gICAgICBsZXQgY2FsbGJhY2sgPSAocmVwbHkpID0+IHtcbiAgICAgICAgbG9nLmxvZygnW0h5cGVydHlSZXNvdXJjZS5yZWFkXSByZXBseTogJywgcmVwbHkpO1xuICAgICAgICBsZXQgaWQgPSByZXBseS5pZDtcblxuICAgICAgICBjbGVhclRpbWVvdXQod2FpdEZvclJlc3BvbnNlKTtcblxuICAgICAgICBzd2l0Y2ggKHJlcGx5LmJvZHkuY29kZSkge1xuICAgICAgICAgIGNhc2UgMjAwOlxuICAgICAgICAgICAgX3RoaXMuX2NvbnRlbnQgPSByZXBseS5ib2R5LnZhbHVlLmNvbnRlbnQ7XG5cbiAgICAgICAgICAgIC8vIHNhdmUgbG9jYWxseSBpZiBub3QgdG9vIGJpZ1xuICAgICAgICAgICAgaWYgKHJlcGx5LmJvZHkudmFsdWUuc2l6ZSA8IF90aGlzLmFycmF5YnVmZmVyU2l6ZUxpbWl0KSB7XG4gICAgICAgICAgICAgIF90aGlzLnNhdmUoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgX3RoaXMuX2J1cy5yZW1vdmVSZXNwb25zZUxpc3RlbmVyKF90aGlzLl9vd25lciwgaWQpO1xuICAgICAgICAgICAgcmVzb2x2ZShyZXBseSk7XG5cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAxODM6XG4gICAgICAgICAgICBpblByb2dyZXNzQ2FsbGJhY2socmVwbHkuYm9keS52YWx1ZSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgICAgICAgIGRlZmF1bHQ6XG4gICAgICAgICAgICBfdGhpcy5fYnVzLnJlbW92ZVJlc3BvbnNlTGlzdGVuZXIoX3RoaXMuX293bmVyLCBpZCk7XG4gICAgICAgICAgICByZWplY3QocmVwbHkpO1xuICAgIC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Ozs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBbkRBO0FBQ0E7QUFnUUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///486\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar hasBlobConstructor = typeof Blob !== 'undefined' && function () {\n try {\n return Boolean(new Blob());\n } catch (e) {\n return false;\n }\n}();\n\nvar hasArrayBufferViewSupport = hasBlobConstructor && typeof Uint8Array !== 'undefined' && function () {\n try {\n return new Blob([new Uint8Array(100)]).size === 100;\n } catch (e) {\n return false;\n }\n}();\n\nvar hasToBlobSupport = typeof HTMLCanvasElement !== \"undefined\" ? HTMLCanvasElement.prototype.toBlob : false;\n\nvar hasBlobSupport = hasToBlobSupport || typeof Uint8Array !== 'undefined' && typeof ArrayBuffer !== 'undefined' && typeof atob !== 'undefined';\n\nvar hasReaderSupport = typeof FileReader !== 'undefined' || typeof URL !== 'undefined';\n\nvar ImageTools = function () {\n function ImageTools() {\n (0, _classCallCheck3.default)(this, ImageTools);\n }\n\n (0, _createClass3.default)(ImageTools, null, [{\n key: 'resize',\n value: function resize(file, maxDimensions, callback) {\n if (typeof maxDimensions === 'function') {\n callback = maxDimensions;\n maxDimensions = {\n width: 640,\n height: 480\n };\n }\n\n var maxWidth = maxDimensions.width;\n var maxHeight = maxDimensions.height;\n\n if (!ImageTools.isSupported() || !file.type.match(/image.*/)) {\n callback(file, false);\n return false;\n }\n\n if (file.type.match(/image\\/gif/)) {\n // Not attempting, could be an animated gif\n callback(file, false);\n // TODO: use https://github.com/antimatter15/whammy to convert gif to webm\n return false;\n }\n\n var image = document.createElement('img');\n\n image.onload = function (imgEvt) {\n var width = image.width;\n var height = image.height;\n var isTooLarge = false;\n\n if (width >= height && width > maxDimensions.width) {\n // width is the largest dimension, and it's too big.\n height *= maxDimensions.width / width;\n width = maxDimensions.width;\n isTooLarge = true;\n } else if (height > maxDimensions.height) {\n // either width wasn't over-size or height is the largest dimension\n // and the height is over-size\n width *= maxDimensions.height / height;\n height = maxDimensions.height;\n isTooLarge = true;\n }\n\n if (!isTooLarge) {\n // early exit; no need to resize\n callback(file, false);\n return;\n }\n\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n\n var ctx = canvas.getContext('2d');\n ctx.drawImage(image, 0, 0, width, height);\n\n if (hasToBlobSupport) {\n canvas.toBlob(function (blob) {\n callback(blob, true);\n }, file.type);\n } else {\n var blob = ImageTools._toBlob(canvas, file.type);\n callback(blob, true);\n }\n };\n ImageTools._loadImage(image, file);\n\n return true;\n }\n }, {\n key: '_toBlob',\n value: function _toBlob(canvas, type) {\n var dataURI = canvas.toDataURL(type);\n var dataURIParts = dataURI.split(',');\n var byteString = void 0;\n if (dataURIParts[0].indexOf('base64') >= 0) {\n // Convert base64 to raw binary data held in a string:\n byteString = atob(dataURIParts[1]);\n } else {\n // Convert base64/URLEncoded data component to raw binary data:\n byteString = decodeURIComponent(dataURIParts[1]);\n }\n var arrayBuffer = new ArrayBuffer(byteString.length);\n var intArray = new Uint8Array(arrayBuffer);\n\n for (var i = 0; i < byteString.length; i += 1) {\n intArray[i] = byteString.charCodeAt(i);\n }\n\n var mimeString = dataURIParts[0].split(':')[1].split(';')[0];\n var blob = null;\n\n if (hasBlobConstructor) {\n blob = new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], { type: mimeString });\n } else {\n var bb = new BlobBuilder();\n bb.append(arrayBuffer);\n blob = bb.getBlob(mimeString);\n }\n\n return blob;\n }\n }, {\n key: '_loadImage',\n value: function _loadImage(image, file, callback) {\n if (typeof URL === 'undefined') {\n var reader = new FileReader();\n reader.onload = function (evt) {\n image.src = evt.target.result;\n if (callback) {\n callback();\n }\n };\n reader.readAsDataURL(file);\n } else {\n image.src = URL.createObjectURL(file);\n if (callback) {\n callback();\n }\n }\n }\n }, {\n key: 'isSupported',\n value: function isSupported() {\n return typeof HTMLCanvasElement !== 'undefined' && hasBlobSupport && hasReaderSupport;\n }\n }]);\n return ImageTools;\n}();\n\nexports.default = ImageTools;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9JbWFnZVRvb2xzLmpzPzVmMDkiXSwic291cmNlc0NvbnRlbnQiOlsibGV0IGhhc0Jsb2JDb25zdHJ1Y3RvciA9IHR5cGVvZihCbG9iKSAhPT0gJ3VuZGVmaW5lZCcgJiYgKGZ1bmN0aW9uICgpIHtcbiAgICB0cnkge1xuICAgICAgICByZXR1cm4gQm9vbGVhbihuZXcgQmxvYigpKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG59KCkpO1xuXG5sZXQgaGFzQXJyYXlCdWZmZXJWaWV3U3VwcG9ydCA9IGhhc0Jsb2JDb25zdHJ1Y3RvciAmJiB0eXBlb2YoVWludDhBcnJheSkgIT09ICd1bmRlZmluZWQnICYmIChmdW5jdGlvbiAoKSB7XG4gICAgdHJ5IHtcbiAgICAgICAgcmV0dXJuIG5ldyBCbG9iKFtuZXcgVWludDhBcnJheSgxMDApXSkuc2l6ZSA9PT0gMTAwO1xuICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbn0oKSk7XG5cbmxldCBoYXNUb0Jsb2JTdXBw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BjYWxsYmFjayhmaWxlLCBmYWxzZSk7XG4gICAgICAgICAgICByZXR1cm4gZmFsc2U7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZmlsZS50eXBlLm1hdGNoKC9pbWFnZVxcL2dpZi8pKSB7XG4gICAgICAgICAgICAvLyBOb3QgYXR0ZW1wdGluZywgY291bGQgYmUgYW4gYW5pbWF0ZWQgZ2lmXG4gICAgICAgICAgICBjYWxsYmFjayhmaWxlLCBmYWxzZSk7XG4gICAgICAgICAgICAvLyBUT0RPOiB1c2UgaHR0cHM6Ly9naXRodWIuY29tL2FudGltYXR0ZXIxNS93aGFtbXkgdG8gY29udmVydCBnaWYgdG8gd2VibVxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IGltYWdlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaW1nJyk7XG4gICAgICAgICAgICBcbiAgICAgICAgaW1hZ2Uub25sb2FkID0gKGltZ0V2dCkgPT4ge1xuICAgICAgICAgICAgbGV0IHdpZHRoICA9IGltYWdlLndpZHRoO1xuICAgICAgICAgICAgbGV0IGhlaWdodCA9IGltYWdlLmhlaWdodDtcbiAgICAgICAgICAgIGxldCBpc1Rvb0xhcmdlID0gZmFsc2U7XG5cbiAgICAgICAgICAgIGlmICh3aWR0aCA+PSBoZWlnaHQgJiYgd2lkdGggPiBtYXhEaW1lbnNpb25zLndpZHRoKSB7XG4gICAgICAgICAgICAgICAgLy8gd2lkdGggaXMgdGhlIGxhcmdlc3QgZGltZW5zaW9uLCBhbmQgaXQncyB0b28gYmlnLlxuICAgICAgICAgICAgICAgIGhlaWdodCAqPSBtYXhEaW1lbnNpb25zLndpZHRoIC8gd2lkdGg7XG4gICAgICAgICAgICAgICAgd2lkdGggPSBtYXhEaW1lbnNpb25zLndpZHRoO1xuICAgICAgICAgICAgICAgIGlzVG9vTGFyZ2UgPSB0cnVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChoZWlnaHQgPiBtYXhEaW1lbnNpb25zLmhlaWdodCkge1xuICAgICAgICAgICAgICAgIC8vIGVpdGhlciB3aWR0aCB3YXNuJ3Qgb3Zlci1zaXplIG9yIGhlaWdodCBpcyB0aGUgbGFyZ2VzdCBkaW1lbnNpb25cbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIGhlaWdodCBpcyBvdmVyLXNpemVcbiAgICAgICAgICAgICAgICB3aWR0aCAqPSBtYXhEaW1lbnNpb25zLmhlaWdodCAvIGhlaWdodDtcbiAgICAgICAgICAgICAgICBoZWlnaHQgPSBtYXhEaW1lbnNpb25zLmhlaWdodDtcbiAgICAgICAgICAgICAgICBpc1Rvb0xhcmdlID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFpc1Rvb0xhcmdlKSB7XG4gICAgICAgICAgICAgICAgLy8gZWFybHkgZXhpdDsgbm8gbmVlZCB0byByZXNpemVcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhmaWxlLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsZXQgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICBjYW52YXMud2lkdGggPSB3aWR0aDtcbiAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG5cbiAgICAgICAgICAgIGxldCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcbiAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1hZ2UsIDAsIDAsIHdpZHRoLCBoZWlnaHQpO1xuXG4gICAgICAgICAgICBpZiAoaGFzVG9CbG9iU3VwcG9ydCkge1xuICAgICAgICAgICAgICAgIGNhbnZhcy50b0Jsb2IoKGJsb2IpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2soYmxvYiwgdHJ1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gIGxldCBpbnRBcnJheSA9IG5ldyBVaW50OEFycmF5KGFycmF5QnVmZmVyKTtcblxuICAgICAgICBmb3IgKGxldCBpID0gMDsgaSA8IGJ5dGVTdHJpbmcubGVuZ3RoOyBpICs9IDEpIHtcbiAgICAgICAgICAgIGludEFycmF5W2ldID0gYnl0ZVN0cmluZy5jaGFyQ29kZUF0KGkpO1xuICAgICAgICB9XG5cbiAgICAgICAgbGV0IG1pbWVTdHJpbmcgPSBkYXRhVVJJUGFydHNbMF0uc3BsaXQoJzonKVsxXS5zcGxpdCgnOycpWzBdO1xuICAgICAgICBsZXQgYmxvYiA9IG51bGw7XG5cbiAgICAgICAgaWYgKGhhc0Jsb2JDb25zdHJ1Y3Rvcikge1xuICAgICAgICAgICAgYmxvYiA9IG5ldyBCbG9iKFxuICAgICAgICAgICAgICAgIFtoYXNBcnJheUJ1ZmZlclZpZXdTdXBwb3J0ID8gaW50QXJyYXkgOiBhcnJheUJ1ZmZlcl0sXG4gICAgICAgICAgICAgICAge3R5cGU6IG1pbWVTdHJpbmd9XG4gICAgICAgICAgICApO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgbGV0IGJiID0gbmV3IEJsb2JCdWlsZGVyKCk7XG4gICAgICAgICAgICBiYi5hcHBlbmQoYXJyYXlCdWZmZXIpO1xuICAgICAgICAgICAgYmxvYiA9IGJiLmdldEJsb2IobWltZVN0cmluZyk7XG4gICAgICAgIH1cblxuICAgICAgICByZXR1cm4gYmxvYjtcbiAgICB9XG5cbiAgICBzdGF0aWMgX2xvYWRJbWFnZShpbWFnZSwgZmlsZSwgY2FsbGJhY2spIHtcbiAgICAgICAgaWYgKHR5cGVvZihVUkwpID09PSAndW5kZWZpbmVkJykge1xuICAgICAgICAgICAgbGV0IHJlYWRlciA9IG5ldyBGaWxlUmVhZGVyKCk7XG4gICAgICAgICAgICByZWFkZXIub25sb2FkID0gZnVuY3Rpb24oZXZ0KSB7XG4gICAgICAgICAgICAgICAgaW1hZ2Uu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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUtBOzs7OztBQS9IQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///487\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DataObject2 = __webpack_require__(206);\n\nvar _DataObject3 = _interopRequireDefault(_DataObject2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectObserver'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n\nvar FilterType = { ANY: 'any', START: 'start', EXACT: 'exact' };\n\n/**\n * The class returned from the Syncher subscribe call.\n * To be used as an observation point from a DataObjectReporter change.\n */\n\nvar DataObjectObserver = function (_DataObject) {\n (0, _inherits3.default)(DataObjectObserver, _DataObject);\n\n /* private\n _changeListener: MsgListener\n ----event handlers----\n _filters: {: {type: , callback: } }\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the Syncher.subscribe method\n */\n\n //TODO: For Further Study\n function DataObjectObserver(input) {\n (0, _classCallCheck3.default)(this, DataObjectObserver);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (DataObjectObserver.__proto__ || (0, _getPrototypeOf2.default)(DataObjectObserver)).call(this, input));\n //todo: check why\n //input.initialData = input.initialData.data;\n\n var _this = _this2;\n\n _this._version = input.version;\n _this._filters = {};\n\n _this._syncObj.observe(function (event) {\n _this._onFilter(event);\n });\n\n _this._allocateListeners();\n return _this2;\n }\n\n /**\n * Sync Data Object Observer with last version of Data Object Reporter. Useful for Resumes\n */\n\n\n (0, _createClass3.default)(DataObjectObserver, [{\n key: 'sync',\n value: function sync() {\n\n var _this = this;\n log.info('[DataObjectObserver_sync] synchronising ');\n\n return new _promise2.default(function (resolve, reject) {\n\n var criteria = {};\n\n // if (this.metadata.backupRevision) criteria.backupRevision = this.metadata.backupRevision;\n\n _this._syncher.read(_this._metadata.url, criteria).then(function (value) {\n log.info('[DataObjectObserver_sync] value to sync: ', value);\n\n (0, _assign2.default)(_this.data, (0, _utils.deepClone)(value.data));\n\n _this._version = value.version;\n\n _this._metadata.lastModified = value.lastModified;\n\n //TODO: check first if there are new childrenObjects to avoid overhead\n\n if (value.childrenObjects) {\n _this.resumeChildrens(value.childrenObjects);\n _this._storeChildrens();\n resolve(true);\n } else resolve(true);\n\n /*if (value.version != _this._version) {\n log.info('[DataObjectObserver_sync] updating existing data: ', _this.data);\n Object.assign(_this.data || {}, deepClone(value.data));\n _this._metadata = deepClone(value);\n delete _this._metadata.data;\n _this._version = value.version;\n } else {\n log.info('[DataObjectObserver_sync] existing data is updated: ', value);\n }*/\n }).catch(function (reason) {\n log.info('[DataObjectObserver_sync] sync failed: ', reason);\n resolve(false);\n });\n });\n }\n }, {\n key: '_storeChildrens',\n value: function _storeChildrens() {\n var _this = this;\n\n var childrens = {};\n\n //TODO: to be sent to HypertyResourceStorage when ready to handle Chat Messages\n\n (0, _keys2.default)(_this._childrenObjects).forEach(function (childId) {\n var children = _this._childrenObjects;\n // childrens[childrenResource] = {};\n\n // Object.keys(children).forEach((childId) => {\n childrens[childId] = {};\n childrens[childId].value = children[childId].metadata;\n childrens[childId].identity = children[childId].identity;\n // });\n });\n\n var msg = {\n\n from: _this._owner,\n to: _this._syncher._subURL,\n type: 'create',\n body: {\n resource: _this._url,\n attribute: 'childrenObjects',\n value: childrens\n }\n };\n\n _this._bus.postMessage(msg);\n }\n }, {\n key: '_allocateListeners',\n value: function _allocateListeners() {\n (0, _get3.default)(DataObjectObserver.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectObserver.prototype), '_allocateListeners', this).call(this);\n var _this = this;\n\n _this._changeListener = _this._bus.addListener(_this._url + '/changes', function (msg) {\n if (msg.type === 'update') {\n log.log('DataObjectObserver-' + _this._url + '-RCV: ', msg);\n _this._changeObject(_this._syncObj, msg);\n }\n });\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n (0, _get3.default)(DataObjectObserver.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectObserver.prototype), '_releaseListeners', this).call(this);\n var _this = this;\n\n _this._changeListener.remove();\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n if (_this._heartBeat) _this._heartBeat.stop();\n\n _this._deleteChildrens().then(function () {\n _this.unsubscribe();\n _this._releaseListeners();\n delete _this._syncher._observers[_this._url];\n });\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'unsubscribe',\n value: function unsubscribe() {\n var _this = this;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onLocalUnSubscribe\n var unSubscribeMsg = {\n type: 'unsubscribe', from: _this._owner, to: _this._syncher._subURL,\n body: { resource: _this._url }\n };\n\n _this._bus.postMessage(unSubscribeMsg, function (reply) {\n log.log('DataObjectObserver-UNSUBSCRIBE: ', reply);\n if (reply.body.code === 200) {\n _this._releaseListeners();\n delete _this._syncher._observers[_this._url];\n }\n });\n }\n\n /**\n * Register the change listeners sent by the reporter\n * @param {string} filter - Filter that identifies the field (separated dot path). Accepts * at the end for a more unrestricted filtering.\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onChange',\n value: function onChange(filter, callback) {\n var key = filter;\n var filterObj = {\n type: FilterType.EXACT,\n callback: callback\n };\n\n var idx = filter.indexOf('*');\n if (idx === filter.length - 1) {\n if (idx === 0) {\n filterObj.type = FilterType.ANY;\n } else {\n filterObj.type = FilterType.START;\n key = filter.substr(0, filter.length - 1);\n }\n }\n\n this._filters[key] = filterObj;\n }\n }, {\n key: '_onFilter',\n value: function _onFilter(event) {\n var _this = this;\n\n (0, _keys2.default)(_this._filters).forEach(function (key) {\n var filter = _this._filters[key];\n if (filter.type === FilterType.ANY) {\n //match anything\n filter.callback(event);\n } else if (filter.type === FilterType.START) {\n //if starts with filter...\n if (event.field.indexOf(key) === 0) {\n filter.callback(event);\n }\n } else if (filter.type === FilterType.EXACT) {\n //exact match\n if (event.field === key) {\n filter.callback(event);\n }\n }\n });\n }\n }, {\n key: 'onDisconnected',\n value: function onDisconnected(callback) {\n var _this3 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3._subscribeRegistration().then(function () {\n _this3._onDisconnected = callback;\n resolve();\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n }, {\n key: '_subscribeRegistration',\n value: function _subscribeRegistration() {\n var _this4 = this;\n\n var msg = {\n type: 'subscribe',\n from: this._owner,\n to: this._syncher._runtimeUrl + '/subscriptions',\n body: {\n resources: [this._url + '/registration']\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this4._bus.postMessage(msg, function (reply) {\n log.log('[DataObjectObserver._subscribeRegistration] ' + _this4._url + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n _this4._generateListener(_this4._url + '/registration');\n resolve();\n } else {\n log.error('Error subscribing registration status for ', _this4._url);\n reject('Error subscribing registration status for ' + _this4._url);\n }\n });\n });\n }\n }, {\n key: '_generateListener',\n value: function _generateListener(notificationURL) {\n var _this = this;\n\n _this._bus.addListener(notificationURL, function (msg) {\n log.log('[DataObjectObserver.registrationNotification] ' + _this._url + ': ', msg);\n if (msg.body.value && msg.body.value === 'disconnected' && _this._onDisconnected) {\n log.log('[DataObjectObserver] ' + _this._url + ': was disconnected ', msg);\n _this._onDisconnected();\n }\n });\n }\n\n /**\n * Requests the reporter to execute a method on the data object\n * @param {string} method - Name of the function to be executed.\n * @param {array} params - array of parameters for the requested function\n * @return {promise}\n */\n\n }, {\n key: 'execute',\n value: function execute(method, params) {\n var _this5 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n type: 'execute',\n from: _this5._owner,\n to: _this._url,\n body: {\n method: method,\n params: params\n }\n };\n\n _this._bus.postMessage(msg, function (reply) {\n log.log('[DataObjectObserver.execute] ' + _this._url + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n resolve();\n } else {\n log.warn('[DataObjectObserver.execute] execution of method ' + method + ' was reject by reporter');\n reject('[DataObjectObserver.execute] execution of method ' + method + ' was reject by reporter');\n }\n });\n });\n }\n }]);\n return DataObjectObserver;\n}(_DataObject3.default /* implements SyncStatus */);\n\nexports.default = DataObjectObserver;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFPYmplY3RPYnNlcnZlci5qcz9mODdiIl0sIn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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUpBO0FBQ0E7QUFTQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXpUQTtBQUNBO0FBMlRBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///488\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataProvisional'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * @access private\n * This class is responsible for collecting delta changes in remote objects, before the response of subscription reach the observer.\n * It's used in Syncher -> subscribe. The flow is defined as:\n * 1. (observer) --subscribe--\x3e (reporter)\n * 2. (observer) <--delta updates-- (reporter)\n * 3. (observer) <--subscribe response-- (reporter)\n * This means that there could be delta updates transferred before the subscription confirmation.\n * Since there is no DataObjectObserver before the ubscription confirmation, there should be some other object collecting the updates.\n * Provisional data is applied to the DataObjectObserver after confirmation. Or discarded if there is no confirmation.\n */\n\n// Log System\n\nvar DataProvisional = function () {\n /* private\n _childrenListeners: [MsgListener]\n _listener: MsgListener\n _changes: []\n */\n\n function DataProvisional(owner, url, bus, children) {\n (0, _classCallCheck3.default)(this, DataProvisional);\n\n var _this = this;\n\n _this._owner = owner;\n _this._url = url;\n _this._bus = bus;\n _this._children = children;\n\n _this._changes = [];\n _this._allocateListeners();\n }\n\n (0, _createClass3.default)(DataProvisional, [{\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this = this;\n\n _this._listener = _this._bus.addListener(_this._url, function (msg) {\n log.log('DataProvisional-' + _this._url + '-RCV: ', msg);\n _this._changes.push(msg);\n });\n\n /*\n _this._childrenListeners = [];\n if (_this._children) {\n let childBaseURL = url + '/children/';\n _this._children.forEach((child) => {\n let childURL = childBaseURL + child;\n let listener = _this._bus.addListener(childURL, (msg) => {\n //ignore msg sent by himself\n if (msg.from !== owner) {\n log.log(msg);\n }\n });\n _this._childrenListeners.push(listener);\n });\n }*/\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._listener.remove();\n\n /*_this._childrenListeners.forEach((listener) => {\n listener.remove();\n });*/\n }\n }, {\n key: 'apply',\n value: function apply(observer) {\n var _this = this;\n _this._changes.forEach(function (change) {\n observer._changeObject(observer._syncObj, change);\n });\n }\n }, {\n key: 'children',\n get: function get() {\n return this._children;\n }\n }]);\n return DataProvisional;\n}();\n\nexports.default = DataProvisional;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFQcm92aXNpb25hbC5qcz81MjUwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4qIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuKlxuKiAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuKlxuKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZ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XMuX2NoaWxkcmVuOyB9XG5cbiAgYXBwbHkob2JzZXJ2ZXIpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuICAgIF90aGlzLl9jaGFuZ2VzLmZvckVhY2goKGNoYW5nZSkgPT4ge1xuICAgICAgb2JzZXJ2ZXIuX2NoYW5nZU9iamVjdChvYnNlcnZlci5fc3luY09iaiwgY2hhbmdlKTtcbiAgICB9KTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBEYXRhUHJvdmlzaW9uYWw7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3N5bmNoZXIvRGF0YVByb3Zpc2lvbmFsLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQW9DQTtBQUNBO0FBREE7QUFDQTs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFkQTs7Ozs7Ozs7Ozs7O0FBWUE7QUFDQTtBQUdBO0FBQ0E7Ozs7OztBQU9BO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7O0FBZ0JBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUdBOzs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQVBBO0FBQUE7QUFBQTs7Ozs7QUFVQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///489\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar NotificationHandler = function () {\n function NotificationHandler(bus) {\n (0, _classCallCheck3.default)(this, NotificationHandler);\n\n\n if (!bus) throw Error('[NotificationHandler Constructor] bus input is mandatory');\n this._bus = bus;\n this._onNotificationHandler = {};\n }\n\n (0, _createClass3.default)(NotificationHandler, [{\n key: 'onNotification',\n value: function onNotification(scheme, callback) {\n this._onNotificationHandler[scheme] = callback;\n }\n }, {\n key: 'onCreate',\n value: function onCreate(msg) {\n\n var _this = this;\n // let resource = msg.from.slice(0, -13); //remove \"/subscription\" from the URL\n\n var resource = msg.body.hasOwnProperty('resource') ? msg.body.resource : msg.from.slice(0, -13);\n var dividedURL = (0, _utils.divideURL)(resource);\n var domain = dividedURL.domain;\n var scheme = resource.split('://')[0];\n\n var _error = function _error(reason) {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 400, desc: 'Bad Request: ' + reason }\n });\n };\n\n if (!msg.body.hasOwnProperty('source')) {\n _error('Missing source');\n }\n if (!msg.body.hasOwnProperty('schema')) {\n _error('Missing schema');\n }\n if (!msg.body.hasOwnProperty('value')) {\n _error('Missing value');\n }\n if (!msg.body.hasOwnProperty('identity')) {\n _error('Missing identity');\n }\n\n var event = {\n type: msg.type,\n from: msg.body.source,\n url: resource,\n domain: domain,\n schema: msg.body.schema,\n value: msg.body.value,\n identity: msg.body.identity,\n to: msg.to,\n via: msg.body.via,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType }\n });\n },\n error: function error(reason) {\n _error(reason);\n }\n };\n if (_this._onNotificationHandler[scheme]) {\n console.info('[NotificationHandler] NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler[scheme](event);\n }\n }\n }, {\n key: 'onDelete',\n value: function onDelete(msg) {\n var _this = this;\n\n //remove \"/subscription\" from the URL\n var resource = msg.body.resource;\n\n var object = _this._observers[resource];\n\n var unsubscribe = {\n from: _this.owner,\n to: _this._subURL,\n id: msg.id,\n type: 'unsubscribe',\n body: { resource: msg.body.resource }\n };\n\n _this._bus.postMessage(unsubscribe);\n\n delete _this._observers[resource];\n\n if (object) {\n var event = {\n type: msg.type,\n url: resource,\n identity: msg.body.identity,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //TODO: any other different options for the release process, like accept but nor release local?\n if (lType === 200) {\n object.delete();\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType, source: _this._owner }\n });\n }\n };\n\n if (_this._onNotificationHandler) {\n log.log('NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler(event);\n }\n } else {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 404, source: _this._owner }\n });\n }\n }\n }]);\n return NotificationHandler;\n}(); /**\n * The Notitification Handler is used to handle notifications not processed by the syncher when running in a sandbox.\n */\n\nexports.default = NotificationHandler;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL05vdGlmaWNhdGlvbkhhbmRsZXIuanM/MzNlMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogVGhlIE5vdGl0aWZpY2F0aW9uIEhhbmRsZXIgaXMgdXNlZCB0byBoYW5kbGUgbm90aWZpY2F0aW9ucyBub3QgcHJvY2Vzc2VkIGJ5IHRoZSBzeW5jaGVyIHdoZW4gcnVubmluZyBpbiBhIHNhbmRib3guXG4qL1xuXG5pb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ZXJzW3Jlc291cmNlXTtcblxuICAgIGlmIChvYmplY3QpIHtcbiAgICAgIGxldCBldmVudCA9IHtcbiAgICAgICAgdHlwZTogbXNnLnR5cGUsXG4gICAgICAgIHVybDogcmVzb3VyY2UsXG4gICAgICAgIGlkZW50aXR5OiBtc2cuYm9keS5pZGVudGl0eSxcblxuICAgICAgICBhY2s6ICh0eXBlKSA9PiB7XG4gICAgICAgICAgbGV0IGxUeXBlID0gMjAwO1xuICAgICAgICAgIGlmICh0eXBlKSB7XG4gICAgICAgICAgICBsVHlwZSA9IHR5cGU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAvL1RPRE86IGFueSBvdGhlciBkaWZmZXJlbnQgb3B0aW9ucyBmb3IgdGhlIHJlbGVhc2UgcHJvY2VzcywgbGlrZSBhY2NlcHQgYnV0IG5vciByZWxlYXNlIGxvY2FsP1xuICAgICAgICAgIGlmIChsVHlwZSA9PT0gMjAwKSB7XG4gICAgICAgICAgICBvYmplY3QuZGVsZXRlKCk7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy9zZW5kIGFjayByZXNwb25zZSBtZXNzYWdlXG4gICAgICAgICAgX3RoaXMuX2J1cy5wb3N0TWVzc2FnZSh7XG4gICAgICAgICAgICBpZDogbXNnLmlkLCB0eXBlOiAncmVzcG9uc2UnLCBmcm9tOiBtc2cudG8sIHRvOiBtc2cuZnJvbSxcbiAgICAgICAgICAgIGJvZHk6IHsgY29kZTogbFR5cGUsIHNvdXJjZTogX3RoaXMuX293bmVyIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfTtcblxuICAgICAgaWYgKF90aGlzLl9vbk5vdGlmaWNhdGlvbkhhbmRsZXIpIHtcbiAgICAgICAgbG9nLmxvZygnTk9USUZJQ0FUSU9OLUVWRU5UOiAnLCBldmVudCk7XG4gICAgICAgIF90aGlzLl9vbk5vdGlmaWNhdGlvbkhhbmRsZXIoZXZlbnQpO1xuICAgICAgfVxuICAgIH0gZWxzZSB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FBQ0E7QUFDQTtBQUxBO0FBQ0E7QUFPQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFyQkE7QUFDQTtBQXVCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBOzs7QUFqSUE7Ozs7QUFvSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///490\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Core IdentityManager interface\n* Class to allow applications to search for Identities registered in runtime-core\n*/\nvar IdentityManager = function () {\n\n /**\n * To initialise the IdentityManager, which will provide the support for hyperties to\n * query about identities registered\n * @param {String} owner owner\n * @param {String} runtimeURL runtimeURL\n * @param {MessageBus} msgbus msgbus\n */\n function IdentityManager(owner, runtimeURL, msgBus) {\n (0, _classCallCheck3.default)(this, IdentityManager);\n\n var _this = this;\n _this.messageBus = msgBus;\n\n _this.domain = (0, _utils.divideURL)(owner).domain;\n _this.owner = owner;\n _this.runtimeURL = runtimeURL;\n }\n\n /**\n * Function to query the runtime registry about the identity to which the hyperty was associated\n * @param {String} type (Optional) type of user info required\n * @param {String} owner (Optional) owner to search for\n * @return {Promise} userURL userURL associated to the hyperty\n */\n\n\n (0, _createClass3.default)(IdentityManager, [{\n key: 'discoverUserRegistered',\n value: function discoverUserRegistered(type, hyperty) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var activeHypertyURL = void 0;\n\n // if any type of search is selected query for that type, otherwise query for default user info\n var searchType = type ? type : '.';\n\n if (!hyperty) {\n activeHypertyURL = _this.owner;\n } else {\n activeHypertyURL = hyperty;\n }\n\n var msg = {\n type: 'read', from: activeHypertyURL, to: _this.runtimeURL + '/registry/', body: { resource: searchType, criteria: activeHypertyURL }\n };\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var userURL = reply.body.resource;\n\n if (userURL && reply.body.code === 200) {\n resolve(userURL);\n } else {\n reject('code: ' + reply.body.code + ' No user was found');\n }\n });\n });\n }\n\n /**\n * Function to query the Identity Module about authenticated identities from a certain domain\n * @param {String} idp idp domain of the identity to be discovered\n * @return {Promise} identity\n */\n\n }, {\n key: 'discoverIdentityPerIdP',\n value: function discoverIdentityPerIdP(idp) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n type: 'read', from: this.owner, to: _this.runtimeURL + '/idm', body: { resource: idp, criteria: 'idp' }\n };\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n resolve(reply.body.value);\n } else {\n reject(reply.body.code + ' ' + reply.body.desc);\n }\n });\n });\n }\n }]);\n return IdentityManager;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = IdentityManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0eU1hbmFnZXIuanM/ZjI3ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuKiBZb3UgbWF5IG9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TtBQUNBO0FBQ0E7Ozs7Ozs7QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFEQTtBQUNBO0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBN0dBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFnSEE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///491\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DiscoveredObject = __webpack_require__(493);\n\nvar _DiscoveredObject2 = _interopRequireDefault(_DiscoveredObject);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Discovery'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* Core Discovery interface\n* Class to allow applications to search for hyperties and DataObjects using the message bus\n*/\nvar Discovery = function () {\n\n /**\n * To initialise the HypertyDiscover, which will provide the support for hyperties to\n * query users registered in outside the internal core.\n * @param {MessageBus} msgbus msgbus\n * @param {RuntimeURL} runtimeURL runtimeURL\n */\n function Discovery(hypertyURL, runtimeURL, msgBus) {\n (0, _classCallCheck3.default)(this, Discovery);\n\n var _this = this;\n _this.messageBus = msgBus;\n _this.runtimeURL = runtimeURL;\n\n _this.domain = (0, _utils.divideURL)(hypertyURL).domain;\n _this.discoveryURL = hypertyURL;\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n\n (0, _createClass3.default)(Discovery, [{\n key: '_isLegacyUser',\n value: function _isLegacyUser(userIdentifier) {\n if (userIdentifier.includes(':') && !userIdentifier.includes('user://')) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerUserProfileData',\n value: function discoverHypertiesPerUserProfileData(userIdentifier, schema, resources) {\n var _this = this;\n var filteredHyperties = [];\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/userprofile/' + userIdentifier\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._isLegacyUser(userIdentifier)) {\n // todo: to reomve when discovery of legcay users are supported\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n reply.body.value.map(function (hyperty) {\n if (hyperty.hypertyID != _this.discoveryURL) filteredHyperties.push(hyperty);\n });\n if (filteredHyperties.length === 0) resolve([]);else {\n log.log(\"[Discovery.discoverHypertiesPerUserProfileData] Reply log: \", filteredHyperties);\n resolve(filteredHyperties);\n }\n } else {\n log.warn(\"[Discovery.discoverHypertiesPerUserProfileData] Error Reply for \" + userIdentifier + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n } else {\n resolve([{ hypertyID: userIdentifier, status: 'live' }]);\n }\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * returns DiscoveredObject\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerUserProfileDataDO',\n value: function discoverHypertiesPerUserProfileDataDO(userIdentifier, schema, resources) {\n var _this2 = this,\n _arguments = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this2.discoverHypertiesPerUserProfileData.apply(_this2, _arguments).then(function (hyperties) {\n resolve(_this2._convertToDiscoveredObject(hyperties));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverDataObjectsPerUserProfileData',\n value: function discoverDataObjectsPerUserProfileData(userIdentifier, schema, resources) {\n var _this = this;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/userprofile/' + userIdentifier\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._isLegacyUser(userIdentifier)) {\n // todo: to reomve when discovery of legcay users are supported\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerUserProfileData] Error Reply for \" + userIdentifier + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n } else {\n resolve([{ hypertyID: userIdentifier, status: 'live' }]);\n }\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerUserProfileDataDO',\n value: function discoverDataObjectsPerUserProfileDataDO(guidURL, schema, resources) {\n var _this3 = this,\n _arguments2 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this3.discoverDataObjectsPerUserProfileData.apply(_this3, _arguments2).then(function (registryObjects) {\n return resolve(_this3._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some GUID\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerGUID',\n value: function discoverHypertiesPerGUID(guidURL, schema, resources) {\n var _this = this;\n var filteredHyperties = [];\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/guid/' + guidURL\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n reply.body.value.map(function (hyperty) {\n if (hyperty.hypertyID != _this.discoveryURL) filteredHyperties.push(hyperty);\n });\n if (filteredHyperties.length === 0) reject('No Hyperty was found');else {\n log.log(\"Reply log: \", filteredHyperties);\n resolve(filteredHyperties);\n }\n } else {\n log.warn(\"[Discovery.discoverHypertiesPerGUID] Error Reply for \" + guidURL + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some GUID\n * returns DiscoveredObject\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerGUIDDO',\n value: function discoverHypertiesPerGUIDDO(guidURL, schema, resources) {\n var _this4 = this,\n _arguments3 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this4.discoverHypertiesPerGUID.apply(_this4, _arguments3).then(function (hyperties) {\n resolve(_this4._convertToDiscoveredObject(hyperties));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some GUID\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerGUID',\n value: function discoverDataObjectsPerGUID(guidURL, schema, resources) {\n var _this = this;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/guid/' + guidURL\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerGUID] Error Reply for \" + guidURL + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerGUIDDO',\n value: function discoverDataObjectsPerGUIDDO(guidURL, schema, resources) {\n var _this5 = this,\n _arguments4 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this5.discoverDataObjectsPerGUID.apply(_this5, _arguments4).then(function (registryObjects) {\n return resolve(_this5._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHyperties',\n value: function discoverHyperties(user, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n var filteredHyperties = [];\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/user/' + user\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._isLegacyUser(user)) {\n // todo: to reomve when discovery of legcay users are supported\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200 || reply.body.code === 500) {\n reply.body.value.map(function (hyperty) {\n if (hyperty.hypertyID != _this.discoveryURL) filteredHyperties.push(hyperty);\n });\n /* if(filteredHyperties.length === 0)\n reject('No Hyperty was found');\n else {*/\n log.log(\"[Discovery.discoverHyperties] Reply : \", filteredHyperties);\n resolve(filteredHyperties);\n // }\n } else {\n log.warn(\"[Discovery.discoverHyperties] Error Reply for \" + user + \" Reason: \", reply.body.description);\n resolve(filteredHyperties);\n }\n });\n } else {\n resolve([{ hypertyID: user, status: 'live' }]);\n }\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry,\n *returns DiscoveredObject\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHypertiesDO',\n value: function discoverHypertiesDO(user, schema, resources, domain) {\n var _this6 = this,\n _arguments5 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this6.discoverHyperties.apply(_this6, _arguments5).then(function (hyperties) {\n resolve(_this6._convertToDiscoveredObject(hyperties));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /** Advanced Search for DataObjects registered in domain registry\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjects',\n value: function discoverDataObjects(user, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/user/' + user\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjects] Error Reply for \" + user + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsDO',\n value: function discoverDataObjectsDO(user, schema, resources, domain) {\n var _this7 = this,\n _arguments6 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this7.discoverDataObjects.apply(_this7, _arguments6).then(function (registryObjects) {\n return resolve(_this7._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about hyperties registered in domain registry, and\n * return the hyperty information, if found.\n * @param {String} url hyperty URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertyPerURL',\n value: function discoverHypertyPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/url/' + url,\n criteria: {\n domain: activeDomain\n }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverHypertyPerURL] Error Reply for \" + url + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about hyperties registered in domain registry, and\n * returns discoveredObject.\n * @param {String} url hyperty URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertyPerURLDO',\n value: function discoverHypertyPerURLDO(url, domain) {\n var _this8 = this,\n _arguments7 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this8.discoverHypertyPerURL.apply(_this8, _arguments7).then(function (hyperty) {\n return resolve(new _DiscoveredObject2.default(hyperty, _this8.runtimeURL, _this8.discoveryURL, _this8.messageBus, _this8));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * return the dataObject information, if found.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectPerURL',\n value: function discoverDataObjectPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/url/' + url,\n criteria: {\n domain: activeDomain\n }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectPerURL] Error Reply for \" + url + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectPerURLDO',\n value: function discoverDataObjectPerURLDO(url, domain) {\n var _this9 = this,\n _arguments8 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this9.discoverDataObjectPerURL.apply(_this9, _arguments8).then(function (registryObject) {\n return resolve(new _DiscoveredObject2.default(registryObject, _this9.runtimeURL, _this9.discoveryURL, _this9.messageBus, _this9));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about an dataObjects registered in domain registry with a given name, and\n * return the dataObjects information, if found.\n * @param {String} name dataObject URL\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerName',\n value: function discoverDataObjectsPerName(name, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/name/' + name\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerName] Error Reply for \" + name + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} name dataObject URL\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerNameDO',\n value: function discoverDataObjectsPerNameDO(name, schema, resources, domain) {\n var _this10 = this,\n _arguments9 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this10.discoverDataObjectsPerName.apply(_this10, _arguments9).then(function (registryObjects) {\n return resolve(_this10._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about specific reporter dataObject registered in domain registry, and\n * return the dataObjects from that reporter.\n * @param {String} reporter dataObject reporter\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerReporter',\n value: function discoverDataObjectsPerReporter(reporter, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/reporter/' + reporter\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerName] Error Reply for \" + reporter + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} name dataObject URL\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerReporterDO',\n value: function discoverDataObjectsPerReporterDO(reporter, schema, resources, domain) {\n var _this11 = this,\n _arguments10 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this11.discoverDataObjectsPerReporter.apply(_this11, _arguments10).then(function (registryObjects) {\n return resolve(_this11._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n }, {\n key: '_convertToDiscoveredObject',\n value: function _convertToDiscoveredObject(registryObjects) {\n var _this12 = this;\n\n return registryObjects.map(function (registryObject) {\n return new _DiscoveredObject2.default(registryObject, _this12.runtimeURL, _this12.discoveryURL, _this12.messageBus, _this12);\n });\n }\n\n /** Advanced Search for dataObjects registered in domain registry\n * @deprecated Deprecated. Use discoverDataObjectsPerName instead\n * @param {String} name name of the dataObject\n * @param {Array} schema (Optional) types of dataObject schemas\n * @param {Array} resources (Optional) types of dataObject resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObject',\n value: function discoverDataObject(name, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n //let userIdentifier = convertToUserURL(user);\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: name,\n criteria: { resources: resources, dataSchemes: schema }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n log.log('[Discovery]', reply);\n\n if (reply.body.code > 299) {\n log.warn(\"[Discovery.discoverDataObject] Error Reply for \" + name + \" Reason: \", reply.body.description);\n return resolve([]);\n }\n\n var hyperties = reply.body.value;\n\n if (hyperties) {\n resolve(hyperties);\n } else {\n resolve([]);\n }\n });\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry\n * @deprecated Deprecated. Use discoverHyperties instead\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHyperty',\n value: function discoverHyperty(user, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n var userIdentifier = (0, _utils.convertToUserURL)(user);\n\n if (!domain) {\n activeDomain = _this.domain;\n } else {\n activeDomain = domain;\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n log.log('[Discovery.discoverHyperty] ACTIVE DOMAIN -> ', activeDomain, 'user->', user, 'schema->', schema, 'resources->', resources, 'domain->', domain);\n if (user.includes(':') && !user.includes('user://')) {\n log.log('[Discovery.discoverHyperty] ' + user + ' is legacy domain');\n var legacyUser = { userID: user, hypertyID: user, schema: schema, resources: resources };\n return resolve(legacyUser);\n }\n var msg = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: userIdentifier,\n criteria: { resources: resources, dataSchemes: schema }\n }\n };\n\n log.info('[Discovery] msg to send->', msg);\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n log.info('[Discovery] ON discoverHyperty->', reply);\n var hyperties = reply.body.value;\n\n if (hyperties) {\n resolve(hyperties);\n } else {\n reject('No Hyperty was found');\n }\n });\n });\n }\n\n /**\n * function to request about users registered in domain registry, and\n * return the last hyperty instance registered by the user.\n * @deprecated Deprecated. Use discoverHyperty instead\n * @param {email} email\n * @param {domain} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertyPerUser',\n value: function discoverHypertyPerUser(email, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n // Hack for legacy users\n if (email.includes(':') && !email.includes('user://')) {\n log.log('[Discovery.discoverHyperty] ' + email + 'is legacy domain');\n var legacyUser = { id: email, hypertyURL: email, descriptor: 'unknown' };\n return resolve(legacyUser);\n }\n\n if (!domain) {\n activeDomain = _this.domain;\n } else {\n activeDomain = domain;\n }\n\n var identityURL = 'user://' + email.substring(email.indexOf('@') + 1, email.length) + '/' + email.substring(0, email.indexOf('@'));\n\n // message to query domain registry, asking for a user hyperty.\n var message = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: identityURL }\n };\n\n log.info('[Discovery] Message: ', message, activeDomain, identityURL);\n\n //log.info('[Discovery] message READ', message);\n\n _this.messageBus.postMessage(message, function (reply) {\n log.info('[Discovery] message reply', reply);\n\n var hyperty = void 0;\n var mostRecent = void 0;\n var lastHyperty = void 0;\n var value = reply.body.value;\n\n for (hyperty in value) {\n if (value[hyperty].lastModified !== undefined) {\n if (mostRecent === undefined) {\n mostRecent = new Date(value[hyperty].lastModified);\n lastHyperty = hyperty;\n } else {\n var hypertyDate = new Date(value[hyperty].lastModified);\n if (mostRecent.getTime() < hypertyDate.getTime()) {\n mostRecent = hypertyDate;\n lastHyperty = hyperty;\n }\n }\n }\n }\n\n log.info('[Discovery] Last Hyperty: ', lastHyperty, mostRecent);\n\n var hypertyURL = lastHyperty;\n\n if (hypertyURL === undefined) {\n return reject('User Hyperty not found');\n }\n\n var idPackage = {\n id: email,\n descriptor: value[hypertyURL].descriptor,\n hypertyURL: hypertyURL\n };\n\n log.info('[Discovery] ===> hypertyDiscovery messageBundle: ', idPackage);\n resolve(idPackage);\n });\n });\n }\n\n /**\n * function to request about users registered in domain registry, and\n * return the all the hyperties registered by the user\n * @deprecated Deprecated. Use discoverHyperty instead\n * @param {email} email\n * @param {domain} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertiesPerUser',\n value: function discoverHypertiesPerUser(email, domain) {\n var _this = this;\n var activeDomain = void 0;\n log.log('on Function->', email);\n return new _promise2.default(function (resolve, reject) {\n\n if (email.includes(':') && !email.includes('user://')) {\n log.log('[Discovery.discoverHyperty] is legacy domain');\n var legacyUser = { userID: email, hypertyID: email, schema: schema, resources: resources };\n return resolve(legacyUser);\n }\n\n if (!domain) {\n activeDomain = _this.domain;\n } else {\n activeDomain = domain;\n }\n\n var identityURL = 'user://' + email.substring(email.indexOf('@') + 1, email.length) + '/' + email.substring(0, email.indexOf('@'));\n\n // message to query domain registry, asking for a user hyperty.\n var message = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: identityURL }\n };\n\n log.log('[Discovery] Message discoverHypertiesPerUser: ', message, activeDomain, identityURL);\n\n //log.info('[Discovery] message READ', message);\n\n _this.messageBus.postMessage(message, function (reply) {\n log.info('[Discovery] discoverHypertiesPerUser reply', reply);\n\n var value = reply.body.value;\n\n if (!value) {\n return reject('User Hyperty not found');\n }\n\n resolve(value);\n });\n });\n }\n\n /**\n * function to request about users registered in domain registry, and\n * return the all the hyperties registered by the user\n * @deprecated Deprecated. Use discoverHyperty instead\n * @param {email} email\n * @param {domain} domain (Optional)\n */\n\n }, {\n key: 'resumeDiscoveries',\n value: function resumeDiscoveries() {\n\n var _this = this;\n\n log.log('[Discovery] resumeDiscoveries');\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n type: 'read', from: _this.discoveryURL, to: _this.runtimeURL + '/subscriptions', body: { resource: _this.discoveryURL }\n };\n\n _this.messageBus.postMessage(msg, function (reply) {\n log.log('[Discovery.resumeDiscoveries] reply: ', reply);\n\n var notifications = [];\n\n if (reply.body.code === 200) {\n var urls = reply.body.value; // URLs to add listeners to\n\n //lets create one DiscoveryObject per notification\n urls.forEach(function (url) {\n var objectUrl = url.split('/registration')[0];\n var data = {};\n data.url = objectUrl;\n log.log('[Discovery.resumeDiscoveries] adding listener to: ', objectUrl);\n\n if (objectUrl.includes('hyperty://')) {\n notifications.push(_this.discoverHypertyPerURLDO(objectUrl));\n } else {\n notifications.push(_this.discoverDataObjectPerURLDO(objectUrl));\n }\n });\n _promise2.default.all(notifications).then(function (values) {\n resolve(values);\n });\n } else {\n resolve([]);\n }\n });\n });\n }\n }]);\n return Discovery;\n}();\n\nexports.default = Discovery;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvRGlzY292ZXJ5LmpzPzMxYzUiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCA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ICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgbGV0IGFjdGl2ZURvbWFpbjtcblxuICAgIGFjdGl2ZURvbWFpbiA9ICghZG9tYWluKSA/IF90aGlzLmRvbWFpbiA6IGRvbWFpbjtcblxuICAgIGxldCBtc2cgPSB7XG4gICAgICB0eXBlOiAncmVhZCcsXG4gICAgICBmcm9tOiBfdGhpcy5kaXNjb3ZlcnlVUkwsXG4gICAgICB0bzogX3RoaXMucnVudGltZVVSTCArICcvZGlzY292ZXJ5LycsXG4gICAgICBib2R5OiB7XG4gICAgICAgIHJlc291cmNlOiAnL2RhdGFPYmplY3QvbmFtZS8nICsgbmFtZVxuICAgICAgfVxuICAgIH07XG5cbiAgICBpZihzY2hlbWEgfHwgcmVzb3VyY2VzKSB7XG4gICAgICBtc2cuYm9keVsnY3JpdGVyaWEnXSA9IHtcbiAgICAgICAgcmVzb3VyY2VzOiByZXNvdXJjZXMsXG4gICAgICAgIGRhdGFTY2hlbWVzOiBzY2hlbWEsXG4gICAgICAgIGRvbWFpbjogYWN0aXZlRG9tYWluXG4gICAgICB9O1xuICAgIH1lbHNlIHtcbiAgICAgIG1zZy5ib2R5Wydjcml0ZXJpYSddID0ge1xuICAgICAgICBkb21haW46IGFjdGl2ZURvbWFpblxuICAgICAgfVxuICAgIH1cblxuICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcblxuICAgICAgX3RoaXMubWVzc2FnZUJ1cy5wb3N0TWVzc2FnZShtc2csIChyZXBseSkgPT4ge1xuXG4gICAgICAgIGlmKHJlcGx5LmJvZHkuY29kZSA9PT0gMjAwKXtcbiAgICAgICAgICBsb2cubG9nKFwiUmVwbHkgVmFsdWUgTG9nOiBcIixyZXBseS5ib2R5LnZhbHVlKTtcbiAgICAgICAgICByZXNvbHZlKHJlcGx5LmJvZHkudmFsdWUpO1xuICAgICAgICB9XG4gICAgICAgIGVsc2Uge1xuICAgICAgICAgIGxvZy53Y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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7OztBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTs7Ozs7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///492\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _RegistrationStatus2 = __webpack_require__(150);\n\nvar _RegistrationStatus3 = _interopRequireDefault(_RegistrationStatus2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Discovered Object interface\n*/\nvar DiscoveredObject = function (_RegistrationStatus) {\n (0, _inherits3.default)(DiscoveredObject, _RegistrationStatus);\n (0, _createClass3.default)(DiscoveredObject, [{\n key: 'data',\n get: function get() {\n return this._data;\n }\n }]);\n\n function DiscoveredObject(data, runtimeURL, discoveryURL, msgBus, discovery) {\n (0, _classCallCheck3.default)(this, DiscoveredObject);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (DiscoveredObject.__proto__ || (0, _getPrototypeOf2.default)(DiscoveredObject)).call(this, data.hypertyID || data.url, runtimeURL, discoveryURL, msgBus));\n\n _this2._data = data;\n _this2._discovery = discovery;\n return _this2;\n }\n\n /**\n * function to check the status of the DiscoveredObject.\n * Depending on existing subscribers it may trigger onLive or onDisconnected events.\n *\n */\n\n (0, _createClass3.default)(DiscoveredObject, [{\n key: 'check',\n value: function check() {\n // query DR for the status and call processNotification with msg received\n\n var _this = this;\n var message = {\n body: {}\n };\n\n if (_this._discoveredObjectURL.startsWith('hyperty://')) {\n _this._discovery.discoverHypertyPerURL(_this._discoveredObjectURL).then(function (registration) {\n message.body.status = registration.status;\n _this._processNotification(message);\n });\n } else {\n _this._discovery.discoverDataObjectsPerURL(_this._discoveredObjectURL).then(function (registration) {\n message.body.status = registration.status;\n _this._processNotification(message);\n });\n }\n }\n }]);\n return DiscoveredObject;\n}(_RegistrationStatus3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n//import {divideURL, convertToUserURL} from '../utils/utils';\n\n\nexports.default = DiscoveredObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvRGlzY292ZXJlZE9iamVjdC5qcz8wNzRmIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4qIFlvdSBtYXkgb2J0YWluIGEgY29weSB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0+e1xuICAgICAgICBtZXNzYWdlLmJvZHkuc3RhdHVzID0gcmVnaXN0cmF0aW9uLnN0YXR1cztcbiAgICAgICAgX3RoaXMuX3Byb2Nlc3NOb3RpZmljYXRpb24obWVzc2FnZSk7XG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgRGlzY292ZXJlZE9iamVjdDtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvZGlzY292ZXJ5L0Rpc2NvdmVyZWRPYmplY3QuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBd0JBO0FBQ0E7Ozs7O0FBQ0E7OztBQUdBOzs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUFBO0FBQ0E7QUFEQTtBQUNBO0FBRUE7QUFDQTtBQUpBO0FBS0E7QUFDQTtBQUlBOzs7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXpDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFOQTtBQUNBO0FBQ0E7QUFtREE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///493\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Search = function () {\n function Search(discovery, identityManager) {\n (0, _classCallCheck3.default)(this, Search);\n\n\n if (!discovery) throw new Error('The discovery component is a needed parameter');\n if (!identityManager) throw new Error('The identityManager component is a needed parameter');\n\n var _this = this;\n\n _this.discovery = discovery;\n _this.identityManager = identityManager;\n }\n\n (0, _createClass3.default)(Search, [{\n key: 'myIdentity',\n value: function myIdentity() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.identityManager.discoverUserRegistered().then(function (result) {\n resolve(result);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'hyperties',\n value: function hyperties(users, schemes, resources) {\n var globalFlag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n }\n //TODO: reuse users or the other way around\n\n /**\n * List of usersURL to search\n * @param {array} users List of UserUR, like this format user:///\n * @return {Promise}\n */\n\n }, {\n key: 'users',\n value: function users(usersURLs, providedDomains, schemes, resources) {\n var globalFlag = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n\n if (!usersURLs) throw new Error('You need to provide a list of users');\n if (!providedDomains) throw new Error('You need to provide a list of domains');\n if (!resources) throw new Error('You need to provide a list of resources');\n if (!schemes) throw new Error('You need to provide a list of schemes');\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n console.info('[Search] Users: ', usersURLs, usersURLs.length);\n console.info('[Search] Domains: ', providedDomains, providedDomains.length);\n if (usersURLs.length === 0) {\n console.info('Don\\'t have users to discovery');\n resolve(usersURLs);\n } else {\n var getUsers = [];\n\n usersURLs.forEach(function (userURL, index) {\n var currentDomain = providedDomains[index];\n console.info('[Search] Search user ' + userURL + ' for provided domain:', currentDomain);\n if (!globalFlag) {\n getUsers.push(_this.discovery.discoverHyperties(userURL, schemes, resources, currentDomain));\n } else {\n getUsers.push(_this.discovery.discoverHypertiesPerUserProfileData(userURL, schemes, resources));\n }\n });\n\n console.info('Requests promises: ', getUsers);\n\n _promise2.default.all(getUsers.map(function (promise) {\n return promise.then(function (hyperty) {\n return hyperty;\n }, function (error) {\n return error;\n });\n })).then(function (hyperties) {\n\n console.info('[Search] Hyperties from new Discovery', hyperties);\n var result = hyperties.map(function (hyperty) {\n\n if (hyperty.hasOwnProperty('hypertyID')) return hyperty;\n var recent = (0, _keys2.default)(hyperty).reduceRight(function (a, b) {\n var hypertyDate = new Date(hyperty[b].lastModified);\n var hypertyDateP = new Date(hyperty[a].lastModified);\n if (hypertyDateP.getTime() < hypertyDate.getTime()) {\n return b;\n }\n return a;\n });\n\n return hyperty[recent];\n });\n\n var clean = result.filter(function (hyperty) {\n return hyperty.hasOwnProperty('hypertyID');\n });\n\n console.log('Requests result: ', clean);\n\n hyperties.forEach(function (entry) {\n if (entry !== 'No Hyperty was found') {\n return resolve(clean);\n }\n });\n\n reject('No Hyperty was found');\n }).catch(function (reason) {\n console.error(reason);\n resolve(usersURLs);\n });\n }\n });\n }\n }]);\n return Search;\n}();\n\nexports.default = Search;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9TZWFyY2guanM/ZjE4NCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBTZWFyY2gge1xuXG4gIGNvbnN0cnVjdG9yKGRpc2NvdmVyeSwgaWRlbnRpdHlNYW5hZ2VyKSB7XG5cbiAgICBpZiAoIWRpc2NvdmVyeSkgdGhyb3cgbmV3IEVycm9yKCdUaGUgZGlzY292ZXJ5IGNvbXBvbmVudCBpcyBhIG5lZWRlZCBwYXJhbWV0ZXInKTtcbiAgICBpZiAoIWlkZW50aXR5TWFuYWdlcikgdGhyb3cgbmV3IEVycm9yKCdUaGUgaWRlbnRpdHlNYW5hZ2VyIGNvbXBvbmVudCBp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gICAgIHJldHVybiBoeXBlcnR5O1xuICAgICAgICAgICAgbGV0IHJlY2VudCA9IE9iamVjdC5rZXlzKGh5cGVydHkpLnJlZHVjZVJpZ2h0KGZ1bmN0aW9uKGEsIGIpIHtcbiAgICAgICAgICAgICAgbGV0IGh5cGVydHlEYXRlID0gbmV3IERhdGUoaHlwZXJ0eVtiXS5sYXN0TW9kaWZpZWQpO1xuICAgICAgICAgICAgICBsZXQgaHlwZXJ0eURhdGVQID0gbmV3IERhdGUoaHlwZXJ0eVthXS5sYXN0TW9kaWZpZWQpO1xuICAgICAgICAgICAgICBpZiAoaHlwZXJ0eURhdGVQLmdldFRpbWUoKSA8IGh5cGVydHlEYXRlLmdldFRpbWUoKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBiO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgIHJldHVybiBhO1xuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHJldHVybiBoeXBlcnR5W3JlY2VudF07XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBsZXQgY2xlYW4gPSByZXN1bHQuZmlsdGVyKChoeXBlcnR5KSA9PiB7XG4gICAgICAgICAgICByZXR1cm4gaHlwZXJ0eS5oYXNPd25Qcm9wZXJ0eSgnaHlwZXJ0eUlEJyk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBjb25zb2xlLmxvZygnUmVxdWVzdHMgcmVzdWx0OiAnLCBjbGVhbik7XG5cbiAgICAgICAgICBoeXBlcnRpZXMuZm9yRWFjaChmdW5jdGlvbihlbnRyeSkge1xuICAgICAgICAgICAgaWYgKGVudHJ5ICE9PSAnTm8gSHlwZXJ0eSB3YXMgZm91bmQnKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKGNsZWFuKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIHJlamVjdCgnTm8gSHlwZXJ0eSB3YXMgZm91bmQnKTtcblxuICAgICAgICB9K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UE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBR0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///494\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _EventEmitter2 = __webpack_require__(209);\n\nvar _EventEmitter3 = _interopRequireDefault(_EventEmitter2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Context Observer;\n* @author Paulo Chainho [paulo-g-chainho@alticelabs.com]\n*/\n\nvar ContextObserver = function (_EventEmitter) {\n (0, _inherits3.default)(ContextObserver, _EventEmitter);\n\n function ContextObserver(hypertyURL, bus, configuration, contextResourceTypes, factory, syncher) {\n (0, _classCallCheck3.default)(this, ContextObserver);\n\n if (!hypertyURL) throw new Error('The hypertyURL is a needed parameter');\n if (!bus) throw new Error('The MiniBus is a needed parameter');\n if (!configuration) throw new Error('The configuration is a needed parameter ');\n if (!factory) throw new Error('The factory is a needed parameter ');\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (ContextObserver.__proto__ || (0, _getPrototypeOf2.default)(ContextObserver)).call(this));\n\n var _this = _this2;\n\n _this._contextResourceTypes = contextResourceTypes;\n _this._url = hypertyURL;\n _this._discoverUsersPromises = {}; // object with promises executed at discoverUsers function\n _this._observePromises = {}; // object with promises executed at observe function\n\n\n //let identityManager = new IdentityManager(hypertyURL, configuration.runtimeURL, bus);\n console.log('[ContextObserver] started with hypertyURL->', hypertyURL);\n _this._domain = factory.divideURL(configuration.runtimeURL).domain;\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + _this._domain + '/.well-known/dataschema/Context';\n\n _this._users2observe = [];\n _this._observers = {};\n\n _this2._syncher = syncher ? syncher : factory.createSyncher(hypertyURL, bus, configuration);\n\n var discovery = factory.createDiscovery(hypertyURL, configuration.runtimeURL, bus);\n _this._discovery = discovery;\n\n _this._discoveries = {}; //list of discovered objects\n //_this.identityManager = identityManager;\n //_this.search = new Search(discovery, identityManager);\n window.discovery = _this._discovery;\n return _this2;\n }\n\n (0, _createClass3.default)(ContextObserver, [{\n key: 'start',\n value: function start(resumedContext, disconnectedCallBack) {\n var _this = this;\n console.log('[ContextObserver.start] ');\n\n return new _promise2.default(function (resolve, reject) {\n _this._syncher.resumeObservers({ store: true }).then(function (observers) {\n\n var observersList = (0, _keys2.default)(observers);\n\n if (observersList.length > 0) {\n\n console.log('[ContextObserver.start] resuming: ', observers);\n\n /*observersList.forEach((i)=>{\n _this._users2observe.push(new UserAvailabilityController(observers[i]));\n });*/\n _this._observers = observers;\n\n resolve(observers);\n\n observersList.forEach(function (observer) {\n var Context = observers[observer];\n\n // By default resumed context is set with resumedContext.\n if (resumedContext) context.data.values = resumedContext;\n\n // Context will will be updated with value synchronized with reporter if connected\n Context.sync();\n\n //Add listener to be notified when reporter is abruptly disconnected\n if (disconnectedCallBack) Context.onDisconnected(disconnectedCallBack);\n });\n } else {\n resolve(false);\n }\n }).catch(function (reason) {\n console.info('[ContextObserver] Resume Observer failed | ', reason);\n resolve(false);\n });\n }).catch(function (reason) {\n reject('[ContextObserver] Start failed | ', reason);\n });\n }\n }, {\n key: 'resumeDiscoveries',\n value: function resumeDiscoveries() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._discovery.resumeDiscoveries().then(function (discoveries) {\n\n console.log('[ContextObserver._resumeDiscoveries] found: ', discoveries);\n\n discoveries.forEach(function (discovery) {\n\n if (discovery.data.resources && discovery.data.resources[0] === _this._contextResourceTypes[0]) {\n console.log('[ContextObserver._resumeDiscoveries] resuming: ', discovery);\n\n if (discovery.data.status === 'live') {\n // previously discovered object is now live\n resolve([discovery.data]);\n discovery.unsubscribeLive(_this._url);\n } else {\n // previously discovered object is still disconnected\n discovery.onLive(_this._url, function () {\n console.log('[ContextObserver._resumeDiscoveries] disconnected Hyperty is back to live', discovery);\n resolve([discovery.data]);\n discovery.unsubscribeLive(_this._url);\n });\n }\n }\n });\n });\n }).catch(function (reason) {\n reject('[ContextObserver] resumeDiscoveries failed | ', reason);\n });\n }\n }, {\n key: 'onResumeObserver',\n value: function onResumeObserver(callback) {\n var _this = this;\n _this._onResumeObserver = callback;\n }\n }, {\n key: 'discoverUsers',\n value: function discoverUsers(email, domain) {\n var _this = this;\n\n var user = email + '@' + domain;\n\n if (!_this._discoverUsersPromises[user]) {\n _this._discoverUsersPromises[user] = new _promise2.default(function (resolve, reject) {\n\n _this._discovery.discoverHypertiesDO(email, ['context'], _this._contextResourceTypes, domain).then(function (hyperties) {\n //_this.search.users([email], [domain], ['context'], ['Context_context']).then(function(a) {\n console.log('[ContextObserver.discoverUsers] discovery result->', hyperties);\n var discovered = [];\n var disconnected = [];\n hyperties.forEach(function (hyperty) {\n _this._discoveries[hyperty.data.hypertyID] = hyperty;\n if (hyperty.data.status === 'live') {\n discovered.push(hyperty.data);\n } else {\n disconnected.push(hyperty);\n }\n });\n\n if (discovered.length > 0) {\n console.log('[ContextObserver.discoverUsers] returning discovered hyperties data->', discovered);\n resolve(discovered);\n } else if (disconnected.length > 0) {\n console.log('[ContextObserver.discoverUsers] disconnected Hyperties ', disconnected);\n\n //resolve([]);\n\n disconnected[0].onLive(_this._url, function () {\n console.log('[ContextObserver.discoverUsers] disconnected Hyperty is back to live', disconnected[0]);\n\n discovered.push(disconnected[0].data);\n resolve(discovered);\n disconnected[0].unsubscribeLive(_this._url);\n });\n }\n });\n });\n }\n return _this._discoverUsersPromises[user];\n }\n\n /**\n * This function is used to start the user Context observation for a certain user Context reporter\n * @param {DiscoveredObject} hyperty Hyperty to be observed.\n * @return { DataObjectObserver} It returns as a Promise the UserAvailability Data Object Observer.\n */\n\n }, {\n key: 'observe',\n value: function observe(hyperty) {\n var domainSubscription = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _this = this;\n if (!_this._observePromises[hyperty.hypertyID]) {\n _this._observePromises[hyperty.hypertyID] = new _promise2.default(function (resolve, reject) {\n //check if we are already observing it\n _this._users2observe.forEach(function (Context) {\n if (Context._reporter === hyperty.hypertyID) return resolve(Context);\n });\n\n _this._discovery.discoverDataObjectsPerReporter(hyperty.hypertyID, ['context'], _this._contextResourceTypes, _this._domain).then(function (dataObjects) {\n console.log('[ContextObserver.discoverAvailability] discovered context objects ', dataObjects);\n var last = 0;\n var url = void 0;\n\n dataObjects.forEach(function (dataObject) {\n if (dataObject.hasOwnProperty('lastModified') && dataObject.hasOwnProperty('url') && Date.parse(dataObject.lastModified) > last) {\n last = dataObject.lastModified;\n url = dataObject.url;\n\n //console.log('URL DATA Object', url);\n }\n });\n if (last != 0 && url) {\n resolve(_this._subscribeContext(hyperty, url, domainSubscription));\n } else {\n reject('[ContextObserver.observe] discovered DataObjecs are invalid', dataObjects);\n }\n });\n });\n }\n return _this._observePromises[hyperty.hypertyID];\n }\n }, {\n key: '_subscribeContext',\n value: function _subscribeContext(hyperty, url) {\n var domainSubscription = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _this = this;\n\n // avoid duplicated subscriptions\n\n return new _promise2.default(function (resolve, reject) {\n _this._users2observe.forEach(function (Context) {\n if (Context.url === url) return resolve(Context);\n });\n\n _this._syncher.subscribe(_this._objectDescURL, url, null, null, null, domainSubscription).then(function (Context) {\n console.log('[ContextObserver._subscribeContext] observer object', Context);\n\n //let newUserAvailability = new UserAvailabilityController(Context, userID);\n\n _this._users2observe.push(Context);\n\n // When Object is disconnected set user Context status as unavailable\n Context.onDisconnected(function () {\n console.log('[ContextObserver.onDisconnected]: ', Context);\n\n Context.data.values[0].value = 'unavailable';\n Context.sync();\n });\n\n resolve(Context);\n });\n });\n }\n }, {\n key: '_discoverAndSubscribeLegacyUsers',\n value: function _discoverAndSubscribeLegacyUsers(name) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this._discovery.discoverDataObjectsPerName(name).then(function (result) {\n console.log('[ContextObserver._discoverAndSubscribeLegacyUsers] All DataObjects Result', result);\n result.forEach(function (obj) {\n if (obj.status === 'live') {\n console.log('Live obj', obj);\n if (!obj.hypertyID) {\n obj.hypertyID = obj.reporter;\n }\n _this._subscribeContext(obj.schema, obj.url).then(function (resultSubscribe) {\n console.log('[ContextObserver._discoverAndSubscribeLegacyUsers] _subscribeContext', resultSubscribe);\n return resolve(resultSubscribe);\n });\n }\n });\n }).catch(function (err) {\n console.log('error ', err);\n });\n });\n }\n\n /**\n * This function is used to stop the user Context observation for a certain user\n * @param {string} Context the UserAvailability Data Object Observer URL to be unobserved.\n */\n\n }, {\n key: 'unobserve',\n value: function unobserve(Context) {\n var _this = this;\n\n _this._users2observe.forEach(function (user, index) {\n if (user.url === Context) {\n user.unsubscribe();\n _this._users2observe.splice(index, 1);\n }\n });\n }\n }]);\n return ContextObserver;\n}(_EventEmitter3.default); //import IdentityManager from '../identityManager/IdentityManager';\n//import Syncher from '../syncher/Syncher.js';\n//import Discovery from '../discovery/Discovery.js';\n//import {divideURL} from '../utils/utils';\n\n//import Search from '../utils/Search';\n\n\nexports.default = ContextObserver;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBblJBO0FBWkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUE2UkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///495\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _EventEmitter2 = __webpack_require__(209);\n\nvar _EventEmitter3 = _interopRequireDefault(_EventEmitter2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//import {divideURL} from '../utils/utils.js';\n\n// import availability from './availability.js';\n\n/**\n* Context Reporter;\n* @author Paulo Chainho [paulo-g-chainho@alticelabs.com]\n*/\nvar ContextReporter = function (_EventEmitter) {\n (0, _inherits3.default)(ContextReporter, _EventEmitter);\n\n function ContextReporter(hypertyURL, bus, configuration, factory, syncher) {\n (0, _classCallCheck3.default)(this, ContextReporter);\n\n if (!hypertyURL) throw new Error('The hypertyURL is a needed parameter');\n if (!bus) throw new Error('The MiniBus is a needed parameter');\n if (!configuration) throw new Error('The configuration is a needed parameter');\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (ContextReporter.__proto__ || (0, _getPrototypeOf2.default)(ContextReporter)).call(this, hypertyURL, bus, configuration));\n\n var _this = _this2;\n\n console.info('[ContextReporter] started with url: ', hypertyURL);\n\n _this2.syncher = syncher ? syncher : factory.createSyncher(hypertyURL, bus, configuration);\n\n // this.discovery = new Discovery(hypertyURL, bus);\n _this2.domain = factory.divideURL(configuration.runtimeURL).domain;\n _this2.contexts = {};\n\n _this2.contextDescURL = 'hyperty-catalogue://catalogue.' + _this2.domain + '/.well-known/dataschema/Context';\n\n // this.heartbeat = [];\n\n _this2.syncher.onNotification(function (event) {\n var _this = _this2;\n _this.onNotification(event);\n });\n\n //TODO: uncomment when used with service framework develop branch\n\n _this2.syncher.onClose(function (event) {\n\n console.log('[ContextReporter.onClose]');\n var _this = _this2;\n _this.setStatus(event.id, 'unavailable');\n event.ack();\n });\n\n return _this2;\n }\n\n //TODO: move to User availability Reporter or to abstract HypertyContextReporter\n\n (0, _createClass3.default)(ContextReporter, [{\n key: 'start',\n value: function start() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3.syncher.resumeReporters({ store: true }).then(function (reporters) {\n\n var reportersList = (0, _keys2.default)(reporters);\n\n if (reportersList.length > 0) {\n\n console.log('[ContextReporter.start] resuming ', reporters[reportersList[0]]);\n\n // set availability to available\n\n _this.contexts = reporters;\n\n //TODO:\n reportersList.forEach(function (context) {\n _this._onSubscription(_this.contexts[context]);\n });\n\n resolve(_this.contexts);\n } else {\n console.log('[ContextReporter.start] nothing to resume ', reporters);\n resolve(false);\n }\n }).catch(function (reason) {\n console.error('[ContextReporter] Resume failed | ', reason);\n });\n }).catch(function (reason) {\n reject('[ContextReporter] Start failed | ', reason);\n });\n }\n }, {\n key: 'processNotification',\n value: function processNotification(event) {\n var _this = this;\n console.log('[ContextReporter.processNotification: ', event);\n\n event.ack();\n }\n\n /**\n * This function is used to create a new status object syncher\n * @param {URL.UserURL} contacts List of Users\n * @return {Promise}\n */\n\n }, {\n key: 'create',\n value: function create(id, init, resources) {\n var name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'myContext';\n var reporter = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n var reuseURL = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;\n\n //debugger;\n var _this = this;\n var input = void 0;\n return new _promise2.default(function (resolve, reject) {\n if (!reporter && !reuseURL) {\n input = { resources: resources, expires: 30 };\n } else if (reporter && !reuseURL) {\n input = { resources: resources, expires: 30, reporter: reporter };\n } else if (!reporter && reuseURL) {\n input = { resources: resources, expires: 30, reuseURL: reuseURL };\n } else {\n input = { resources: resources, expires: 30, reuseURL: reuseURL, reporter: reporter };\n }\n\n console.info('[ContextReporter.create] lets create a new User availability Context Object ', input);\n _this.syncher.create(_this.contextDescURL, [], init, true, false, name, null, input).then(function (context) {\n _this.contexts[id] = context;\n\n _this._onSubscription(context);\n resolve(context);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: '_onSubscription',\n value: function _onSubscription(context) {\n context.onSubscription(function (event) {\n console.info('[ContextReporter._onSubscription] accepting: ', event);\n event.accept();\n });\n }\n }, {\n key: 'setContext',\n value: function setContext(id, newContext) {\n var _this = this;\n console.log('THIS [ContextReporter.setContext] before change :', _this.contexts[id]);\n console.log('[ContextReporter.setContext] before change :', _this.contexts[id].data);\n\n // _this.contexts[id].data.values[0].value = newContext;\n\n _this.contexts[id].data.values = newContext;\n console.debug('[ContextReporter.setContext] after change :', _this.contexts[id].data);\n _this.trigger(id + '-context-update', newContext);\n }\n }]);\n return ContextReporter;\n}(_EventEmitter3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Service Framework\n//import Syncher from '../syncher/Syncher';\n\n// Utils\n\n\nexports.default = ContextReporter;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jb250ZXh0TWFuYWdlci9Db250ZXh0UmVwb3J0ZXIuanM/MzE1MCJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRV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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFyQ0E7QUFzQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUFBO0FBQUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7O0FBL0lBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQTRKQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///496\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _UserProfile = __webpack_require__(498);\n\nvar _UserProfile2 = _interopRequireDefault(_UserProfile);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MessageBodyIdentity = function MessageBodyIdentity(username, userURL, picture, name, locale, idp, assertion, profile) {\n (0, _classCallCheck3.default)(this, MessageBodyIdentity);\n\n\n if (!idp) throw new Error('IDP should be a parameter');\n if (!username) throw new Error('username should be a parameter');\n\n this.idp = idp;\n\n if (assertion) {\n this.assertion = assertion;\n }\n this.userProfile = new _UserProfile2.default(username, userURL, picture, name, locale, profile);\n}; /**\n * The Identity info to be added to Message.Body.Identity\n */\n\nexports.default = MessageBodyIdentity;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9NZXNzYWdlQm9keUlkZW50aXR5LmpzP2M1OWMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIFRoZSBJZGVudGl0eSBpbmZvIHRvIGJlIGFkZGVkIHRvIE1lc3NhZ2UuQm9keS5JZGVudGl0eVxuKi9cblxuaW1wb3J0IFVzZXJQcm9maWxlIGZyb20gJy4vVXNlclByb2ZpbGUnO1xuXG5jbGFzcyBNZXNzYWdlQm9keUlkZW50aXR5IHtcblxuICBjb25zdHJ1Y3Rvcih1c2VybmFtZSwgdXNlclVSTCwgcGljdHVyZSwgbmFtZSwgbG9jYWxlLCBpZHAsIGFzc2VydGlvbiwgcHJvZmlsZSkge1xuXG4gICAgaWYgKCFpZHApIHRocm93IG5ldyBFcnJvcignSURQIHNob3VsZCBiZSBhIHBhcmFtZXRlcicpO1xuICAgIGlmICghdXNlcm5hbWUpIHRocm93IG5ldyBFcnJvcigndXNlcm5hbWUgc2hvdWxkIGJlIGEgcGFyYW1ldGVyJyk7XG5cbiAgICB0aGlzLmlkcCA9IGlkcDtcblxuICAgIGlmIChhc3NlcnRpb24pICAgICAgeyB0aGlzLmFzc2VydGlvbiA9IGFzc2VydGlvbjsgfVxuICAgIHRoaXMudXNlclByb2ZpbGUgPSBuZXcgVXNlclByb2ZpbGUodXNlcm5hbWUsIHVzZXJVUkwsIHBpY3R1cmUsIG5hbWUsIGxvY2FsZSwgcHJvZmlsZSk7XG5cbiAgfVxuXG59XG5cblxuZXhwb3J0IGRlZmF1bHQgTWVzc2FnZUJvZHlJZGVudGl0eTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvaWRlbnRpdHkvTWVzc2FnZUJvZHlJZGVudGl0eS5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUlBO0FBQ0E7Ozs7O0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFFQTs7OztBQUtBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///497\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* The UserProfile according to User Identity Data Model\n*/\n\nvar UserProfile = function UserProfile(username, userURL, picture, name, locale, profile) {\n (0, _classCallCheck3.default)(this, UserProfile);\n\n\n if (username) {\n this.preferred_username = username;\n }\n if (picture) {\n this.picture = picture;\n }\n if (name) {\n this.name = name;\n }\n if (locale) {\n this.locale = locale;\n }\n if (userURL) {\n this.userURL = userURL;\n }\n if (profile) (0, _assign2.default)(this, profile);\n};\n\nexports.default = UserProfile;\nmodule.exports = exports["default"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7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFFQTtBQUNBO0FBRUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///498\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _communication = __webpack_require__(500);\n\nvar _ChatController = __webpack_require__(210);\n\nvar _ChatController2 = _interopRequireDefault(_ChatController);\n\nvar _UserInfo = __webpack_require__(502);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Hyperty Group Chat Manager API (HypertyChat)\n* @author Vitor Silva [vitor-t-silva@telecom.pt]\n* @version 0.1.0\n*/\nvar ChatManager = function () {\n function ChatManager(myUrl, bus, configuration, syncher, factory) {\n (0, _classCallCheck3.default)(this, ChatManager);\n\n if (!myUrl) throw new Error('[ChatManager.constructor] The myUrl is a needed parameter');\n if (!bus) throw new Error('[ChatManager.constructor] The MiniBus is a needed parameter');\n if (!configuration) throw new Error('[ChatManager.constructor] The configuration is a needed parameter');\n\n var _this = this;\n if (!syncher) {\n syncher = factory.createSyncher(myUrl, bus, configuration);\n }\n\n _this._runtimeURL = configuration.runtimeURL;\n\n var domain = factory.divideURL(_this._runtimeURL).domain;\n var discovery = factory.createDiscovery(myUrl, configuration.runtimeURL, bus);\n var identityManager = factory.createIdentityManager(myUrl, configuration.runtimeURL, bus);\n\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + domain + '/.well-known/dataschema/Communication';\n\n _this._reportersControllers = {};\n _this._observersControllers = {};\n\n _this._myUrl = myUrl;\n _this._bus = bus;\n _this._syncher = syncher;\n _this._domain = domain;\n\n _this.discovery = discovery;\n _this.identityManager = identityManager;\n _this.currentIdentity;\n\n _this.search = factory.createSearch(discovery, identityManager);\n\n _this.communicationObject = _communication.communicationObject;\n\n _this.communicationChildren = _communication.communicationChildren;\n\n console.log('[ChatManager] Discover ', discovery);\n console.log('[ChatManager] Identity Manager ', identityManager);\n }\n\n (0, _createClass3.default)(ChatManager, [{\n key: 'processNotification',\n value: function processNotification(event) {\n var _this = this;\n console.log('[ChatManager.processNotification: ', event);\n\n if (event.type === 'create') {\n\n // TODO: replace the 100 for Message.Response\n // event.ack(200);\n\n if (_this._onInvitation) {\n _this._onInvitation(event);\n }\n }\n\n if (event.type === 'delete') {\n // TODO: replace the 200 for Message.Response\n event.ack(200);\n\n _this._observersControllers[event.url].closeEvent = event;\n\n delete _this._observersControllers[event.url];\n\n _this._observersControllers.closeEvent = event;\n\n _this.communicationObject = _communication.communicationObject;\n\n for (var url in this._reportersControllers) {\n this._reportersControllers[url].close(event);\n }\n\n for (var _url in this._observersControllers) {\n this._observersControllers[_url].close(event);\n }\n }\n }\n }, {\n key: 'myIdentity',\n value: function myIdentity(identity) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n console.info('[ChatManager.myIdentity]');\n if (identity) return resolve(identity);\n\n if (_this._myUrl.includes('hyperty://')) {\n _this.identityManager.discoverUserRegistered().then(function (identity) {\n resolve(identity);\n }).catch(function (reason) {\n reject(reason);\n });\n } else {\n _this.identityManager.discoverIdentityPerIdP().then(function (identity) {\n resolve(identity);\n }).catch(function (reason) {\n reject(reason);\n });\n }\n });\n }\n\n /**\n * This function is used to create a new Group Chat providing the name and the identifiers of users to be invited.\n * @param {string} name Is a string to identify the Group Chat\n * @param {array} users Array of users to be invited to join the Group Chat. Users are identified with reTHINK User URL, like this format user:///\n * @return {ChatController} A ChatController object as a Promise.\n */\n\n }, {\n key: 'create',\n value: function create(name, users) {\n var extra = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n\n var _this = this;\n var syncher = _this._syncher;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.communicationObject = _communication.communicationObject;\n _this.communicationObject.cseq = 1;\n _this.communicationObject.startingTime = new Date().toJSON();\n _this.communicationObject.status = _communication.CommunicationStatus.OPEN;\n\n var myIdentity = void 0;\n\n _this.myIdentity().then(function (identity) {\n myIdentity = identity;\n console.log('[ChatManager.create ] My Identity', identity);\n\n // let url = _this.communicationObject.reporter;\n\n var userInfo = new _UserInfo.UserInfo(_this._myUrl, _this._domain, identity);\n\n // Add my identity\n _this.communicationObject.participants[identity.guid] = userInfo;\n\n console.log('[ChatManager.create ] participants: ', _this.communicationObject.participants);\n console.log('[ChatManager.create ] communicationObject', _this.communicationObject);\n console.info('[ChatManager.create] searching ' + users);\n\n //let usersSearch = _this.search.users(users, domains, ['comm'], ['chat']);\n\n var usersDiscovery = [];\n\n var disconnected = [];\n var live = {};\n var mutual = true;\n\n users.forEach(function (user) {\n var userDiscoveryPromise = _this.discovery.discoverHypertiesDO(user.user, ['comm'], ['chat'], user.domain);\n usersDiscovery.push(userDiscoveryPromise);\n\n //if (user.user.includes('://')) mutual = false;\n });\n\n _promise2.default.all(usersDiscovery).then(function (userDiscoveryResults) {\n console.log('[ChatManager.create] Users Discovery Results->', userDiscoveryResults);\n\n var selectedHyperties = [];\n\n userDiscoveryResults.forEach(function (userDiscoveryResult) {\n\n userDiscoveryResult.forEach(function (discovered) {\n if (discovered.data.status === 'live') {\n selectedHyperties.push(discovered.data.hypertyID);\n live[discovered.data.hypertyID] = discovered;\n } else {\n // To control the number of subscriptions to disconnected devices\n if (disconnected.length < 5) {\n disconnected.push(discovered);\n }\n }\n });\n });\n\n /* return usersSearch;\n }).then((hypertiesIDs) => {\n let selectedHyperties = hypertiesIDs.map((hyperty) => {\n return hyperty.hypertyID;\n }); */\n\n console.info('[ChatManager] ---------------------- Syncher Create ---------------------- \\n');\n console.info('[ChatManager] Selected Hyperties: !!! ', selectedHyperties);\n console.info('Have ' + selectedHyperties.length + ' users;');\n\n var input = (0, _assign2.default)({ resources: ['chat'], mutual: mutual }, extra);\n delete input.name;\n\n console.info('[ChatManager] input data:', input);\n return syncher.create(_this._objectDescURL, selectedHyperties, _this.communicationObject, true, false, name, {}, input);\n }).then(function (dataObjectReporter) {\n\n console.info('[ChatManager] 3. Return Create Data Object Reporter', dataObjectReporter);\n\n var chatController = new _ChatController2.default(syncher, _this.discovery, _this._domain, _this.search, myIdentity, _this);\n chatController.dataObjectReporter = dataObjectReporter;\n\n _this._reportersControllers[dataObjectReporter.url] = chatController;\n\n console.log('[ChatManager] chatController invitationsHandler: ', chatController.invitationsHandler);\n\n // process invitations to handle not received invitations\n if (dataObjectReporter.invitations.length > 0) {\n chatController.invitationsHandler.processInvitations(live, dataObjectReporter);\n }\n\n // If any invited User is disconnected let's wait until it is connected again\n if (disconnected.length > 0) chatController.invitationsHandler.inviteDisconnectedHyperties(disconnected, dataObjectReporter);\n\n resolve(chatController);\n }).catch(function (reason) {\n reject(reason);\n });\n }).catch(function (reason) {\n console.log('[ChatManager.create] MyIdentity Error:', reason);\n return reject(reason);\n });\n });\n }\n\n /**\n * This function is used to handle notifications about incoming invitations to join a Group Chat.\n * @param {Function} CreateEvent The CreateEvent fired by the Syncher when an invitaion is received\n */\n\n }, {\n key: 'onInvitation',\n value: function onInvitation(callback) {\n var _this = this;\n _this._onInvitation = callback;\n }\n\n /**\n * This function is used to join a Group Chat.\n * @param {URL.CommunicationURL} invitationURL The Communication URL of the Group Chat to join that is provided in the invitation event\n * @return {ChatController} It returns the ChatController object as a Promise\n */\n\n }, {\n key: 'join',\n value: function join(invitationURL) {\n var mutual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var identity = arguments[2];\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var syncher = _this._syncher;\n var myIdentity = void 0;\n\n console.info('[ChatManager] ------------------------ Syncher subscribe ---------------------- \\n');\n console.info('invitationURL', invitationURL);\n _this.myIdentity(identity).then(function (identity) {\n myIdentity = identity;\n return syncher.subscribe(_this._objectDescURL, invitationURL, true, false, mutual, true, identity);\n }).then(function (dataObjectObserver) {\n console.info('Data Object Observer: ', dataObjectObserver);\n\n var chatController = new _ChatController2.default(syncher, _this.discovery, _this._domain, _this.search, myIdentity, _this);\n resolve(chatController);\n\n chatController.dataObjectObserver = dataObjectObserver;\n\n _this._observersControllers[dataObjectObserver.url] = chatController;\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }]);\n return ChatManager;\n}();\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Service Framework\n//import IdentityManager from '../identityManager/IdentityManager';\n//import RegistrationStatus from '../discovery/RegistrationStatus';\n//import Discovery from '../discovery/Discovery';\n//import Syncher from '../syncher/Syncher';\n\n// Utils\n//import {divideURL} from '../utils/utils';\n//import Search from '../utils/Search';\n\n// Internals\n\n\nexports.default = ChatManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk5LmpzIiwic291cm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==\n//# sourceURL=webpack-internal:///499\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\nvar CommunicationStatus = exports.CommunicationStatus = {\n OPEN: 'open',\n PENDING: 'pending',\n CLOSED: 'closed',\n PAUSED: 'paused',\n FAILED: 'failed'\n};\n\nvar communicationObject = exports.communicationObject = {\n startingTime: '',\n status: '',\n participants: {}\n};\n\nvar communicationChildren = exports.communicationChildren = {\n \"parent\": \"communication\",\n \"listener\": \"resources\",\n \"type\": \"HypertyResource\"\n};\n\n/*\nexport let communicationObject = {\n id: '',\n name: '',\n owner: '',\n scheme: 'comm',\n startingTime: '',\n lastModified: '',\n duration: '',\n status: '',\n participants: []\n};\n*///# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9jb21tdW5pY2F0aW9uLmpzPzczMTUiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWd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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFMQTtBQUNBO0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUNBO0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUNBO0FBS0E7Ozs7Ozs7Ozs7OztBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///500\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* To manage Group Chat Invitations\n* @author Paulo Chainho [paulo-g-chainho@alticelabs.com]\n* @version 0.1.0\n*/\n\n// TODO: have an instance per ChatController\n\nvar InvitationsHandler = function () {\n function InvitationsHandler(hypertyURL) {\n (0, _classCallCheck3.default)(this, InvitationsHandler);\n\n\n if (!hypertyURL) throw Error('hypertyURL is a necessary dependecy');\n\n var _this = this;\n _this._hypertyURL = hypertyURL;\n\n _this._pending = {}; // All pending invitations\n }\n\n (0, _createClass3.default)(InvitationsHandler, [{\n key: 'inviteDisconnectedHyperties',\n\n\n /**\n * This function is used to handle notifications for disconnected Hy+erties.\n * @param {DiscoveredObject[]} disconnected array of discovered hyperties that are disconnected\n * @param {DataObjectReporter} DataObjectReporter Data Object Reporter addressed by invitations\n */\n\n value: function inviteDisconnectedHyperties(disconnected, dataObjectReporter) {\n\n var _this = this;\n console.log('[GroupChatManager.InvitationsHandler.inviteDisconnectedHyperties] lets invite ', disconnected);\n\n disconnected.forEach(function (disconnectedHyperty) {\n\n if (!_this._pending[dataObjectReporter]) {\n _this._pending[dataObjectReporter] = {};\n }\n\n _this._pending[dataObjectReporter][disconnectedHyperty.data.hypertyID] = disconnectedHyperty;\n\n disconnectedHyperty.onLive(_this._hypertyURL, function () {\n console.log('[GroupChatManager.create] disconnected Hyperty is back to live', disconnectedHyperty);\n\n dataObjectReporter.inviteObservers([disconnectedHyperty.data.hypertyID]);\n\n disconnectedHyperty.unsubscribeLive(_this._hypertyURL);\n\n delete _this._pending[dataObjectReporter][disconnectedHyperty.data.hypertyID];\n });\n });\n }\n\n /**\n * This function is used to process sent invitations. In case invitations are not acknowledge by recipient it will be handled as a disconnected hyperty\n * @param {DiscoveredObject[]} live array of discovered hyperties that are or were live\n * @param {DataObjectReporter} DataObjectReporter Data Object Reporter addressed by invitations\n */\n\n }, {\n key: 'processInvitations',\n value: function processInvitations(live, dataObjectReporter) {\n var _this2 = this;\n\n var _this = this;\n\n var invitations = dataObjectReporter.invitations || [];\n\n console.log('[GroupChatManager.InvitationsHandler.processInvitations] waiting for replies ', invitations, this._invitationsResponse);\n\n invitations.forEach(function (invitation) {\n invitation.then(function (result) {\n console.log('[GroupChatManager.InvitationsHandler.processInvitations] - OK: ', result, _this2._invitationsResponse);\n if (_this2._invitationsResponse) {\n _this2._invitationsResponse(result);\n }\n }).catch(function (result) {\n console.log('[GroupChatManager.InvitationsHandler.processInvitations] - NOT OK: ', result, _this2._invitationsResponse);\n if (_this2._invitationsResponse) {\n _this2._invitationsResponse(result);\n }\n _this.inviteDisconnectedHyperties([live[result.invited]], dataObjectReporter);\n });\n });\n }\n }, {\n key: 'resumeDiscoveries',\n value: function resumeDiscoveries(discoveryEngine, groupChat) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var live = {};\n var liveHyperties = [];\n var disconnected = [];\n var unsubscriptonPromises = [];\n\n discoveryEngine.resumeDiscoveries().then(function (discoveries) {\n\n console.log('[GroupChatManager.InvitationsHandler.resumeDiscoveries] found: ', discoveries);\n\n discoveries.forEach(function (discovery) {\n\n if (discovery.data.resources && discovery.data.resources[0] === 'chat') {\n console.log('[GroupChatManager.InvitationsHandler.resumeDiscoveries] resuming: ', discovery);\n\n if (discovery.data.status === 'live') {\n // previously discovered object is now live\n live[discovery.data.hypertyID] = discovery;\n liveHyperties.push(discovery.data.hypertyID);\n unsubscriptonPromises.push(discovery.unsubscribeLive(_this._hypertyURL));\n } else {\n // previously discovered object is still disconnected\n disconnected.push(discovery);\n }\n }\n });\n if (disconnected.length > 0) _this.inviteDisconnectedHyperties(disconnected, groupChat);\n\n if ((0, _keys2.default)(live).length > 0) {\n groupChat.inviteObservers(liveHyperties);\n\n if (groupChat.invitations.length > 0) _this.processInvitations(live, groupChat);\n\n _promise2.default.all(unsubscriptonPromises).then(function () {\n resolve();\n });\n } else resolve();\n });\n }).catch(function (reason) {\n reject('[GroupChatManager.InvitationsHandler.resumeDiscoveries] failed | ', reason);\n });\n }\n\n /**\n * This function is used to remove and clean all pending invitations.\n * @param {DataObjectReporter} DataObjectReporter Data Object Reporter addressed by invitations\n * @return {Promise} return a promise when all unsubscriptons for pending invitations are finished\n */\n\n }, {\n key: 'cleanInvitations',\n value: function cleanInvitations(dataObjectReporter) {\n var _this = this;\n\n var chatInvitations = _this._pending[dataObjectReporter];\n\n console.log('[GroupChatManager.InvitationsHandler.cleanInvitations] ', chatInvitations);\n\n if (chatInvitations) {\n\n return new _promise2.default(function (resolve, reject) {\n var pendingInvitations = (0, _keys2.default)(chatInvitations);\n\n var unsubscriptonPromises = [];\n\n pendingInvitations.forEach(function (invitation) {\n unsubscriptonPromises.push(chatInvitations[invitation].unsubscribeLive(_this._hypertyURL));\n });\n\n _promise2.default.all(pendingInvitations).then(function () {\n resolve();\n });\n });\n } else return _promise2.default.resolve();\n }\n }, {\n key: 'invitationResponse',\n set: function set(callback) {\n this._invitationsResponse = callback;\n }\n }]);\n return InvitationsHandler;\n}();\n\nexports.default = InvitationsHandler;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9JbnZpdGF0aW9uc0hhbmRsZXIuanM/ZWEwMCJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDI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UFDQTtBQUNBOzs7OztBQThJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///501\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.UserInfo = undefined;\n\nvar _defineProperty2 = __webpack_require__(503);\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar UserInfo = exports.UserInfo = function UserInfo(hypertyURL, domain, identity) {\n var _ref;\n\n (0, _classCallCheck3.default)(this, UserInfo);\n\n\n var completeIdentity = (0, _utils.deepClone)(identity);\n if (!identity.hasOwnProperty('userProfile')) {\n completeIdentity['userProfile'] = identity;\n }\n\n return _ref = {\n hypertyURL: hypertyURL,\n domain: domain }, (0, _defineProperty3.default)(_ref, 'domain', domain), (0, _defineProperty3.default)(_ref, 'identity', completeIdentity), _ref;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9Vc2VySW5mby5qcz81MThiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlZXBDbG9uZSB9IGZyb20gJy4uL3V0aWxzL3V0aWxzJztcblxuZXhwb3J0IGNsYXNzIFVzZXJJbmZvIHtcblxuICBjb25zdHJ1Y3RvcihoeXBlcnR5VVJMLCBkb21haW4sIGlkZW50aXR5KSB7XG5cbiAgICBsZXQgY29tcGxldGVJZGVudGl0eSA9IGRlZXBDbG9uZShpZGVudGl0eSk7XG4gICAgaWYgKCFpZGVudGl0eS5oYXNPd25Qcm9wZXJ0eSgndXNlclByb2ZpbGUnKSkge1xuICAgICAgY29tcGxldGVJZGVudGl0eVsndXNlclByb2ZpbGUnXSA9IGlkZW50aXR5O1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBoeXBlcnR5VVJMOiBoeXBlcnR5VVJMLFxuICAgICAgZG9tYWluLCBkb21haW4sXG4gICAgICBpZGVudGl0eTogY29tcGxldGVJZGVudGl0eVxuICAgIH1cblxuICB9XG5cbn1cblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvY2hhdE1hbmFnZXIvVXNlckluZm8uanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7OztBQUNBO0FBRUE7QUFDQTtBQURBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFJQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///502\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(204);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9kZWZpbmVQcm9wZXJ0eS5qcz82Y2U3Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG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7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///503\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _Bus2 = __webpack_require__(211);\n\nvar _Bus3 = _interopRequireDefault(_Bus2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author micaelpedrosa@gmail.com\n* Message BUS Interface is an extension of the Bus\n* It is used mainly in the internal sandbox routing.\n*/\nvar MiniBus = function (_Bus) {\n (0, _inherits3.default)(MiniBus, _Bus);\n\n function MiniBus() {\n (0, _classCallCheck3.default)(this, MiniBus);\n return (0, _possibleConstructorReturn3.default)(this, (MiniBus.__proto__ || (0, _getPrototypeOf2.default)(MiniBus)).call(this));\n }\n\n /**\n * Post a message for routing. Message is routed directly to the external routing _onPostMessage.\n * @param {Message} inMsg JSON with mandatory Message structure {id, type, from, to}\n * @param {Callback} responseCallback Optional callback if a response is expected from the request. A response will be always sent, even if it is a \"Timeout\".\n * @return {number} the Message id\n */\n\n\n (0, _createClass3.default)(MiniBus, [{\n key: 'postMessage',\n value: function postMessage(inMsg, responseCallback, timeout) {\n var _this = this;\n\n _this._genId(inMsg);\n _this._responseCallback(inMsg, responseCallback, timeout);\n\n //always send to external (to core MessageBus)\n _this._onPostMessage(inMsg);\n\n return inMsg.id;\n }\n\n //internal method used when a message is received by an external routing system\n\n }, {\n key: '_onMessage',\n value: function _onMessage(msg) {\n var _this = this;\n\n if (!_this._onResponse(msg)) {\n var itemList = _this._subscriptions[msg.to];\n if (itemList) {\n _this._publishOn(itemList, msg);\n if (!msg.to.startsWith('hyperty')) {\n _this._publishOnDefault(msg);\n }\n } else {\n _this._publishOnDefault(msg);\n }\n }\n }\n }]);\n return MiniBus;\n}(_Bus3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = MiniBus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9idXMvTWluaUJ1cy5qcz9lNTIwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlya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UE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUF2Q0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///504\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the "License");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an "AS IS" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n* @author: Gil Dias (gil.dias@tecnico.ulisboa.pt)\n* Registry Data Model includes all Objects to be handled by the Registry functionality including\n*/\nvar RegistryDataModel = function () {\n function RegistryDataModel(id, url, descriptorURL, p2pRequester, startingTime, lastModified, status, stubs, stubsConfiguration) {\n (0, _classCallCheck3.default)(this, RegistryDataModel);\n\n var _this = this;\n\n _this._id = id;\n _this._url = url;\n _this._descriptorURL = descriptorURL;\n _this._startingTime = startingTime;\n _this._lastModified = lastModified;\n _this._status = status;\n _this._stubs = stubs;\n _this._stubsConfiguration = stubsConfiguration;\n _this._p2pRequester = p2pRequester;\n }\n\n (0, _createClass3.default)(RegistryDataModel, [{\n key: "id",\n get: function get() {\n var _this = this;\n return _this._id;\n }\n }, {\n key: "url",\n get: function get() {\n var _this = this;\n return _this._url;\n }\n }, {\n key: "descriptorURL",\n get: function get() {\n var _this = this;\n return _this._descriptorURL;\n }\n }, {\n key: "p2pRequester",\n get: function get() {\n var _this = this;\n return _this._p2pRequester;\n }\n }, {\n key: "lastModified",\n get: function get() {\n var _this = this;\n return _this._lastModified;\n }\n }]);\n return RegistryDataModel;\n}();\n\nexports.default = RegistryDataModel;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9SZWdpc3RyeURhdGFNb2RlbC5qcz83YTJmIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKi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gX3RoaXMgPSB0aGlzO1xuICAgIHJldHVybiBfdGhpcy5fcDJwUmVxdWVzdGVyO1xuICB9XG5cbiAgZ2V0IGxhc3RNb2RpZmllZCgpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuICAgIHJldHVybiBfdGhpcy5fbGFzdE1vZGlmaWVkO1xuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUmVnaXN0cnlEYXRhTW9kZWw7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3JlZ2lzdHJ5L1JlZ2lzdHJ5RGF0YU1vZGVsLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFzQkE7Ozs7QUFJQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///505\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _HypertyInstance = __webpack_require__(212);\n\nvar _HypertyInstance2 = _interopRequireDefault(_HypertyInstance);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Registry'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* Runtime DomainRegistration Interface\n*/\nvar DomainRegistration = function () {\n\n /**\n * To initialise the Runtime Registry with the RuntimeURL that will be the basis to derive the internal runtime addresses when allocating addresses to internal runtime component. In addition, the Registry domain back-end to be used to remotely register Runtime components, is also passed as input parameter.\n * @param {MessageBus} messageBus msgbus\n * @param {HypertyRuntimeURL} runtimeURL runtimeURL\n * @param {DomainURL} domain remoteRegistry\n */\n function DomainRegistration(runtimeURL, registryURL, domain, messageBus) {\n (0, _classCallCheck3.default)(this, DomainRegistration);\n\n\n if (!runtimeURL) throw new Error('runtimeURL is missing.');\n if (!registryURL) throw new Error('registryURL is missing.');\n if (!domain) throw new Error('domain is missing.');\n if (!messageBus) throw new Error('messageBus is missing.');\n\n var _this = this;\n\n _this.registryURL = registryURL;\n _this.runtimeURL = runtimeURL;\n _this._registrationRetries = 5; // number of attempts to register Hyperties and DataObjects when errors occurs\n\n // the expires in 3600, represents 1 hour\n //the expires is in seconds, unit of measure received by the domain registry\n _this.expiresTime = 3600;\n\n _this._domain = domain;\n _this._messageBus = messageBus;\n }\n\n /**\n * function to unregister an hypertyInstance in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n\n (0, _createClass3.default)(DomainRegistration, [{\n key: 'unregisterHyperty',\n value: function unregisterHyperty(hypertyInstance) {\n var _this = this;\n\n var message = { type: 'update', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: '/hyperty/' + hypertyInstance, value: 'disconnected', attribute: 'status' } };\n\n _this._messageBus.postMessage(message, function (reply) {\n log.log('[DomainRegistration] unregister hyperty Reply', reply);\n });\n }\n\n /**\n * function to unregister a Data Object in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n }, {\n key: 'unregisterDataObject',\n value: function unregisterDataObject(url) {\n var _this = this;\n\n var message = { type: 'update', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: {\n resource: url,\n value: {\n status: 'disconnected'\n }\n } };\n\n _this._messageBus.postMessage(message, function (reply) {\n log.log('[DomainRegistration] unregister dataObject Reply', reply);\n });\n }\n\n /**\n * function to delete an dataObjectInstance in the Domain Registry\n * @param {String} name DataObjectName\n */\n\n }, {\n key: 'deleteDataObjectInstance',\n value: function deleteDataObjectInstance(name) {\n var _this = this;\n\n var message = { type: 'delete', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { value: { name: name } } };\n\n _this._messageBus.postMessage(message, function (reply) {\n log.log('[DomainRegistration] unregister dataObject Reply', reply);\n });\n }\n\n /**\n * Function to update an Hyperty\n */\n\n }, {\n key: 'updateHypertyInstance',\n value: function updateHypertyInstance(resource, value) {\n var _this = this;\n\n var message = { type: 'UPDATE', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: resource, value: value } };\n\n _this._messageBus.post.postMessage(message, function (reply) {\n // log.log('[Registry] Updated hyperty reply', reply);\n });\n }\n\n /**\n * To register a new Data Object in the Domain Registry.\n * @param {JSON} registration registration data to be used\n * @param {boolean} resume if this is just to update the registration with the resume of a data object\n */\n\n }, {\n key: 'registerDataObject',\n value: function registerDataObject(registration, resume, p2pHandlerStub) {\n\n var _this = this;\n\n var p2pHandler = void 0;\n var p2pRequester = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n var dataScheme = [];\n var filteredDataScheme = registration.url.split(':');\n dataScheme.push(filteredDataScheme[0]);\n\n if ((0, _keys2.default)(p2pHandlerStub).length !== 0) {\n p2pHandler = p2pHandlerStub[_this.runtimeURL].url;\n p2pRequester = _runtimeUtils.runtimeUtils.runtimeDescriptor.p2pRequesterStub;\n }\n\n registration.startingTime = registration.created;\n\n delete registration.authorise;\n delete registration.created;\n delete registration.mutual;\n delete registration.resume;\n\n if (!registration.expires) registration.expires = _this.expiresTime;\n\n registration.dataSchemes = dataScheme;\n\n if (p2pHandler) {\n registration.p2pHandler = p2pHandler;\n registration.p2pRequester = p2pRequester;\n }\n\n registration.status = 'live';\n\n var message = void 0;\n\n if (!resume) {\n\n log.log('[Registry.registerDataObject] registering new data object URL', registration);\n\n message = { type: 'create', from: _this.registryURL, to: 'domain://registry.' + _this._domain, body: { value: registration, policy: 'policy' } };\n } else {\n\n log.log('[Registry.registerDataObject] registering previously registered data object URL', registration);\n\n message = {\n type: 'update',\n to: 'domain://registry.' + _this._domain,\n from: _this.registryURL,\n body: { resource: registration.url, value: { status: 'live' } }\n };\n }\n\n try {\n _this._messageBus.postMessageWithRetries(message, _this._registrationRetries, function (reply) {\n // log.log('[Registry.registerDataObject] ===> registerDataObject Reply: ', reply);\n if (reply.body.code === 200) {\n resolve(registration);\n } else {\n reject('error on register DataObject');\n }\n });\n } catch (e) {\n log.error(e);\n reject(e);\n }\n\n //timer to keep the registration alive\n // the time is defined by a little less than half of the expires time defined\n var keepAliveTimer = setInterval(function () {\n\n var message = {\n type: 'update',\n from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: registration.url, value: { status: 'live' }, method: 'refresh' }\n };\n\n _this._messageBus.postMessage(message, function (reply) {\n // log.log('[Registry.registerDataObject] KeepAlive Reply: ', reply);\n });\n }, registration.expires / 1.1 / 2 * 1000);\n });\n }\n\n /**\n * To register a new Hyperty in the Domain Registry.\n * @param {HypertyInstance} hyperty Hyperty to be registered\n * @param {boolean} resume if this is just to update the registration with the resume of a data object\n */\n\n }, {\n key: 'registerHyperty',\n value: function registerHyperty(hyperty, resume) {\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //assuming descriptor come in this format, the service-provider-domain url is retrieved by a split instruction\n //hyperty-catalogue:///\n /* let domainUrl = divideURL(hyperty.descriptorURL).domain;\n \n if (domainUrl.includes('catalogue')) {\n domainUrl = domainUrl.replace('catalogue.', '');\n }\n _this.registryDomain = domainUrl;*/\n\n var runtime = _this.runtimeURL;\n var status = 'live';\n\n //message to register the new hyperty, within the domain registry\n var message = void 0;\n var registrationExpires = _this.expiresTime;\n\n var messageValue = {\n user: hyperty.user.email,\n descriptor: hyperty.descriptorURL,\n url: hyperty.hypertyURL,\n expires: registrationExpires,\n resources: hyperty.resources,\n dataSchemes: hyperty.dataSchemes,\n runtime: runtime,\n status: status\n };\n\n // set a different expires if defined in the hyperty configuration\n\n if (hyperty.p2pHandler) {\n messageValue.p2pHandler = hyperty.p2pHandler;\n messageValue.p2pRequester = hyperty.p2pRequester;\n }\n\n // set a different expires value if configured in the Hyperty descriptor\n\n if (hyperty.descriptor.configuration && hyperty.descriptor.configuration.expires) registrationExpires = hyperty.descriptor.configuration.expires;\n\n if (!resume) {\n // log.log('[Registry registerHyperty] registering new Hyperty URL', addressURL.address[0]);\n\n\n // set a different expires if defined in the hyperty configuration\n\n\n // log.log('[Registry registerHyperty] registering new Hyperty at domain registry ', messageValue);\n\n message = { type: 'create', from: _this.registryURL, to: 'domain://registry.' + _this._domain, body: { value: messageValue, policy: 'policy' } };\n } else {\n // log.log('[Registry registerHyperty] registering previously registered Hyperty URL', addressURL.address[0]);\n\n message = {\n type: 'update',\n to: 'domain://registry.' + _this._domain,\n from: _this.registryURL,\n body: { resource: hyperty.hypertyURL, value: { status: 'live', user: hyperty.user.email } }\n };\n\n if (hyperty.p2pHandler) {\n message.body.value.p2pHandler = hyperty.p2pHandler;\n message.body.value.p2pRequester = hyperty.p2pRequester;\n }\n }\n\n // log.log('[Registry registerHyperty] Hyperty registration at domain registry - ', message);\n\n try {\n _this._messageBus.postMessageWithRetries(message, _this._registrationRetries, function (reply) {\n // log.log('[Registry registerHyperty] Hyperty registration response: ', reply);\n\n if (reply.body.code === 200) {\n var result = { url: hyperty.hypertyURL };\n if (hyperty.p2pHandler) {\n result.p2pHandler = hyperty.p2pHandler;\n result.p2pRequester = hyperty.p2pRequester;\n }\n\n resolve(result);\n } else if (reply.body.code === 404) {\n // log.log('[Registry registerHyperty] The update was not possible. Registering new Hyperty at domain registry');\n\n message = { type: 'create', from: _this.registryURL, to: 'domain://registry.' + _this._domain, body: { value: messageValue, policy: 'policy' } };\n\n try {\n _this._messageBus.postMessageWithRetries(message, _this._registrationRetries, function (reply) {\n // log.log('[Registry registerHyperty] Hyperty registration update response: ', reply);\n\n if (reply.body.code === 200) {\n var _result = { url: hyperty.hypertyURL };\n if (hyperty.p2pHandler) {\n _result.p2pHandler = hyperty.p2pHandler;\n _result.p2pRequester = hyperty.p2pRequester;\n }\n\n resolve(_result);\n } else {\n throw new Error('Failed to register an Hyperty: ' + reply);\n }\n });\n } catch (e) {\n log.error(e);\n reject(e);\n }\n } else {\n throw new Error('Failed to register an Hyperty to domain: ', reply);\n }\n });\n } catch (e) {\n log.error(e);\n reject(e);\n }\n\n //timer to keep the registration alive\n // the time is defined by a little less than half of the expires time defined\n var keepAliveTimer = setInterval(function () {\n\n var message = {\n type: 'update',\n from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: hyperty.hypertyURL, value: { status: 'live' }, method: 'refresh' } };\n\n _this._messageBus.postMessage(message, function (reply) {\n // log.log('[Registry registerHyperty] KeepAlive Reply: ', reply);\n });\n }, registrationExpires / 1.1 / 2 * 1000);\n });\n }\n }]);\n return DomainRegistration;\n}();\n\nexports.default = DomainRegistration;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9Eb21haW5SZWdpc3RyYXRpb24uanM/MWE2ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuM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cbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnAycFJlcXVlc3RlciA9IGh5cGVydHkucDJwUmVxdWVzdGVyO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZhaWxlZCB0byByZWdpc3RlciBhbiBIeXBlcnR5OiAnICsgcmVwbHkpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgbG9nLmVycm9yKGUpO1xuICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignRmFpbGVkIHRvIHJlZ2lzdGVyIGFuIEh5cGVydHkgdG8gZG9tYWluOiAnLCByZXBseSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuXG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGxvZy5lcnJvcihlKTtcbiAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgfVxuXG4gICAgICAvL3RpbWVyIHRvIGtlZXAgdGhlIHJlZ2lzdHJhdGlvbiBhbGl2ZVxuICAgICAgLy8gdGhlIHRpbWUgaXMgZGVmaW5lZCBieSBhIGxpdHRsZSBsZXNzIHRoYW4gaGFsZiBvZiB0aGUgZXhwaXJlcyB0aW1lIGRlZmluZWRcbiAgICAgIGxldCBrZWVwQWxpdmVUaW1lciA9IHNldEludGVydmFsKGZ1bmN0aW9uKCkge1xuXG4gICAgICAgIGxldCBtZXNzYWdlID0ge1xuICAgICAgICAgIHR5cGU6ICd1cGRhdGUnLFxuICAgICAgICAgIGZyb206IF90aGlzLnJlZ2lzdHJ5VVJMLF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n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('P2PConnectionResolve');\n\n/**\n* To process address resolution for p2p connections\n*/\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Log System\n\nvar P2PConnectionResolve = function () {\n function P2PConnectionResolve(registry) {\n (0, _classCallCheck3.default)(this, P2PConnectionResolve);\n\n var _this = this;\n _this._registry = registry;\n _this._remoteP2PEntities = {}; // All remote entities and associated runtime url that are reachable with existing p2p connections\n }\n\n /**\n * Verifies if remote Entity can be reached with a P2P Connection.\n * @param {URL.URL} info object URL\n * @return {HypertyDataObjectInstance} addressURL return the Data Object instance registered URL, return undefined otherwise\n */\n\n (0, _createClass3.default)(P2PConnectionResolve, [{\n key: 'checkP2P',\n value: function checkP2P(msg) {\n\n if (!msg.hasOwnProperty('to')) {\n // throw Error('The p2p verification was failed');\n return _promise2.default.reject('The p2p verification was failed');\n }\n\n var scheme = msg.to.split('://')[0];\n\n var comp = msg.to.split('://')[1].split('/')[2];\n\n var url = void 0;\n\n if (comp) url = msg.to.substring(0, msg.to.indexOf('/' + comp));else url = msg.to;\n\n var p2p = {};\n\n if (msg.body && msg.body.p2p) p2p.p2p = msg.body.p2p;\n\n if (msg.body && msg.body.p2pHandler && msg.body.p2pRequester) {\n p2p.p2pHandler = msg.body.p2pHandler;\n p2p.p2pRequester = msg.body.p2pRequester;\n p2p.runtime = msg.body.p2pHandler.split('/p2phandler/')[0];\n }\n\n switch (scheme) {\n case 'runtime':\n return this.checkP2PRuntime(url, p2p);\n break;\n default:\n return this.checkP2PEntity(url, p2p);\n break;\n\n }\n }\n\n /**\n * Verifies if remote Entity (Hyperty or Data Object) can be reached with a P2P Connection.\n * @param {string} url Remote Entity URL to be checked\n * @param {object} p2p p2p information to be used including ´runtime´ with remote Runtime URL, 'p2pHandler' remote P2P Handler Stub URL and p2pRequester with Catalogue URL of P2P Requester to be used\n * @return {promise} registeredEntity if p2p connection is possible it returns p2p information to be used in the connection, otherwise the promise is rejected\n */\n\n }, {\n key: 'checkP2PEntity',\n value: function checkP2PEntity(url, p2p) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var remoteEntity = _this._remoteP2PEntities[url];\n\n if (remoteEntity) resolve(remoteEntity);else if (p2p.runtime) resolve(p2p); // use provided p2p if available in the message body\n else if (p2p.p2p) {\n // otherwise look on Domain Registry\n\n log.log('[Registry - checkP2PEntity] - search in Domain Registry: ', url);\n\n var message = {\n type: 'read',\n from: _this._registry.registryURL,\n to: 'domain://registry.' + _this._registry._domain,\n body: {\n resource: url\n }\n };\n\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('[Registry - checkP2PEntity] Domain Registry reply', reply);\n if ('value' in reply.body) {\n\n //todo: store retrieved entity\n var resolvedEntity = reply.body.value;\n\n if (resolvedEntity.hasOwnProperty('p2pHandler')) {\n resolve(resolvedEntity);\n } else {\n reject('[Registry checkP2PEntity] Hyperty found does not support P2P', reply.body.value);\n }\n } else {\n reject('[Registry checkP2PEntity] Hyperty with P2PHandler not found', reply.body.code);\n }\n });\n } else reject('[Registry checkP2PEntity] No P2P Connection available for ', url);\n });\n }\n\n /**\n * Verifies if remote Runtime can be reached with a P2P Connection.\n * @param {URL.URL} runtimeURL Runtime URL\n * @return {Object} p2pConnection return the P2PConnection instance registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkP2PRuntime',\n value: function checkP2PRuntime(runtimeURL, p2p) {\n var _this = this;\n\n var registeredRuntime = {};\n\n // look on locally stored p2p connections\n return new _promise2.default(function (resolve, reject) {\n if (_this._registry.p2pConnectionList[runtimeURL]) {\n resolve({ runtime: runtimeURL });\n } else if (p2p.runtime) {\n registeredRuntime = p2p;\n resolve(registeredRuntime);\n } else reject('[Registry.P2PConnectionResolve.checkP2PRuntime] No P2P Connection found to ', runtimeURL);\n });\n }\n\n /**\n * Verifies if remote Hyperty can be reached with a P2P Connection.\n * @param {JSON} info object or entity charateristics info\n * @return {addressURL} addressURL return the URL if there is any previousy registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkP2PHyperty',\n value: function checkP2PHyperty(hypertyURL, p2p) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var hyperty = void 0;\n\n // look on locally stored hyperties\n\n for (var i in _this._registry.remoteHypertyList) {\n hyperty = _this._registry.remoteHypertyList[i];\n\n log.log('[Registry - checkP2PHyperty] - for each Hyperty: ', hyperty);\n\n // todo: change to \"hyperty.url\" to be aligned with hyperty instance data model spec\n\n if (hyperty.hypertyID === hypertyURL) {\n\n if (hyperty.hasOwnProperty('p2pHandler')) {\n resolve(hyperty);\n } else {\n reject('[Registry checkP2PHyperty] Hyperty found does not support P2P', hyperty);\n }\n return;\n }\n }\n\n if (!hyperty && p2p.runtime) resolve(p2p); // use provided p2p if available in the message body\n else if (!hyperty && p2p.p2p) {\n // otherwise look on Domain Registry\n\n log.log('[Registry - checkP2PHyperty] - search in Domain Registry: ', hyperty);\n\n var message = {\n type: 'read',\n from: _this._registry.registryURL,\n to: 'domain://registry.' + _this._registry._domain,\n body: {\n resource: hypertyURL\n }\n };\n\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('[Registry - checkP2PHyperty] Domain Registry reply', reply);\n if ('value' in reply.body) {\n\n //todo: store retrieved hyperty\n var resolvedHyperty = reply.body.value;\n\n _this._registry.remoteHypertyList.push(resolvedHyperty);\n\n if (resolvedHyperty.hasOwnProperty('p2pHandler')) {\n resolve(resolvedHyperty);\n } else {\n reject('[Registry checkP2PHyperty] Hyperty found does not support P2P', reply.body.value);\n }\n } else {\n reject('[Registry checkP2PHyperty] Hyperty with P2PHandler not found', reply.body.code);\n }\n });\n } else reject('[Registry checkP2PHyperty] No P2P Connection available for ', hypertyURL);\n });\n }\n\n /**\n * Verifies if remote Data Object can be reached with a P2P Connection.\n * @param {URL.URL} DataObjectURL object URL\n * @return {HypertyDataObjectInstance} addressURL return the Data Object instance registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkP2PDataObject',\n value: function checkP2PDataObject(url, p2p) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n // look on locally stored Remote Data Objects\n\n var dataobject = _this._registry.remoteDataObjectList.filter(function (i) {\n return _this._registry.remoteDataObjectList[i].url === url;\n });\n\n if (dataobject.length !== 0 && dataobject[0].p2pRequester) {\n resolve(dataobject[0]);\n } else if (dataobject.length !== 0) {\n reject('[Registry checkP2PDataObject] Data Object found does not support P2P', dataobject[0]);\n } else if (dataobject.length === 0 && p2p.runtime) resolve(p2p); // use provided p2p info if available in the message body\n else if (dataobject.length && p2p.p2p) {\n // otherwise look on Domain Registry\n\n // look on Domain Registry\n\n var message = {\n type: 'read',\n from: _this._registry.registryURL,\n to: 'domain://registry.' + _this._registry._domain,\n body: {\n resource: url\n }\n };\n\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('discover data object per url reply', reply);\n if ('value' in reply.body) {\n\n //todo: store retrieved hyperty\n var resolvedDataObject = reply.body.value;\n\n _this._registry.remoteDataObjectList.push(resolvedDataObject);\n\n if (resolvedDataObject.p2pRequester) {\n resolve(resolvedDataObject);\n } else {\n reject('[Registry checkP2PDataObject] Data Object found does not support P2P', reply.body.value);\n }\n } else {\n reject('[Registry checkP2PDataObject] not found', reply.body.code);\n }\n });\n } else reject('[Registry checkP2PDataObject] no P2P Connection found');\n });\n }\n }, {\n key: 'addRemoteP2PEntity',\n value: function addRemoteP2PEntity(url, runtime) {\n this._remoteP2PEntities[url] = runtime;\n }\n }, {\n key: 'removeRemoteP2PEntity',\n value: function removeRemoteP2PEntity(url) {\n delete this._remoteP2PEntities[url];\n }\n }, {\n key: 'reconnectP2PRequester',\n value: function reconnectP2PRequester(p2pRequester) {\n var _this = this;\n\n log.log('[P2PConenctionResolve.reconnectP2PRequester] lets try to reconnect P2P Requester Stub: ', p2pRequester);\n\n return new _promise2.default(function (resolve, reject) {\n\n var remoteRuntime = p2pRequester.runtime;\n\n var message = {\n type: 'execute',\n from: _this._registry.registryURL,\n to: p2pRequester.url,\n body: {\n method: 'connect',\n params: [p2pRequester.p2pHandler]\n }\n };\n\n // lets prepare the p2pRequesterSTub reconnect by setting an observer to its status changes\n\n _this._registry.watchingYou.observe('p2pRequesterStub', function (change) {\n\n log.log('[P2PConenctionResolve.reconnectP2PRequester] p2pRequesterStubs changed ' + _this._registry.p2pRequesterStub);\n\n if (change.keypath.split('.')[0] === remoteRuntime && change.name === 'status') {\n switch (change.newValue) {\n case 'live':\n log.log('[P2PConenctionResolve.reconnectP2PRequester] p2pRequester is live ' + _this._registry.p2pRequesterStub[remoteRuntime]);\n resolve(_this._registry.p2pRequesterStub[remoteRuntime].url);\n break;\n case 'failed':\n log.log('[P2PConenctionResolve.reconnectP2PRequester] p2pRequester reconnect failed ' + _this._registry.p2pRequesterStub[remoteRuntime]);\n reject('P2P Requester reconnect failed');\n break;\n default:\n }\n }\n });\n\n // stub load\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('[P2PConenctionResolve.reconnectP2PRequester] reconnect request reply', reply);\n });\n });\n }\n }]);\n return P2PConnectionResolve;\n}();\n\nexports.default = P2PConnectionResolve;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9QMlBDb25uZWN0aW9uUmVzb2x2ZS5qcz9iNTVkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaW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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFKQTtBQUNBO0FBU0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVRBO0FBV0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///507\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\n__webpack_require__(149);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar WatchingYou = function () {\n function WatchingYou() {\n (0, _classCallCheck3.default)(this, WatchingYou);\n\n this._watching = {};\n this._observers = [];\n }\n\n (0, _createClass3.default)(WatchingYou, [{\n key: 'watch',\n value: function watch(key, object) {\n var _this = this;\n\n var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (deep) {\n this._watching[key] = Object.deepObserve(object, function (changes) {\n changes.every(function (change) {\n _this._fireEvent(key, change);\n });\n });\n } else {\n this._watching[key] = Object.observe(object, function (changes) {\n changes.every(function (change) {\n _this._fireEvent(key, change);\n });\n });\n }\n return this._watching[key];\n }\n }, {\n key: 'observe',\n value: function observe(key, callback) {\n this._observers.push({ key: key, callback: callback });\n }\n }, {\n key: '_fireEvent',\n value: function _fireEvent(key, change) {\n\n this._observers.filter(function (observe) {\n return observe.key === key;\n }).forEach(function (observe) {\n observe.callback(change);\n });\n }\n }]);\n return WatchingYou;\n}();\n\nexports.default = WatchingYou;\n\n/*let watchChanges = new WatchChanges();\nlet p2pRequesterStub = watchChanges.watch('p2p', {}, true);\nlet stub = watchChanges.watch('stub', {});\n\nwatchChanges.observe('p2p', (change) => {\n console.log('p2pRequesterStub: ' + change.name + ' - ' + JSON.stringify(change.newValue));\n});\n\nwatchChanges.observe('p2p', (change) => {\n console.log('p2pRequesterStub: ' + change.name + ' - ' + JSON.stringify(change.newValue));\n});\n\nwatchChanges.observe('stub', (change) => {\n console.log('stub ' + change.name);\n});\n\np2pRequesterStub.a = {};\nstub.b = {name: 'vitor'};\np2pRequesterStub.a.name = 'Hello';\nstub.b = {name: 'vitor'};\np2pRequesterStub.a.age = '32';\np2pRequesterStub.a.name = 'World';*/\n\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9XYXRjaGluZ1lvdS5qcz84ODYyIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAncHJveHktb2JzZXJ2ZSc7XG5cbmNsYXNzIFdhdGNoaW5nWW91IHtcblxuICBjb25zdHJ1Y3RvcigpIHtcbiAgICB0aGlzLl93YXRjaGluZyA9IHt9O1xuICAgIHRoaXMuX29ic2VydmVycyA9IFtdO1xuICB9XG5cbiAgd2F0Y2goa2V5LCBvYmplY3QsIGRlZXAgPSBmYWxzZSkge1xuICAgIGlmIChkZWVwKSB7XG4gICAgICB0aGlzLl93YXRjaGluZ1trZXldID0gT2JqZWN0LmRlZXBPYnNlcnZlKG9iamVjdCwgKGNoYW5nZXMpID0+IHtcbiAgICAgICAgY2hhbmdlcy5ldmVyeSgoY2hhbmdlKSA9PiB7XG4gICAgICAgICAgdGhpcy5fZmlyZUV2ZW50KGtleSwgY2hhbmdlKTtcbiAgICAgICA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7Ozs7Ozs7Ozs7Ozs7Ozs7O0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///508\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _runtimeConfiguration = __webpack_require__(151);\n\nvar _Identities = __webpack_require__(214);\n\nvar _Identities2 = _interopRequireDefault(_Identities);\n\nvar _GuiFake = __webpack_require__(514);\n\nvar _GuiFake2 = _interopRequireDefault(_GuiFake);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('IdentityModule'); // Log System\n\n/**\n*\n* The Identity Module (Id Module) is the component responsible for handling the\n* user identity and the association of this identity with the Hyperty instances,\n* in order to make Hyperty instances identifiable. The identity in the reTHINK project\n* is not fixed to a unique Identity Service Provider, but obtained through several\n* different Identity sources. With this approach, the Id Module provides to the user the\n* option to choose the preferred method for authentication.\n* This module will thus able to support multiple Identity acquisition methods,\n* such as OpenID connect 1.0, Kerberos System, or authentication through smart cards.\n* For example, a user with a Google account can use the Google as an Identity Provider to provide Identity Tokens,\n* which can be used by the Identity Module to associate it with a Hyperty instance.\n*\n* The Identity Module uses a node package, the HelloJS, which is a client-side JavaScript API for authentication\n* that facilitates the requests for the OpenID connect protocol. This method allows for some abstraction\n* when making requests for different Identity Providers, such as OpenID connect used by Google, Facebook, Microsoft, for example.\n*\n* When a request for a user identity is made using the method loginWithRP(identifier, scope),\n* this method will analyse the Identity Provider chosen to obtain an identity and will use the HelloJS node package\n* with the selected Identity Provider and identity scope. After the HelloJS request for an Access Token\n* to the Identity Providers, the user will be prompted to authenticate towards the Identity Provider.\n* Upon receiving the Access Token, this token is validated with a RESTful web service request to an endpoint\n* on the Identity Provider Authorization Server, and after the validation is done,\n* an ID token is obtained with the information according to the scope required.\n* This ID token is then preserved in this module that can obtained through the getIdentities()\n* and is passed as return value of the loginWithRP function. The methods generateAssertion and validateAssertion have not yet been developed.\n*\n*/\nvar IdentityModule = function () {\n\n /**\n * This is the constructor to initialise the Identity Module it does not require any input.\n */\n function IdentityModule(runtimeURL, runtimeCapabilities, storageManager, dataObjectsStorage, cryptoManager, runtimeCatalogue) {\n (0, _classCallCheck3.default)(this, IdentityModule);\n\n var _this = this;\n\n if (!runtimeURL) throw new Error('runtimeURL is missing.');\n if (!storageManager) throw new Error('storageManager is missing');\n if (!cryptoManager) throw new Error('cryptoManager is missing');\n if (!runtimeCatalogue) throw new Error('runtimeCatalogue is missing');\n\n _this._runtimeURL = runtimeURL;\n\n _this._runtimeCatalogue = runtimeCatalogue;\n\n _this.dataObjectsStorage = dataObjectsStorage;\n _this._idmURL = _this._runtimeURL + '/idm';\n _this._guiURL = _this._runtimeURL + '/identity-gui';\n _this.runtimeCapabilities = runtimeCapabilities;\n\n _this._domain = (0, _utils.divideURL)(_this._runtimeURL).domain;\n\n //to store items with this format: {identity: identityURL, token: tokenID}\n _this._identities = new _Identities2.default('human', storageManager);\n\n // to be reviewed: watchingYou identitiesList or identities?\n // _this.identitiesList = _this.watchingYou.watch('identitiesList', {}, true);\n _this._crypto = cryptoManager;\n\n /* _this.emailsList = [];\n let newIdentity = new Identity('guid', 'HUMAN');\n _this.identity = newIdentity;\n _this.currentIdentity;\n _this.identities.defaultIdentity;*/\n\n //stores the association of the dataObject and the Hyperty registered within\n _this.dataObjectsIdentity = {}; // is this needed?\n\n _this._listOfIdps = [];\n\n // variable to know if the GUI is deployed to choose the identity. if the real GUI is not deployed, a fake gui is deployed instead.\n _this.guiDeployed = false;\n }\n\n //******************* GET AND SET METHODS *******************\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n\n (0, _createClass3.default)(IdentityModule, [{\n key: 'getIdentity',\n\n\n //******************* IDENTITY RELEATED METHODS *******************\n /**\n * gets all the information from a given userURL\n * @param {String} userURL user url\n * @return {JSON} identity identity bundle from the userURL\n */\n value: function getIdentity(userURL) {\n return this.identities.getIdentity(userURL);\n }\n\n /**\n * Function to set the current Identity with a given Identity\n * @param {Identity} identity identity\n */\n\n /* setCurrentIdentity(identity) {\n let _this = this;\n _this.currentIdentity = identity;\n }*/\n\n /**\n * Function to return all the identities registered within a session by a user.\n * These identities are returned in an array containing a JSON package for each user identity.\n * @return {Array} Identities\n */\n\n }, {\n key: 'getIdentitiesToChoose',\n value: function getIdentitiesToChoose() {\n var _this2 = this;\n\n // let identities = _this.identities.identifiers;\n\n // let idps = [\n // { domain: 'google.com', type: 'idToken'},\n // { domain: 'microsoft.com', type: 'idToken'},\n // { domain: 'orange.fr', type: 'idToken'},\n // { domain: 'slack.com', type: 'Legacy'}\n // ];\n\n // todo: retrieve available idps from runtime catalogue\n // todo: enable oauth idps\n // let idps = [\n // { domain: 'google.com', type: 'idToken' },\n // { domain: 'microsoft.com', type: 'idToken' },\n // { domain: 'facebook.com', type: 'idToken' },\n // { domain: 'slack.com', type: 'idToken' }\n // ];\n\n return new _promise2.default(function (resolve) {\n\n var url = _runtimeConfiguration.runtimeConfiguration.catalogueURLs.idpProxy.prefix + _this2._domain + _runtimeConfiguration.runtimeConfiguration.catalogueURLs.idpProxy.suffix;\n\n _promise2.default.all([_this2.runtimeCapabilities.isAvailable('browser'), _this2.runtimeCapabilities.isAvailable('node')]).then(function (result) {\n\n var isBrowser = result[0];\n var isNode = result[1];\n\n var constraints = { constraints: {} };\n constraints.constraints.node = isNode;\n constraints.constraints.browser = isBrowser;\n\n _this2._runtimeCatalogue.getTypeList(url, constraints).then(function (idps) {\n var listOfIdps = idps.map(function (key) {\n return { domain: key, type: 'idToken' };\n });\n log.info('[IdentityModule.getIdentityAssertion:getIdentitiesToChoose]', idps, listOfIdps);\n _this2._listOfIdps = listOfIdps;\n return resolve({ defaultIdentity: _this2.identities.defaultIdentity, identities: _this2.identities.identities, idps: listOfIdps });\n });\n });\n });\n }\n\n /**\n * Function to return the selected Identity within a session\n * @return {Identity} identity identity\n */\n /* getCurrentIdentity() {\n let _this = this;\n return _this.currentIdentity;\n }*/\n\n }, {\n key: 'init',\n value: function init() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n _this._identities.loadIdentities().then(function () {\n\n _this._crypto.getMyPublicKey().then(function (key) {\n var hash = _this._crypto.crypto._sha256((0, _utils.stringify)(key)).then(function (hash) {\n\n var guid = 'user-guid://' + hash;\n _this.identities.guid = guid;\n _this._identities.loadAccessTokens().then(function () {\n\n resolve();\n });\n }).catch(function (error) {\n console.log('[IdentityModule] error', error);\n });\n });\n });\n });\n }\n\n /**\n * Function that fetch an identityAssertion from a user.\n *\n * @return {IdAssertion} IdAssertion\n */\n\n }, {\n key: 'getIdentityAssertion',\n value: function getIdentityAssertion(identityBundle) {\n log.log('[IdentityModule.getIdentityAssertion:identityBundle]', identityBundle);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //CHECK whether is browser environment or nodejs\n //if it is browser, then create a fake identity\n\n _this.runtimeCapabilities.isAvailable('browser').then(function (result) {\n log.log('runtime browser identity acquisition', result);\n\n if (!result) return;\n\n //todo: only idp should be mandatory when identityBundle exists\n\n if (identityBundle && identityBundle.hasOwnProperty('idp')) {\n\n var idp = identityBundle.idp;\n var origin = identityBundle.hasOwnProperty('origin') ? identityBundle.origin : 'origin';\n var idHint = identityBundle.hasOwnProperty('idHint') ? identityBundle.idHint : '';\n\n if (_this.identities.defaultIdentity) {\n var assertion = _this.identities.defaultIdentity;\n\n if (assertion.expires > (0, _utils.secondsSinceEpoch)()) {\n return resolve(assertion);\n } else if (assertion.hasOwnProperty('refresh')) {\n log.log('[Identity.IdentityModule.getIdentityAssertion] refreshing assertion: ', assertion);\n\n _this._refreshIdAssertion().then(function (newAssertion) {\n log.log('[IdentityModule.getIdentityAssertion] refreshed assertion.', newAssertion);\n return resolve(newAssertion);\n });\n } else {\n _this._getIdAssertionForDomain(origin, idp, idHint).then(function (assertion) {\n resolve(assertion);\n }, function (error) {\n reject(error);\n });\n }\n } else {\n _this._getIdAssertionForDomain(origin, idp, idHint).then(function (assertion) {\n resolve(assertion);\n }, function (error) {\n reject(error);\n });\n }\n } else if (_this.identities.defaultIdentity) {\n var _assertion = _this.identities.defaultIdentity;\n\n if (_assertion.expires > (0, _utils.secondsSinceEpoch)()) {\n return resolve(_assertion);\n } else if (_assertion.hasOwnProperty('refresh')) {\n log.log('[Identity.IdentityModule.getValidToken] refreshing assertion: ', _assertion);\n\n _this._refreshIdAssertion(_assertion).then(function (newAssertion) {\n log.log('[IdentityModule.getIdentityAssertion] refreshed assertion.', newAssertion);\n return resolve(newAssertion);\n });\n } else {\n _this.selectIdentityFromGUI().then(function (assertion) {\n\n log.log('[IdentityModule] Identity selected from GUI.');\n\n _this.identities.defaultIdentity = assertion.userProfile.userURL;\n return resolve(assertion);\n }, function (err) {\n return reject(err);\n });\n }\n } else {\n _this.selectIdentityFromGUI().then(function (assertion) {\n\n log.log('[IdentityModule] Identity selected from GUI.');\n\n _this.identities.defaultIdentity = assertion.userProfile.userURL;\n return resolve(assertion);\n }, function (err) {\n return reject(err);\n });\n }\n }).catch(function (error) {\n log.error('Error on identity acquisition ', error);\n return reject(error);\n });\n\n _this.runtimeCapabilities.isAvailable('node').then(function (result) {\n log.log('node identity acquisition', result);\n\n if (!result) return;\n\n if (_this.identities.currentIdentity) {\n //TODO verify whether the token is still valid or not.\n // should be needed to make further requests, to obtain a valid token\n return resolve(_this.identities.currentIdentity);\n } else {\n log.log('getIdentityAssertion for nodejs');\n\n var idp = { type: 'idp', value: 'nodejs-idp', code: 200, auth: false };\n _this.callNodeJsGenerateMethods(idp.value, 'origin').then(function (value) {\n resolve(value);\n }, function (err) {\n reject(err);\n });\n }\n }).catch(function (error) {\n log.error('Error on identity acquisition ', error);\n reject(error);\n });\n });\n }\n }, {\n key: '_getIdAssertionForDomain',\n value: function _getIdAssertionForDomain(origin, idp, idHint) {\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.selectIdentityForHyperty(origin, idp, idHint).then(function (assertion) {\n log.log('[IdentityModule._getIdAssertionForDomain] Identity selected by hyperty.');\n return resolve(assertion);\n }, function (err) {\n // if it got an error then just select identity from GUI\n // log.error('[IdentityModule] Could not select identity from hyperty.');\n\n _this.selectIdentityFromGUI().then(function (newAssertion) {\n log.log('[IdentityModule._getIdAssertionForDomain] Identity selected by hyperty.');\n return resolve(newAssertion);\n }, function (err) {\n return reject(err);\n });\n });\n });\n }\n }, {\n key: '_refreshIdAssertion',\n value: function _refreshIdAssertion(assertion) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.sendRefreshMessage(assertion).then(function (newAssertion) {\n log.log('[Identity.IdentityModule.getValidToken] refreshed assertion: ', newAssertion);\n _this.identities.updateAssertion(newAssertion).then(function () {\n resolve(newAssertion);\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error updating the assertion ', err);\n reject(err);\n });\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error refreshing the assertion ', err);\n reject(err);\n });\n });\n }\n\n /**\n * Function to return all the users URLs registered within a session\n * These users URLs are returned in an array of strings.\n * @return {Array} users\n */\n\n }, {\n key: 'getUsersIDs',\n value: function getUsersIDs() {\n /* log.log('[getUsersIDs:emailFormat]', emailFormat);\n log.log('getUsersIDs:emailFormat', emailFormat);\n let _this = this;\n let users = [];*/\n\n //if request comes with the emailFormat option, then convert url to email format\n /* let converter = (emailFormat) ? getUserEmailFromURL : (value) => { return value; };\n for (let index in _this.identities) {\n let identity = _this.identities[index];\n users.push(converter(identity.identity));\n }*/\n\n return this.identities.identifiers;\n }\n\n /**\n * Function to remove an identity\n * @param {String} userURL userURL\n * @return {Promise}\n */\n\n }, {\n key: 'deleteIdentity',\n value: function deleteIdentity(userURL) {\n\n return this.identities.removeIdentity(userURL);\n }\n\n /**\n * Function to unregister an identity from the emailsList array and not show in to the GUI\n * @param {String} email email\n */\n /* unregisterIdentity(email) {\n let _this = this;\n for (let e in _this.emailsList) {\n if (_this.emailsList[e] === email) {\n _this.emailsList.splice(e, 1);\n }\n }\n }*/\n\n /**\n * Function that sends a request to the GUI using messages. Sends all identities registered and\n * the Idps supported, and return the identity/idp received by the GUI\n * @param {Array} identities list of identitiies\n * @param {Array} idps list of idps to authenticate\n * @return {Promise} returns a chosen identity or idp\n */\n\n }, {\n key: 'requestIdentityToGUI',\n value: function requestIdentityToGUI(identities, idps) {\n log.log('[IdentityModule.requestIdentityToGUI:identities]', identities);\n log.log('[IdentityModule.requestIdentityToGUI:idps]', idps);\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n //condition to check if the real GUI is deployed. If not, deploys a fake gui\n if (_this.guiDeployed === false) {\n var guiFakeURL = _this._guiURL;\n var guiFake = new _GuiFake2.default(guiFakeURL, _this._messageBus);\n _this.guiFake = guiFake;\n _this.guiDeployed = true;\n }\n\n var message = {\n type: 'create', to: _this._guiURL, from: _this._idmURL,\n body: { value: { identities: identities, idps: idps } }\n };\n\n var callback = function callback(msg) {\n _this._messageBus.removeResponseListener(_this._idmURL, msg.id);\n\n // todo: to return the user URL and not the email or identifier\n\n if (msg.body.code === 200) {\n var selectedIdentity = msg.body;\n\n log.log('selectedIdentity: ', selectedIdentity.value);\n resolve(selectedIdentity);\n } else {\n reject('error on requesting an identity to the GUI');\n }\n };\n\n //postMessage with callback but without timeout\n try {\n _this._messageBus.postMessage(message, callback, false);\n } catch (err) {\n reject('In method callIdentityModuleFunc error: ' + err);\n }\n });\n }\n }, {\n key: 'callNodeJsGenerateMethods',\n value: function callNodeJsGenerateMethods(idp, origin) {\n log.log('[callNodeJsGenerateMethods:idp]', idp);\n log.log('[callNodeJsGenerateMethods:origin]', origin);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //debugger;\n var publicKey = void 0;\n\n //let keyPair = nodeJSKeyPairPopulate;\n\n //generates the RSA key pair\n _this._crypto.getMyPublicKey().then(function (key) {\n\n log.log('[callNodeJsGenerateMethods:key]', key);\n\n publicKey = (0, _utils.stringify)(key);\n\n log.log('[callNodeJsGenerateMethods] NO_URL');\n\n return _this.generateAssertion(publicKey, origin, 'url', idp);\n }).then(function (value) {\n if (value) {\n resolve(value);\n } else {\n reject('Error on obtaining Identity');\n }\n }).catch(function (err) {\n log.log(err);\n reject(err);\n });\n });\n }\n }, {\n key: 'callGenerateMethods',\n value: function callGenerateMethods(idp, origin) {\n log.log('[callGenerateMethods:idp]', idp);\n log.log('[callGenerateMethods:origin]', origin);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var publicKey = void 0;\n\n //generates the RSA key pair\n _this._crypto.getMyPublicKey().then(function (key) {\n\n log.log('[callGenerateMethods:key]', key);\n\n publicKey = (0, _utils.stringify)(key);\n\n // userkeyPair = keyPair;\n log.log('generateAssertion:no_hint');\n return _this.generateAssertion(publicKey, origin, '', idp);\n }).then(function (url) {\n _this.myHint = url;\n log.log('generateAssertion:hint');\n return _this.generateAssertion(publicKey, origin, url, idp);\n }).then(function (value) {\n if (value) {\n resolve(value);\n } else {\n reject('Error on obtaining Identity');\n }\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n });\n }\n }, {\n key: 'loginSelectedIdentity',\n value: function loginSelectedIdentity(publicKey, origin, idp, loginUrl) {\n log.log('[loginSelectedIdentity:publicKey]', publicKey);\n log.log('[loginSelectedIdentity:origin]', origin);\n log.log('[loginSelectedIdentity:idp]', idp);\n\n // log.log('[loginSelectedIdentity:keyPair]', keyPair);\n log.log('[loginSelectedIdentity:loginUrl]', loginUrl);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n log.log('[IdentityModule] openPopup');\n _this.callIdentityModuleFunc('openPopup', { urlreceived: loginUrl }).then(function (idCode) {\n return idCode;\n }, function (err) {\n log.error('Error while logging in for the selected identity.');\n return reject(err);\n }).then(function (idCode) {\n _this.sendGenerateMessage(publicKey, origin, idCode, idp).then(function (newResponse) {\n if (newResponse.hasOwnProperty('assertion')) {\n _this.identities.addAssertion(newResponse).then(function (result) {\n resolve('Login was successfull');\n }).catch(function (err) {\n reject('Login has failed:' + err);\n });\n } else {\n log.error('Error while logging in for the selected identity.');\n return reject('Could not generate a valid assertion for selected identity.');\n }\n }).catch(function (err) {\n reject('On loginSelectedIdentity from method sendGenerateMessage error: ' + err);\n });\n });\n });\n }\n }, {\n key: 'selectIdentityForHyperty',\n value: function selectIdentityForHyperty(origin, idp, idHint) {\n log.log('[selectIdentityForHyperty:origin]', origin);\n log.log('[selectIdentityForHyperty:idp]', idp);\n log.log('[selectIdentityForHyperty:idHint]', idHint);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //generates the RSA key pair\n _this._crypto.getMyPublicKey().then(function (key) {\n var publicKey = (0, _utils.stringify)(key);\n\n _this.sendGenerateMessage(publicKey, origin, idHint, idp).then(function (response) {\n if (response.hasOwnProperty('assertion')) {\n // identity was logged in, just save it\n _this.identities.addAssertion(response).then(function (value) {\n return resolve(response);\n }, function (err) {\n return reject(err);\n });\n } else if (response.hasOwnProperty('loginUrl')) {\n // identity was not logged in\n _this.loginSelectedIdentity(publicKey, origin, idp, response.loginUrl).then(function (value) {\n return resolve(value);\n }, function (err) {\n return reject(err);\n });\n } else {\n // you should never get here, if you do then the IdP Proxy is not well implemented\n // log.error('GenerateAssertion returned invalid response.');\n log.log('Proceeding by logging in.');\n _this.callGenerateMethods(idp, origin).then(function (value) {\n return resolve(value);\n }, function (err) {\n return reject(err);\n });\n }\n }).catch(function (err) {\n reject('On selectIdentityForHyperty from method sendGenerateMessage error: ' + err);\n });\n }).catch(function (err) {\n reject('On selectIdentityForHyperty from method generateRSAKeyPair error: ' + err);\n });\n });\n }\n }, {\n key: 'selectIdentityFromGUI',\n value: function selectIdentityFromGUI(origin) {\n var _this3 = this;\n\n log.log('[IdentityModule.selectIdentityFromGUI:origin]', origin);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3.getIdentitiesToChoose().then(function (identitiesInfo) {\n return _this.requestIdentityToGUI(identitiesInfo.identities, identitiesInfo.idps);\n }).then(function (value) {\n\n if (value.type === 'identity') {\n\n // let chosenID = getUserURLFromEmail(value.value);\n // hack while the user url is not returned from requestIdentityToGUI;\n\n /* let chosenID = 'user://' + _this.identities.currentIdentity.idp.domain + '/' + value.value;\n _this.identities.defaultIdentity = _this.identities.currentIdentity;*/\n\n // returns the identity info from the chosen id\n // if (_this.identities.currentIdentity) resolve(_this.identities.currentIdentity.assertion);\n if (_this.identities.identities[value.value]) resolve(_this.identities.identities[value.value]);else reject('[IdentityModule.selectIdentityFromGUI] identity not found: ', value.value);\n } else if (value.type === 'idp') {\n\n _this.callGenerateMethods(value.value, origin).then(function (value) {\n return resolve(value);\n }, function (err) {\n return reject(err);\n });\n } else {\n return reject('error on GUI received message.');\n }\n }).catch(function (err) {\n reject('On selectIdentityFromGUI from method requestIdentityToGUI error: ' + err);\n });\n });\n }\n }, {\n key: 'callIdentityModuleFunc',\n value: function callIdentityModuleFunc(methodName, parameters) {\n log.log('[callIdentityModuleFunc:methodName]', methodName);\n log.log('[callIdentityModuleFunc:parameters]', parameters);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var message = {\n type: 'execute', to: _this._guiURL, from: _this._idmURL,\n body: { resource: 'identity', method: methodName, params: parameters }\n };\n\n //post msg with callback but without timout\n var callback = function callback(msg) {\n _this._messageBus.removeResponseListener(_this._idmURL, msg.id);\n var result = msg.body.value;\n resolve(result);\n };\n try {\n\n _this._messageBus.postMessage(message, callback, false);\n } catch (err) {\n reject('In method callIdentityModuleFunc error: ' + err);\n }\n });\n }\n\n //******************* TOKEN METHODS *******************\n /**\n * get a Token to be added to a message\n * @param {String} fromURL origin of the message\n * @param {String} toURL target of the messageok\n * @return {JSON} token token to be added to the message\n */\n\n }, {\n key: 'getToken',\n value: function getToken(msg) {\n var _this = this;\n var fromURL = msg.from;\n var toUrl = msg.to;\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('source')) {\n fromURL = msg.body.source;\n }\n\n if (msg.type === 'forward') {\n fromURL = msg.body.from;\n }\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('subscriber')) {\n fromURL = msg.body.subscriber;\n }\n\n return new _promise2.default(function (resolve, reject) {\n log.log('[IdentityModule.getToken] for msg ', msg);\n\n //log.log('toUrl', toUrl);\n _this.registry.isLegacy(toUrl).then(function (result) {\n // log.log('[Identity.IdentityModule.getToken] isLEGACY: ', result);\n if (result) {\n\n _this._getAccessToken(msg).then(function (token) {\n log.log('[IdentityModule.getToken] access token ', token);\n resolve((0, _utils.deepClone)(token));\n }).catch(function (err) {\n reject('[IdentityModule.getToken] Access Token error ' + err);\n });\n } else {\n _this._getValidToken(fromURL).then(function (token) {\n resolve(token);\n }).catch(function (err) {\n reject('On getToken from method _getValidToken error: ' + err);\n });\n }\n }).catch(function (err) {\n reject('On getToken from method isLegacy error: ' + err);\n });\n });\n }\n\n /**\n * get an Id Token for a HypertyURL\n * @param {String} hypertyURL the Hyperty address\n * @return {JSON} token Id token to be added to the message\n */\n\n }, {\n key: 'getIdToken',\n value: function getIdToken(hypertyURL) {\n log.info('getIdToken:hypertyURL ', hypertyURL);\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n var splitURL = hypertyURL.split('://');\n var userURL = void 0;\n if (splitURL[0] !== 'hyperty') {\n // it is a Data Object URL\n\n _this._getHypertyFromDataObject(hypertyURL).then(function (returnedHypertyURL) {\n\n userURL = _this.registry.getHypertyOwner(returnedHypertyURL);\n\n if (userURL) {\n var identity = _this.identities.getIdentity(userURL);\n if (identity) return resolve(identity);else return reject('[IdentityModule.getIdToken] Identity not found for: ', userURL);\n } else {\n return reject('[IdentityModule.getIdToken] User not found for hyperty: ', returnedHypertyURL);\n }\n }).catch(function (reason) {\n log.error('[IdentityModule.getIdToken] Error: ', reason);\n reject(reason);\n });\n } else {\n userURL = _this.registry.getHypertyOwner(hypertyURL);\n if (userURL) {\n\n var identity = _this.identities.getIdentity(userURL);\n if (identity) return resolve(identity);else return reject('[IdentityModule.getIdToken] Identity not found for: ', userURL);\n } else {\n return reject('[IdentityModule.getIdToken] User not found for hyperty: ', userURL);\n }\n }\n });\n }\n\n /**\n * get an Access Token for an external API\n * @param {String} url the external url\n * @return {JSON} token Access token to be added to the message\n */\n\n }, {\n key: '_getAccessToken',\n value: function _getAccessToken(msg) {\n var url = msg.to;\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n if (!msg.hasOwnProperty('body')) {\n return reject('[IdentityModule._getAccessToken] missing mandatory msg body: ', msg);\n }\n if (!msg.body.hasOwnProperty('value')) {\n return reject('[IdentityModule._getAccessToken] missing mandatory msg body value: ', msg);\n }\n if (!msg.body.value.hasOwnProperty('resources')) {\n return reject('[IdentityModule._getAccessToken] missing mandatory msg body value resources: ', msg);\n }\n var domainToCheck = (0, _utils.divideURL)(url).domain;\n\n if (url.includes('protostub')) {\n domainToCheck = domainToCheck.replace(domainToCheck.split('.')[0] + '.', '');\n }\n\n var resources = msg.body.value.resources;\n\n _this._getAccessTokenForDomain(domainToCheck, resources).then(function (token) {\n resolve(token);\n });\n });\n }\n }, {\n key: '_getAccessTokenForDomain',\n value: function _getAccessTokenForDomain(domainToCheck, resources) {\n var _this = this;\n var token = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n try {\n token = _this.identities.getAccessToken(domainToCheck, resources);\n } catch (e) {\n return reject('[IdentityModule._getAccessTokenForDomain] Access Token error ' + err);\n }\n\n if (!token) {\n _this._getNewAccessToken(domainToCheck, resources).then(function (token) {\n log.log('[Identity.IdentityModule._getAccessTokenForDomain] new Access Token ', token);\n return resolve(token);\n }).catch(function (err) {\n reject('[IdentityModule._getAccessTokenForDomain] on getNewAccessToken ' + err);\n });\n } else if (token.status === 'in-progress') {\n return resolve(_this._inProgressAccessToken(domainToCheck, resources));\n } else {\n var timeNow = (0, _utils.secondsSinceEpoch)();\n\n log.log('[Identity.IdentityModule._getAccessTokenForDomain] found Access Token ', token);\n\n if (timeNow >= token.expires) {\n // if (true) {\n if (token.hasOwnProperty(\"refresh\")) {\n _this._refreshAccessToken((0, _utils.deepClone)(token)).then(function (newToken) {\n return resolve(_this.identities.updateAccessToken(newToken));\n });\n } else return resolve(_this._getNewAccessToken(domainToCheck, resources));\n } else return resolve((0, _utils.deepClone)(token));\n }\n });\n }\n }, {\n key: '_inProgressAccessToken',\n value: function _inProgressAccessToken(domain, resources) {\n var _this4 = this;\n\n this.identities.watchingYou.observe('accessTokens', function (change) {\n\n log.log('[IdentityModule._inProgressAccessToken] accessTokens changed ' + _this4.identities.accessTokens);\n\n var keypath = change.keypath;\n\n if (keypath.includes('status')) {\n keypath = keypath.replace('.status', '');\n }\n\n if (keypath === domain && change.name === 'status' && change.newValue === 'created') {\n // log.log('[Identity.IdentityModule.getToken] token is created ' + _this.identitiesList[domain]);\n return _this4.identities.getAccessToken(domain, resources);\n }\n });\n }\n }, {\n key: '_getNewAccessToken',\n value: function _getNewAccessToken(domain, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.identities.setAccessTokenInProgress(domain);\n\n var message = {\n type: 'execute',\n to: _this._resolveDomain(domain),\n from: _this._idmURL,\n body: {\n method: 'getAccessTokenAuthorisationEndpoint',\n params: resources\n }\n };\n\n //let's first get the authorisation URL from the Idp Proxy\n _this._messageBus.postMessage(message, function (res) {\n if (res.body.code > 299) {\n return reject('[IdentityModule._getNewAccessToken] Error on getAccessTokenAuthorisationEndpoint from IdP Proxy: ', res.body.desc);\n }\n\n // let's ask the user for authorisation\n _this.callIdentityModuleFunc('openPopup', { urlreceived: res.body.value }).then(function (authorisation) {\n log.log('[IdentityModule:callIdentityModuleFunc:openPopup] auhtorisation result: ', authorisation);\n\n message.body.method = 'getAccessToken';\n message.body.params = {\n resources: resources,\n login: authorisation\n };\n\n //wihtout callback to avoid timeout errors?\n\n // let's ask Access Token from the Idp Proxy\n _this._messageBus.postMessage(message, function (res) {\n if (res.body.code > 299) return reject('[IdentityModule._getNewAccessToken] Error on getAccessToken from IdP Proxy: ', res.body.desc);\n\n _this.identities.addAccessToken(res.body.value).then(function (token) {\n log.info('[IdentityModule._getNewAccessToken] resolving token: ', token);\n return resolve(res.body.value);\n }, function (err) {\n reject(err);\n });\n });\n }, function (err) {\n reject(err);\n });\n });\n });\n }\n }, {\n key: '_refreshAccessToken',\n value: function _refreshAccessToken(outdatedToken) {\n var _this = this;\n\n // let domain = _this._resolveDomain(oldIdentity.idp);\n // let message;\n // let assertion = _this.getIdentity(oldIdentity.userProfile.userURL);\n\n log.log('IdentityModule._refreshAccessToken:outdatedToken', outdatedToken);\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(outdatedToken.domain);\n var message = void 0;\n\n message = { type: 'execute', to: domain, from: _this._idmURL, body: { method: 'refreshAccessToken', params: { token: outdatedToken } } };\n try {\n _this._messageBus.postMessage(message, function (res) {\n var result = res.body.value;\n resolve(result);\n });\n } catch (err) {\n reject('In IdentityModule._refreshAccessToken on postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'sendRefreshMessage',\n value: function sendRefreshMessage(oldIdentity) {\n var _this = this;\n\n // let domain = _this._resolveDomain(oldIdentity.idp);\n // let message;\n // let assertion = _this.getIdentity(oldIdentity.userProfile.userURL);\n\n log.log('sendRefreshMessage:oldIdentity', oldIdentity);\n\n return new _promise2.default(function (resolve, reject) {\n var domain = _this._resolveDomain(oldIdentity.idp.domain);\n var message = void 0;\n var assertion = _this.getIdentity(oldIdentity.userProfile.userURL);\n\n log.info('sendRefreshMessage:oldIdentity', oldIdentity);\n\n message = { type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'refreshAssertion', params: { identity: assertion } } };\n try {\n _this._messageBus.postMessage(message, function (res) {\n var result = res.body.value;\n resolve(result);\n });\n } catch (err) {\n reject('In sendRefreshMessage on postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'getAccessToken',\n value: function getAccessToken(idpDomain, resources, login) {\n log.log('[getAccessToken:idpDomain]', idpDomain);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(idpDomain);\n var message = void 0;\n\n message = {\n type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'getAccessToken', params: { resources: resources, login: login } }\n };\n try {\n _this._messageBus.postMessage(message, function (res) {\n\n if (res.body.code < 299) {\n var result = res.body.value;\n resolve(result);\n } else resolve(res.body);\n });\n } catch (err) {\n reject('IdentityModule.In getAccessToken: ' + err);\n }\n });\n }\n }, {\n key: 'getAccessTokenAuthorisationEndpoint',\n value: function getAccessTokenAuthorisationEndpoint(scope, idpDomain) {\n log.log('[getAccessTokenAuthorisationEndpoint:idpDomain]', idpDomain);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(idpDomain);\n var message = void 0;\n\n message = {\n type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'getAccessTokenAuthorisationEndpoint', params: { resources: scope } }\n };\n try {\n _this._messageBus.postMessage(message, function (res) {\n var result = res.body.value;\n resolve(result);\n });\n } catch (err) {\n reject('In getAccessTokenAuthorisationEndpoint: ' + err);\n }\n });\n }\n }, {\n key: 'sendGenerateMessage',\n value: function sendGenerateMessage(contents, origin, usernameHint, idpDomain) {\n log.log('[sendGenerateMessage:contents]', contents);\n log.log('[sendGenerateMessage:origin]', origin);\n log.log('[sendGenerateMessage:usernameHint]', usernameHint);\n log.log('[sendGenerateMessage:idpDomain]', idpDomain);\n log.log('sendGenerateMessage_hint');\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(idpDomain);\n var message = void 0;\n\n message = {\n type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'generateAssertion', params: { contents: contents, origin: origin, usernameHint: usernameHint } }\n };\n try {\n _this._messageBus.postMessage(message, function (res) {\n\n if (res.body.code < 300) resolve(res.body.value);else reject(res.body);\n });\n } catch (err) {\n reject('In sendGenerateMessage: ' + err);\n }\n });\n }\n\n /**\n * Requests the IdpProxy from a given Domain for an identityAssertion\n *\n * @param {DOMString} contents contents\n * @param {DOMString} origin origin\n * @param {DOMString} usernameHint usernameHint\n * @param {JSON} keyPair user keyPair\n * @return {IdAssertion} IdAssertion\n */\n\n }, {\n key: 'generateAssertion',\n value: function generateAssertion(contents, origin, usernameHint, idpDomain) {\n log.log('[generateAssertion:contents]', contents);\n log.log('[generateAssertion:origin]', origin);\n log.log('[generateAssertion:usernameHint]', usernameHint);\n\n // log.log('[generateAssertion:keyPair]', keyPair);\n log.log('[generateAssertion:idpDomain]', idpDomain);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n log.log('[IdentityModule:sendGenerateMessage:sendGenerateMessage]', usernameHint);\n _this.sendGenerateMessage(contents, origin, usernameHint, idpDomain).then(function (result) {\n\n if (result) {\n\n _this.identities.addAssertion(result).then(function (value) {\n resolve(result);\n }, function (err) {\n reject(err);\n });\n } else {\n reject('error on obtaining identity information');\n }\n }, function (error) {\n if (error.hasOwnProperty('description') && error.description.hasOwnProperty('loginUrl')) {\n _this.callIdentityModuleFunc('openPopup', { urlreceived: error.description.loginUrl }).then(function (value) {\n log.log('[IdentityModule:callIdentityModuleFunc:openPopup]', usernameHint);\n\n resolve(value);\n }, function (err) {\n reject(err);\n });\n } else {\n log.error('[IdentityModule:sendGenerateMessage] generate assertion with hint error ', error);\n reject(error);\n }\n }).catch(function (err) {\n reject('On generateAssertion from method sendGenerateMessage error: ' + err);\n });\n });\n }\n\n /**\n * Requests the IdpProxy from a given Domain to validate an IdentityAssertion\n * Returns a promise with the result from the validation.\n * @param {DOMString} assertion\n * @param {DOMString} origin origin\n * @return {Promise} Promise promise with the result from the validation\n */\n\n }, {\n key: 'validateAssertion',\n value: function validateAssertion(assertion, origin, idpDomain) {\n log.log('[validateAssertion:assertion]', assertion);\n log.log('[validateAssertion:origin]', origin);\n log.log('[validateAssertion:idpDomain]', idpDomain);\n var _this = this;\n\n var domain = _this._resolveDomain(idpDomain);\n\n var message = {\n type: 'execute', to: domain, from: _this._idmURL, body: {\n resource: 'identity', method: 'validateAssertion',\n params: { assertion: assertion, origin: origin }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n try {\n _this._messageBus.postMessage(message, function (result) {\n if (result.body.code === 200) {\n resolve(result.body.value);\n } else {\n reject('error', result.body.code);\n }\n });\n } catch (err) {\n reject('On validateAssertion from method postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'addGUIListeners',\n value: function addGUIListeners() {\n var _this = this;\n\n _this._messageBus.addListener(_this._idmURL, function (msg) {\n var funcName = msg.body.method;\n\n log.log('[IdentityModule:addGUIListeners]', msg, msg.body, funcName);\n\n var returnedValue = void 0;\n\n if (funcName === 'deployGUI') {\n returnedValue = _this.deployGUI();\n } else if (funcName === 'getIdentitiesToChoose') {\n _this.getIdentitiesToChoose().then(function (result) {\n // if the function requested is not a promise\n var value = { type: 'execute', value: result, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'unregisterIdentity') {\n var email = msg.body.params.email;\n returnedValue = _this.unregisterIdentity(email);\n } else if (funcName === 'getMyPublicKey') {\n // because generateRSAKeyPair is a promise\n // we have to send the message only after getting the key pair\n _this._crypto.getMyPublicKey().then(function (pubKey) {\n pubKey = (0, _utils.stringify)(pubKey);\n var value = { type: 'execute', value: pubKey, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if generateRSAKeyPair method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'sendGenerateMessage') {\n var contents = msg.body.params.contents;\n var origin = msg.body.params.origin;\n var usernameHint = msg.body.params.usernameHint;\n var idpDomain = msg.body.params.idpDomain;\n var _replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to };\n _this.sendGenerateMessage(contents, origin, usernameHint, idpDomain).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n _replyMsg.body = value;\n try {\n _this._messageBus.postMessage(_replyMsg);\n } catch (err) {\n log.error('IdentityModule.addGUIListeners sendGenerateMessage error: ' + err);\n }\n }, function (err) {\n log.info('IDPProxy generateAssertion reply error ' + err);\n _replyMsg.body = err;\n _this._messageBus.postMessage(_replyMsg);\n });\n return;\n } else if (funcName === 'getAccessTokenAuthorisationEndpoint') {\n var scope = msg.body.params.scope;\n var _idpDomain = msg.body.params.idpDomain;\n _this.getAccessTokenAuthorisationEndpoint(scope, _idpDomain).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if sendGenerateMessage method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'addAccessToken') {\n var accessToken = msg.body.params;\n\n _this.identities.addAccessToken(accessToken).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'getAccessToken') {\n\n var domain = msg.body.params.idpDomain;\n var resources = msg.body.params.resources;\n var login = msg.body.params.login;\n var _replyMsg2 = { id: msg.id, type: 'response', to: msg.from, from: msg.to };\n\n _this.getAccessToken(domain, resources, login).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n _replyMsg2.body = value;\n try {\n _this._messageBus.postMessage(_replyMsg2);\n } catch (err) {\n log.error('On addGUIListeners from if sendGenerateMessage method postMessage error: ' + err);\n }\n }, function (error) {\n try {\n _replyMsg2.body = error;\n _this._messageBus.postMessage(_replyMsg2);\n } catch (err) {\n log.error('On addGUIListeners from if sendGenerateMessage method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'addAssertion') {\n var result = msg.body.params;\n\n // let keyPair = msg.body.params.keyPair;\n _this.identities.addAssertion(result).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'refreshAccessToken') {\n var _domain = msg.body.params.domain;\n var _resources = msg.body.params.resources;\n\n _this._getAccessTokenForDomain(_domain, _resources).then(function (token) {\n var replyMsg = {\n id: msg.id,\n type: 'response',\n to: msg.from,\n from: msg.to,\n body: {\n value: token.accessToken,\n code: 200\n }\n };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners for refreshAccessToken request: ' + err);\n }\n });\n return;\n } /*else if (funcName === 'selectIdentityForHyperty') {\n let origin = msg.body.params.origin;\n let idp = msg.body.params.idp;\n let idHint = msg.body.params.idHint;\n _this.selectIdentityForHyperty(origin, idp, idHint);\n return;\n }*/\n\n // if the function requested is not a promise\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'deployGUI',\n value: function deployGUI() {\n var _this = this;\n _this.guiDeployed = true;\n }\n\n //******************* PRIVATE METHODS *******************\n /**\n * GetValidToken is for non legacy hyperties and verifies if the Token is still valid\n * if the token is invalid it requests a new token\n * @param {String} hypertyURL hypertyURL\n * @return {Promise}\n */\n\n }, {\n key: '_getValidToken',\n value: function _getValidToken(hypertyURL) {\n log.log('[IdentityModule._getValidToken]:hypertyURL', hypertyURL);\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this.getIdToken(hypertyURL).then(function (assertion) {\n log.log('[IdentityModule._getValidToken] retrieved IdAssertion', assertion);\n var timeNow = (0, _utils.secondsSinceEpoch)();\n\n if (!assertion.hasOwnProperty('expires')) return resolve(assertion);\n\n var expirationDate = assertion.expires;\n\n /* if (completeId.hasOwnProperty('info')) {\n if (completeId.info.hasOwnProperty('expires')) {\n expirationDate = completeId.info.expires;\n } else if (completeId.info.hasOwnProperty('tokenIDJSON')) {\n expirationDate = completeId.info.tokenIDJSON.exp;\n } else {\n // throw 'The ID Token does not have an expiration time';\n log.info('The ID Token does not have an expiration time');\n resolve(assertion);\n }\n } else if (completeId.hasOwnProperty('infoToken') && completeId.infoToken.hasOwnProperty('exp')) {\n expirationDate = completeId.infoToken.exp;\n } else {\n // throw 'The ID Token does not have an expiration time';\n log.info('The ID Token does not have an expiration time');\n resolve(assertion);\n }*/\n\n log.log('[Identity.IdentityModule.getValidToken] Token expires in', expirationDate);\n log.log('[Identity.IdentityModule.getValidToken] time now:', timeNow);\n\n if (timeNow >= expirationDate) {\n // if (timeNow >= 0) {\n if (assertion.hasOwnProperty('refresh')) {\n log.log('[Identity.IdentityModule.getValidToken] refreshing assertion: ', assertion);\n\n _this.sendRefreshMessage(assertion).then(function (newAssertion) {\n log.log('[Identity.IdentityModule.getValidToken] refreshed assertion: ', newAssertion);\n _this.identities.updateAssertion(newAssertion).then(function () {\n resolve(newAssertion);\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error updating the assertion ', err);\n reject(err);\n });\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error refreshing the assertion ', err);\n reject(err);\n });\n } else {\n // no refresh token available, user has to authenticate again to get a new assertion\n // generate new idToken\n _this.callGenerateMethods(assertion.idp.domain).then(function (value) {\n resolve(value);\n }).catch(function (err) {\n reject('[IdentityModule.getValidToken] error when generating a new assertion ' + err);\n });\n }\n } else {\n resolve(assertion);\n }\n }).catch(function (error) {\n log.error('[IdentityModule.getValidToken] error on getIdToken', error);\n reject(error);\n });\n });\n }\n\n /**\n * returns the reporter associated to the dataObject URL\n * @param {String} dataObjectURL dataObject url\n * @return {String} reporter dataObject url reporter\n */\n\n }, {\n key: '_getHypertyFromDataObject',\n value: function _getHypertyFromDataObject(dataObjectURL) {\n log.info('_getHypertyFromDataObject:dataObjectURL', dataObjectURL);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var splitedURL = (0, _utils.divideURL)(dataObjectURL);\n var domain = splitedURL.domain;\n var finalURL = (0, _utils.parseMessageURL)(dataObjectURL);\n\n // check if is the creator of the hyperty\n var reporterURL = _this.registry.getReporterURLSynchonous(finalURL);\n log.info('_getHypertyFromDataObject:reporterURL', reporterURL);\n\n if (reporterURL) {\n resolve(reporterURL);\n } else {\n // check if there is already an association from an hypertyURL to the dataObject\n var storedReporterURL = _this.dataObjectsIdentity[finalURL];\n log.info('_getHypertyFromDataObject:storedReporterURL', storedReporterURL);\n\n if (storedReporterURL) {\n resolve(storedReporterURL);\n } else {\n // check if there is any hyperty that subscribed the dataObjectURL\n var subscriberHyperty = _this.registry.getDataObjectSubscriberHyperty(dataObjectURL);\n log.info('_getHypertyFromDataObject:subscriberHyperty', subscriberHyperty);\n\n if (subscriberHyperty) {\n resolve(subscriberHyperty);\n } else {\n // search in domain registry for the hyperty associated to the dataObject\n // search in case is a subscriber who wants to know the reporter\n // To be reviewed in order to avoid the discovery transaction\n _this._coreDiscovery.discoverDataObjectPerURL(finalURL, domain).then(function (dataObject) {\n log.info('_getHypertyFromDataObject:dataObject', dataObject);\n _this.dataObjectsIdentity[finalURL] = dataObject.reporter;\n log.info('_getHypertyFromDataObject:dataObject.reporter', dataObject.reporter);\n resolve(dataObject.reporter);\n }, function (err) {\n reject(err);\n });\n }\n }\n }\n });\n }\n\n /**\n * Function that resolve and create the domainURL in case it is provided one. If not, resolve the default domainURL\n * @param {String} idpDomain idpDomain (Optional)\n */\n\n }, {\n key: '_resolveDomain',\n value: function _resolveDomain(idpDomain) {\n if (!idpDomain) {\n return 'domain-idp://google.com';\n } else {\n return 'domain-idp://' + idpDomain;\n }\n }\n\n /*\n _secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n }*/\n\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n _this.addGUIListeners();\n }\n\n /**\n * return the coreDiscovery component\n * do we need this??\n */\n\n }, {\n key: 'coreDiscovery',\n get: function get() {\n var _this = this;\n return _this._coreDiscovery;\n }\n\n /**\n * Set the coreDiscovery component\n * @param {coreDiscovery} coreDiscovery\n */\n ,\n set: function set(coreDiscovery) {\n var _this = this;\n _this._coreDiscovery = coreDiscovery;\n }\n\n /**\n * return the registry in this idModule\n * @param {registry} registry\n */\n\n }, {\n key: 'registry',\n get: function get() {\n var _this = this;\n return _this._registry;\n }\n\n /**\n * Set the registry in this idModule\n * @param {registry} reg\n */\n ,\n set: function set(registry) {\n var _this = this;\n _this._registry = registry;\n }\n }, {\n key: 'identities',\n get: function get() {\n var _this = this;\n return _this._identities;\n },\n set: function set(identities) {\n var _this = this;\n _this._identities = identities;\n }\n }, {\n key: 'idps',\n get: function get() {\n return this._listOfIdps;\n }\n }]);\n return IdentityModule;\n}();\n\nexports.default = IdentityModule;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0eU1vZHVsZS5qcz81MTE1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignSWRlbnRpdHlNb2R1bGUnKTtcblxuaW1wb3J0IHsgc2Vjb25kc1NpbmNlRXBvY2gsIGRpdmlkZVVSTCwgcGFyc2VNZXNzYWdlVVJMLCBzdHJpbmdpZnksIGRlZXBDbG9uZSB9IGZyb20gJy4uL3V0aWxzL3V0aWxzLmpzJztcbmltcG9ydCB7IHJ1bnRpbWVDb25maWd1cmF0aW9uIH0gZnJvbSAnLi4vcnVudGltZS9ydW50aW1lQ29uZmlndXJhdGlvbic7XG5cbmltcG9ydCBJZGVudGl0aWVzIGZyb20gJy4vSWRlbnRpdGllcyc7XG5pbXBvcnQgR3VpRmFrZSBmcm9tICcuL0d1aUZha2UnO1xuXG4vKipcbipcbiogVGhlIElkZW50aXR5IE1vZHVsZSAoSWQgTW9kdWxlKSBpcyB0aGUgY29tcG9uZW50IHJlc3BvbnNpYmxlIGZvciBoYW5kbGluZyB0aGVcbiogdXNlciBpZGVudGl0eSBhbmQgdGhlIGFzc29jaWF0aW9uIG9mIHRoaXMgaWRlbnRpdHkgd2l0aCB0aGUgSHlwZXJ0eSBpbnN0YW5jZXMsXG4qIGluIG9yZGVyIHRvIG1ha2UgSHlwZXJ0eSBpbnN0YW5jZXMgaWRlbnRpZmlhYmxlLiBUaGUgaWRlbnRpdHkgaW4gdGhlIHJlVEhJTksgcHJvamVjdFxuKiBpcyBub3QgZml4ZWQgdG8gY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ZSBpZiAoYXNzZXJ0aW9uLmhhc093blByb3BlcnR5KCdyZWZyZXNoJykpIHtcbiAgICAgICAgICAgICAgbG9nLmxvZygnW0lkZW50aXR5LklkZW50aXR5TW9kdWxlLmdldElkZW50aXR5QXNzZXJ0aW9uXSByZWZyZXNoaW5nIGFzc2VydGlvbjogJywgYXNzZXJ0aW9uKTtcblxuICAgICAgICAgICAgICBfdGhpcy5fcmVmcmVzaElkQXNzZXJ0aW9uKCkudGhlbigobmV3QXNzZXJ0aW9uKT0+e1xuICAgICAgICAgICAgICAgIGxvZy5sb2coJ1tJZGVudGl0eU1vZHVsZS5nZXRJZGVudGl0eUFzc2VydGlvbl0gcmVmcmVzaGVkIGFzc2VydGlvbi4nLCBuZXdBc3NlcnRpb24pO1xuICAgICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKG5ld0Fzc2VydGlvbik7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIF90aGlzLl9nZXRJZEFzc2VydGlvbkZvckRvbWFpbihvcmlnaW4sIGlkcCwgaWRIaW50KS50aGVuKChhc3NlcnRpb24pPT4ge1xuICAgICAgICAgICAgICByZXNvbHZlKGFzc2VydGlvbik7XG4gICAgICAgICAgICB9LCAoZXJyb3IpPT57XG4gICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IFxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIF90aGlzLl9nZXRJZEFzc2VydGlvbkZvckRvbWFpbihvcmlnaW4sIGlkcCwgaWRIaW50KS50aGVuKChhc3NlcnRpb24pPT4ge1xuICAgICAgICAgICAgcmVzb2x2ZShhc3NlcnRpb24pO1xuICAgICAgICAgIH0sIChlcnJvcik9PntcbiAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICB9IGVsc2UgaWYgKF90aGlzLmlkZW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4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKGFzc2VydGlvbik7XG5cbiAgICAgICAgICAgIH0sIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIF90aGlzLnNlbGVjdElkZW50aXR5RnJvbUdVSSgpLnRoZW4oKGFzc2VydGlvbikgPT4ge1xuXG4gICAgICAgICAgICBsb2cubG9nKCdbSWRlbnRpdHlNb2R1bGVdIElkZW50aXR5IHNlbGVjdGVkIGZyb20gR1VJLicpO1xuXG4gICAgICAgICAgICBfdGhpcy5pZGVudGl0aWVzLmRlZmF1bHRJZGVudGl0eSA9IGFzc2VydGlvbi51c2VyUHJvZmlsZS51c2VyVVJMO1xuICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoYXNzZXJ0aW9uKTtcblxuICAgICAgICAgIH0sIChlcnIpID0+IHtcbiAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICB9XG4gICAgICB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgIGxvZy5lcnJvcignRXJyb3Igb24gaWRlbnRpdHkgYWNxdWlzaXRpb24gJywgZXJyb3IpO1xuICAgICAgICByZXR1cm4gcmVqZWN0KGVycm9yKTtcbiAgICAgIH0pO1xuXG4gICAgICBfdGhpcy5ydW50aW1lQ2FwYWJpbGl0aWVzLmlzQXZhaWxhYmxlKCdub2RlJykudGhlbigocmVzdWx0KSA9PiB7XG4gICAgICAgIGxvZy5sb2coJ25vZGUgaWRlbnRpdHkgYWNxdWlzaXRpb24nLCByZXN1bHQpO1xuXG4gICAgICAgIGlmICghcmVzdWx0KSByZXR1cm47XG5cbiAgICAgICAgaWYgKF90aGlzLmlkZW50aXRpZXMuY3VycmVudElkZW50aXR5KSB7XG4gICAgICAgICAgLy9UT0RPIHZlcmlm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B0aW1lIG5vdzonLCB0aW1lTm93KTtcblxuICAgICAgICBpZiAodGltZU5vdyA+PSBleHBpcmF0aW9uRGF0ZSkge1xuLy8gICAgICAgIGlmICh0aW1lTm93ID49IDApIHtcbiAgICAgICAgICAgIGlmIChhc3NlcnRpb24uaGFzT3duUHJvcGVydHkoJ3JlZnJlc2gnKSkge1xuICAgICAgICAgICAgICBsb2cubG9nKCdbSWRlbnRpdHkuSWRlbnRpdHlNb2R1bGUuZ2V0VmFsaWRUb2tlbl0gcmVmcmVzaGluZyBhc3NlcnRpb246ICcsIGFzc2VydGlvbik7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIF90aGlzLnNlbmRSZWZyZXNoTWVzc2FnZShhc3NlcnRpb24pLnRoZW4oKG5ld0Fzc2VydGlvbikgPT4ge1xuICAgICAgICAgICAgICAgIGxvZy5sb2coJ1tJZGVudGl0eS5JZGVudGl0eU1vZHVsZS5nZXRWYWxpZFRva2VuXSByZWZyZXNoZWQgYXNzZXJ0aW9uOiAnLCBuZXdBc3NlcnRpb24pO1xuICAgICAgICAgICAgICBfdGhpcy5pZGVudGl0aWVzLnVwZGF0ZUFzc2VydGlvbihuZXdBc3NlcnRpb24pLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgIHJlc29sdmUobmV3QXNzZXJ0aW9uKTtcbiAgICAgICAgICAgICAgfSwgKGVycikgPT4ge1xuICAgICAgICAgICAgICAgIGxvZy5lcnJvcignW0lkZW50aXR5TW9kdWxlLmdldFZhbGlkVG9rZW5dIGVycm9yIHVwZGF0aW5nIHRoZSBhc3NlcnRpb24gJywgZXJyKTtcbiAgICAgICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9LCAoZXJyKSA9PiB7XG4gICAgICAgICAgICAgIGxvZy5lcnJvcignW0lkZW50aXR5TW9kdWxlLmdldFZhbGlkVG9rZW5dIGVycm9yIHJlZnJlc2hpbmcgdGhlIGFzc2VydGl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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBNTVDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBOzs7QUE0QkE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7OztBQTAwQ0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///509\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(511), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9udW1iZXIvaXMtaW50ZWdlci5qcz80NTFhIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9udW1iZXIvaXMtaW50ZWdlclwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9udW1iZXIvaXMtaW50ZWdlci5qc1xuLy8gbW9kdWxlIGlkID0gNTEwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///510\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(512);\nmodule.exports = __webpack_require__(11).Number.isInteger;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9udW1iZXIvaXMtaW50ZWdlci5qcz83MzhlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm51bWJlci5pcy1pbnRlZ2VyJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5OdW1iZXIuaXNJbnRlZ2VyO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL251bWJlci9pcy1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSA1MTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///511\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(26);\n\n$export($export.S, 'Number', { isInteger: __webpack_require__(513) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5udW1iZXIuaXMtaW50ZWdlci5qcz9kNWE5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi4zIE51bWJlci5pc0ludGVnZXIobnVtYmVyKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdOdW1iZXInLCB7IGlzSW50ZWdlcjogcmVxdWlyZSgnLi9faXMtaW50ZWdlcicpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm51bWJlci5pcy1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSA1MTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///512\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(45);\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1pbnRlZ2VyLmpzPzAwYTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMS4yLjMgTnVtYmVyLmlzSW50ZWdlcihudW1iZXIpXG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGlzSW50ZWdlcihpdCkge1xuICByZXR1cm4gIWlzT2JqZWN0KGl0KSAmJiBpc0Zpbml0ZShpdCkgJiYgZmxvb3IoaXQpID09PSBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtaW50ZWdlci5qc1xuLy8gbW9kdWxlIGlkID0gNTEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///513\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('IdentityModule');\n\n/**\n* fake class for the gui to select the identity,\n* TODO replace with the proper identity GUI\n*\n*/\n// Log System\n\nvar GuiFake = function GuiFake(url, messageBus) {\n (0, _classCallCheck3.default)(this, GuiFake);\n\n log.log('FakeGUI_deployed');\n var _this = this;\n\n _this._url = url;\n _this._waitTime = 10000;\n _this._messageBus = messageBus;\n\n _this._messageBus.addListener(_this._url, function (msg) {\n\n if (msg.hasOwnProperty('type') && msg.type === 'create' && msg.body.hasOwnProperty('value') && msg.body.value.hasOwnProperty('identities') && msg.body.value.hasOwnProperty('idps')) {\n\n var identities = msg.body.value.identities;\n var idps = msg.body.value.idps;\n\n var value = void 0;\n\n if (identities[0] !== undefined) {\n value = { type: 'identity', value: identities[0], code: 200 };\n } else {\n value = { type: 'idp', value: idps[1].domain, code: 200 };\n }\n\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n\n // to test on the identity side the listener without the timeout\n // can represent the time the user takes to choose and identity\n if (msg.body.value === 'wait') {\n\n setTimeout(function () {\n _this._messageBus.postMessage(replyMsg);\n }, _this._waitTime);\n } else {\n _this._messageBus.postMessage(replyMsg);\n }\n } else {\n log.log('Ignoring messages not intended to FakeGUI.', msg);\n }\n });\n};\n\nexports.default = GuiFake;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9HdWlGYWtlLmpzP2Q4YTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdJZGVudGl0eU1vZHVsZScpO1xuXG4vKipcbiogZmFrZSBjbGFzcyBmb3IgdGhlIGd1aSB0byBzZWxlY3QgdGhlIGlkZW50aXR5LFxuKiBUT0RPIHJlcGxhY2Ugd2l0aCB0aGUgcHJvcGVyIGlkZW50aXR5IEdVSVxuKlxuKi9cbmNsYXNzIEd1aUZha2Uge1xuXG4gIGNvbnN0cnVjdG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DQTtBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///514\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _Identities = __webpack_require__(214);\n\nvar _Identities2 = _interopRequireDefault(_Identities);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Provides an API to manage identities from msg bus pipeline\n* TODO: rename to something like IdentityPipelineHandler in order not to conflict with framework related IdentityHandler\n*/\n\nvar log = logger.getLogger('IdentityHandler');\n\nvar IdentityHandler = function () {\n function IdentityHandler(idm) {\n (0, _classCallCheck3.default)(this, IdentityHandler);\n\n var _this = this;\n\n _this._idm = idm;\n }\n\n (0, _createClass3.default)(IdentityHandler, [{\n key: 'reset',\n value: function reset() {\n console.log('IM reset');\n\n // this._idm.identities.reset();\n this._idm.identities = new _Identities2.default(this._idm.identities._type, this._idm.identities._storageManager);\n console.log(this._idm.identities);\n }\n }, {\n key: '_isToSetID',\n value: function _isToSetID(message) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain'];\n\n var _from = message.from;\n\n if (message.body && message.body.hasOwnProperty('source')) {\n _from = message.body.source;\n }\n\n if (message.body && message.body.hasOwnProperty('subscriber')) {\n _from = message.body.subscriber;\n }\n\n if (message.type === 'forward') {\n return false;\n }\n\n // Signalling Messages between P2P Stubs don't have Identities. FFS\n if (_from.includes('/p2prequester/') || _from.includes('/p2phandler/')) {\n return false;\n }\n\n var splitFrom = _from.split('://');\n var fromSchema = splitFrom[0];\n var isToIgnore = schemasToIgnore.indexOf(fromSchema) === -1;\n\n return isToIgnore;\n }\n }, {\n key: 'processMessage',\n value: function processMessage(message) {\n var _this2 = this;\n\n log.log('[IdentityHandler.processMessage] ', message);\n\n return new _promise2.default(function (resolve, reject) {\n\n // skip messages that don't need identity tokens in the body\n\n if (!_this2._isToSetID(message)) return resolve(message);\n\n /* let from = message.from;\n let sourceURL = undefined;\n if ( message.hasOwnProperty('body') && message.body.hasOwnProperty('source')) {\n from = message.body.source;\n }\n if (message.type === 'forward') {\n from = message.body.from;\n }\n if (message.hasOwnProperty('body') && message.body.hasOwnProperty('subscriber')) {\n from = message.body.subscriber;\n }*/\n\n _this2._idm.getToken(message).then(function (identity) {\n\n if (!message.hasOwnProperty('body')) message.body = {};\n\n message.body.identity = identity;\n resolve(message);\n }).catch(function (reason) {\n log.error(reason);\n reject(reason);\n });\n });\n }\n }]);\n return IdentityHandler;\n}();\n\nexports.default = IdentityHandler;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0eUhhbmRsZXIuanM/ZTcwYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbi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G4gICAgfSk7XG5cblxuICB9XG5cblxufVxuXG5leHBvcnQgZGVmYXVsdCBJZGVudGl0eUhhbmRsZXI7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL2lkZW50aXR5L0lkZW50aXR5SGFuZGxlci5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBS0E7QUFDQTtBQURBO0FBQ0E7QUFBQTtBQUNBOzs7Ozs7O0FBUEE7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7OztBQWNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFHQTs7Ozs7QUFLQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///515\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ActionsService = __webpack_require__(517);\n\nvar _ActionsService2 = _interopRequireDefault(_ActionsService);\n\nvar _PDP = __webpack_require__(518);\n\nvar _PDP2 = _interopRequireDefault(_PDP);\n\nvar _Policy = __webpack_require__(519);\n\nvar _Policy2 = _interopRequireDefault(_Policy);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('PEP'); // Log System\n\nvar PEP = function () {\n\n /**\n * Creates a Policy Enforcement Point (PEP) instance\n * @param {Object} context\n */\n function PEP(context) {\n (0, _classCallCheck3.default)(this, PEP);\n\n var _this = this;\n\n _this.pdp = new _PDP2.default(context);\n _this.actionsService = new _ActionsService2.default(context);\n _this.context = context;\n context.pep = _this;\n\n //TODO should be added a trigger to verify when the loadConfigurations is successfully completed\n context.loadConfigurations();\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n\n (0, _createClass3.default)(PEP, [{\n key: 'addGUIListeners',\n value: function addGUIListeners() {\n var _this = this;\n\n _this.context.messageBus.addListener(_this.context.pepURL, function (msg) {\n var funcName = msg.body.method;\n\n var returnedValue = void 0;\n if (funcName === 'addToGroup') {\n var groupName = msg.body.params.groupName;\n var userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.addToGroup(groupName, userEmail);\n } else if (funcName === 'createGroup') {\n var _groupName = msg.body.params.groupName;\n returnedValue = _this.context.createGroup(_groupName);\n } else if (funcName === 'addPolicy') {\n var source = msg.body.params.source;\n var key = msg.body.params.key;\n var policy = msg.body.params.policy;\n var combiningAlgorithm = msg.body.params.combiningAlgorithm;\n returnedValue = _this.addPolicy(source, key, policy, combiningAlgorithm);\n } else if (funcName === 'deleteGroup') {\n var _groupName2 = msg.body.params.groupName;\n returnedValue = _this.context.deleteGroup(_groupName2);\n } else if (funcName === 'removePolicy') {\n var _source = msg.body.params.source;\n var _key = msg.body.params.key;\n returnedValue = _this.removePolicy(_source, _key);\n } else if (funcName === 'savePolicies') {\n var _source2 = msg.body.params.source;\n returnedValue = _this.context.savePolicies(_source2);\n } else if (funcName === 'userPolicies') {\n returnedValue = _this.context.userPolicies;\n } else if (funcName === 'activeUserPolicy') {\n var userPolicy = msg.body.params.userPolicy;\n if (userPolicy) {\n _this.context.activeUserPolicy = userPolicy;\n }\n returnedValue = _this.context.activeUserPolicy;\n } else if (funcName === 'userPolicy') {\n var _key2 = msg.body.params.key;\n returnedValue = _this.context.userPolicies[_key2];\n } else if (funcName === 'saveActivePolicy') {\n returnedValue = _this.context.saveActivePolicy();\n } else if (funcName === 'getMyEmails') {\n returnedValue = _this.context.getMyEmails();\n } else if (funcName === 'getMyHyperties') {\n returnedValue = _this.context.getMyHyperties();\n } else if (funcName === 'groups') {\n returnedValue = _this.context.groups;\n } else if (funcName === 'getGroupsNames') {\n returnedValue = _this.context.getGroupsNames();\n }if (funcName === 'removeFromGroup') {\n var _groupName3 = msg.body.params.groupName;\n var _userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.removeFromGroup(_groupName3, _userEmail);\n }\n\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n _this.context.messageBus.postMessage(replyMsg);\n });\n }\n\n /**\n * Adds a policy to the Policy Enforcement Point (PEP). The policy can be created by the service\n * provider or by the user.\n * @param {String} source\n * @param {String} key\n * @param {Object} policy\n */\n\n }, {\n key: 'addPolicy',\n value: function addPolicy(source, key, policy, combiningAlgorithm) {\n if (!source) throw new Error('source is not defined');\n if (!key) throw new Error('key is not defined');\n\n if (policy === undefined) {\n policy = new _Policy2.default(key, [], [], combiningAlgorithm);\n } else {\n if (!(policy instanceof _Policy2.default)) {\n policy = new _Policy2.default(policy.key, policy.rules, policy.actions, policy.combiningAlgorithm);\n }\n }\n\n switch (source) {\n case 'SERVICE_PROVIDER':\n this.context.savePolicies(source, policy, key);\n break;\n case 'USER':\n this.context.userPolicies[key] = policy;\n this.context.savePolicies(source);\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'authorise',\n value: function authorise(message, isIncoming) {\n var _this2 = this;\n\n // log.log('[Policy.PEP Authorise] ', message);\n // log.log(message);\n if (!message) throw new Error('message is not defined');\n if (!message.from) throw new Error('message.from is not defined');\n if (!message.to) throw new Error('message.to is not defined');\n if (!message.type) throw new Error('message.type is not defined');\n message.body = message.body || {};\n\n return new _promise2.default(function (resolve, reject) {\n\n message.body = message.body || {};\n var _this = _this2;\n\n var result = _this.pdp.evaluatePolicies(message, isIncoming);\n if (result === 'Not Applicable') {\n result = _this.context.defaultBehaviour;\n message.body.auth = false;\n }\n _this.actionsService.enforcePolicies(message, isIncoming).then(function (messages) {\n for (var i in messages) {\n message = messages[i];\n if (result) {\n message.body.auth = message.body.auth === undefined ? true : message.body.auth;\n resolve(message);\n } else {\n var errorMessage = { body: { code: 403, description: 'Blocked by policy' }, from: message.to, to: message.from, type: 'response' };\n reject(errorMessage);\n }\n }\n }, function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: 'authoriseSync',\n value: function authoriseSync(message) {\n var result = void 0;\n message.body = message.body || {};\n result = this.pdp.evaluatePolicies(message, true);\n if (result === 'Not Applicable') {\n result = this.context.defaultBehaviour;\n }\n return result;\n }\n }, {\n key: 'removePolicy',\n value: function removePolicy(source, key) {\n if (!source) throw new Error('source is not defined');\n if (source !== '*' && !key) throw new Error('key is not defined');\n\n switch (source) {\n case '*':\n this.context.serviceProviderPolicy = {};\n this.context.userPolicies = {};\n this.context.activeUserPolicy = undefined;\n this.context.savePolicies('USER');\n this.context.savePolicies('SERVICE_PROVIDER');\n this.context.saveActivePolicy();\n break;\n case 'SERVICE_PROVIDER':\n delete this.context.serviceProviderPolicy[key];\n this.context.savePolicies();\n break;\n case 'USER':\n delete this.context.userPolicies[key];\n if (key === this.context.activeUserPolicy) {\n this.context.activeUserPolicy = undefined;\n this.context.saveActivePolicy();\n }\n this.context.savePolicies('USER');\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this.context.messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this.context.messageBus = messageBus;\n _this.addGUIListeners();\n }\n }]);\n return PEP;\n}();\n\nexports.default = PEP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUEVQLmpzPzQ3ZjIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdQRVAnKTtcblxuaW1wb3J0IEFjdGlvbnNTZXJ2aWNlIGZyb20gJy4vQWN0aW9uc1NlcnZpY2UnO1xuaW1wb3J0IFBEUCBmcm9tICcuL1BEUCc7XG5pbXBvcnQgUG9saWN5IGZyb20gJy4vUG9saWN5JztcbmltcG9ydCB7aXNIeXBlcnR5VVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNsYXNzIFBFUCB7XG5cbiAgLyoqXG4gICogQ3JlYXRlcyBhIFBvbGljeSBFbmZvcmNlbWVudCBQb2ludCAoUEVQKSBpbnN0YW5jZVxuICAqIEBwYXJhbSAgICB7T2J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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF0QkE7QUF3QkE7OztBQXZMQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUE4S0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///516\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ActionsService = function () {\n function ActionsService(context) {\n (0, _classCallCheck3.default)(this, ActionsService);\n\n this.context = context;\n }\n\n (0, _createClass3.default)(ActionsService, [{\n key: 'enforcePolicies',\n value: function enforcePolicies(message, isIncomingMessage) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n var policies = _this.context.getPolicies(message, isIncomingMessage);\n\n if (policies !== undefined) {\n if (policies.serviceProviderPolicy !== undefined) {\n policies.serviceProviderPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n if (policies.userPolicy !== undefined) {\n policies.userPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n }\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'forwardToID',\n value: function forwardToID(message, email) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve, reject) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n _this.context.runtimeRegistry.discoverHypertyPerUser(email).then(function (result) {\n message.to = result.hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'forwardToHyperty',\n value: function forwardToHyperty(message, hypertyURL) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n message.to = hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'sendAutomaticMessage',\n value: function sendAutomaticMessage(message, text) {\n var _this = this;\n return new _promise2.default(function (resolve) {\n var automaticMessage = {\n from: message.to,\n to: message.from,\n body: {\n value: text\n },\n type: message.type\n };\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(automaticMessage);\n });\n }\n }]);\n return ActionsService;\n}();\n\nexports.default = ActionsService;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvQWN0aW9uc1NlcnZpY2UuanM/MjliZCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBBY3Rpb25zU2VydmljZSB7XG5cbiAgY29uc3RydWN0b3IoY29udGV4dCkge1xuICAgIHRoaXMuY29udGV4dCA9IGNvbnRleHQ7XG4gIH1cblxuICBlbmZvcmNlUG9saWNpZXMobWVzc2FnZSwgaXNJbmNvbWluZ01lc3NhZ2UpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuICAgIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG5cbiAgICAgIGxldCBwb2xpY2llcyA9IF90aGlzLmNvbnRleHQuZ2V0UG9saWNpZXMobWVzc2FnZSwgaXNJbmNvbWluZ01lc3NhZ2UpO1xuXG4gICAgICBpZiAocG9saWNpZXMgIT09IHVuZGVmaW5lZCkge1xuICAgICAgICBpZiAocG9saWNpZXMuc2VydmljZVByb3ZpZGVyUG9saWN5ICE9PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICBwb2xpY2llcy5zZXJ2aWNlUHJvdmlkZXJQb2xpY3kuZW5mb3JjZUFjdGlvbnMoX3RoaXMuY29udGV4dCwgbWVzc2FnZSkudGhlbihtZXNzYWdlcyA9PiB7XG4gICAgICAgICAgICByZXNvbHZlKG1lc3NhZ2VzKTtcbiAgICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKHBvbGljaWVzLnVzZXJQb2xpY3kgIT09IHVuZGVmaW5lZCkge1xuICAgICA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ozs7Ozs7O0FBQUE7QUFFQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBR0E7QUFOQTtBQVFBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///517\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(152);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* The Policy Decision Point (PDP) decides if a message is to be authorised by checking a set of\n* policies. The resource to be verified is specified in the first word of the 'condition' field of\n* a Policy object. The implementation that verifies if the message is compliant with a policy is\n* specified in a hashtable to allow dynamic definition of the implementation, providing\n* extensibility to the Policy Engine functionalities.\n*/\nvar PDP = function () {\n function PDP(context) {\n (0, _classCallCheck3.default)(this, PDP);\n\n this.context = context;\n this.operators = new _Operators2.default();\n }\n\n (0, _createClass3.default)(PDP, [{\n key: 'evaluatePolicies',\n value: function evaluatePolicies(message, isIncomingMessage) {\n var policies = this.context.getPolicies(message, isIncomingMessage);\n var result = 'Not Applicable';\n if (policies !== undefined) {\n result = this.evaluatePolicy(message, policies.serviceProviderPolicy, isIncomingMessage);\n if (result || result === 'Not Applicable') {\n var userResult = this.evaluatePolicy(message, policies.userPolicy, isIncomingMessage);\n if (userResult !== 'Not Applicable') {\n result = userResult;\n }\n }\n }\n\n return result;\n }\n }, {\n key: 'evaluatePolicy',\n value: function evaluatePolicy(message, policy, isIncoming) {\n var result = 'Not Applicable';\n if (policy) {\n result = policy.evaluateRules(this.context, message, isIncoming);\n }\n\n return result;\n }\n }]);\n return PDP;\n}();\n\nexports.default = PDP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUERQLmpzP2U5YmEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuL09wZXJhdG9ycyc7XG5cbi8qKlxuKiBUaGUgUG9saWN5IERlY2lzaW9uIFBvaW50IChQRFApIGRlY2lkZXMgaWYgYSBtZXNzYWdlIGlzIHRvIGJlIGF1dGhvcmlzZWQgYnkgY2hlY2tpbmcgYSBzZXQgb2ZcbiogcG9saWNpZXMuIFRoZSByZXNvdXJjZSB0byBiZSB2ZXJpZmllZCBpcyBzcGVjaWZpZW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NlclBvbGljeSwgaXNJbmNvbWluZ01lc3NhZ2UpO1xuICAgICAgICBpZiAodXNlclJlc3VsdCAhPT0gJ05vdCBBcHBsaWNhYmxlJykge1xuICAgICAgICAgIHJlc3VsdCA9IHVzZXJSZXN1bHQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG5cbiAgZXZhbHVhdGVQb2xpY3kobWVzc2FnZSwgcG9saWN5LCBpc0luY29taW5nKSB7XG4gICAgbGV0IHJlc3VsdCA9ICdOb3QgQXBwbGljYWJsZSc7XG4gICAgaWYgKHBvbGljeSkge1xuICAgICAgcmVzdWx0ID0gcG9saWN5LmV2YWx1YXRlUnVsZXModGhpcy5jb250ZXh0LCBtZXNzYWdlLCBpc0luY29taW5nKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUERQO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvUERQLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7Ozs7O0FBQ0E7Ozs7Ozs7QUFPQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///518\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AllowOverrides = __webpack_require__(215);\n\nvar _AllowOverrides2 = _interopRequireDefault(_AllowOverrides);\n\nvar _BlockOverrides = __webpack_require__(216);\n\nvar _BlockOverrides2 = _interopRequireDefault(_BlockOverrides);\n\nvar _FirstApplicable = __webpack_require__(217);\n\nvar _FirstApplicable2 = _interopRequireDefault(_FirstApplicable);\n\nvar _Rule = __webpack_require__(520);\n\nvar _Rule2 = _interopRequireDefault(_Rule);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Policy = function () {\n function Policy(key, rules, actions, combiningAlgorithm) {\n (0, _classCallCheck3.default)(this, Policy);\n\n if (!key) throw new Error('key is not defined');\n if (!actions) throw new Error('actions are not defined');\n\n this.actions = actions;\n this.key = key;\n this._setRules(rules);\n this._setCombiningAlgorithm(combiningAlgorithm);\n }\n\n (0, _createClass3.default)(Policy, [{\n key: 'addAction',\n value: function addAction(method, param) {\n this.actions.push({ method: method, param: param });\n }\n }, {\n key: 'createRule',\n value: function createRule(decision, condition, scope, target, priority) {\n if (priority === undefined) {\n priority = this.getLastPriority() + 1;\n }\n var rule = new _Rule2.default(decision, condition, scope, target, priority);\n this.rules.push(rule);\n }\n }, {\n key: 'deleteRule',\n value: function deleteRule(rule) {\n var indexToRemove = this.rules.indexOf(rule);\n this.rules.splice(indexToRemove, 1);\n }\n }, {\n key: 'enforceActions',\n value: function enforceActions(context, message) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var results = [];\n if (_this.actions.length !== 0) {\n for (var i in _this.actions) {\n var result = context.pep.actionsService[_this.actions[i].method](message, _this.actions[i].param);\n results.push(result);\n }\n _promise2.default.all(results).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'evaluateRules',\n value: function evaluateRules(context, message, isIncoming) {\n var results = [];\n for (var i in this.rules) {\n results.push(this.rules[i].evaluate(context, message, isIncoming));\n }\n\n return this.combiningAlgorithm.combine(results);\n }\n }, {\n key: 'getLastPriority',\n value: function getLastPriority() {\n var priorities = [];\n\n if (this.rules.length !== 0) {\n for (var i in this.rules) {\n priorities.push(this.rules[i].priority);\n }\n return Math.max.apply(Math, priorities);\n } else {\n return -1;\n }\n }\n }, {\n key: 'getRuleByPriority',\n value: function getRuleByPriority(priority) {\n for (var i in this.rules) {\n if (String(this.rules[i].priority) === String(priority)) {\n return this.rules[i];\n }\n }\n throw Error('Rule with priority ' + priority + ' does not exist!');\n }\n }, {\n key: '_setCombiningAlgorithm',\n value: function _setCombiningAlgorithm(combiningAlgorithm) {\n if (!combiningAlgorithm) {\n combiningAlgorithm = 'blockOverrides';\n }\n switch (combiningAlgorithm) {\n case 'blockOverrides':\n this.combiningAlgorithm = new _BlockOverrides2.default();\n break;\n case 'allowOverrides':\n this.combiningAlgorithm = new _AllowOverrides2.default();\n break;\n case 'firstApplicable':\n this.combiningAlgorithm = new _FirstApplicable2.default();\n break;\n default:\n throw Error('Unknown algorithm: ' + combiningAlgorithm);\n }\n }\n }, {\n key: '_setRules',\n value: function _setRules(rules) {\n this.rules = [];\n\n for (var i in rules) {\n var rule = rules[i];\n if (rule.priority === undefined) {\n rule.priority = this.getLastPriority() + 1;\n }\n if (!(rule instanceof _Rule2.default)) {\n rule = new _Rule2.default(rule.decision, rule.condition, rule.scope, rule.target, rule.priority);\n }\n this.rules.push(rule);\n }\n }\n }, {\n key: 'sortRules',\n value: function sortRules() {\n return this.rules.sort(function (a, b) {\n var x = a.priority;var y = b.priority;\n return x < y ? -1 : x > y ? 1 : 0;\n });\n }\n }]);\n return Policy;\n}();\n\nexports.default = Policy;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2Z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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVhBO0FBYUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///519\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AdvancedCondition = __webpack_require__(521);\n\nvar _AdvancedCondition2 = _interopRequireDefault(_AdvancedCondition);\n\nvar _Condition = __webpack_require__(153);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Rule = function () {\n function Rule(decision, condition, scope, target, priority) {\n (0, _classCallCheck3.default)(this, Rule);\n\n this.decision = decision;\n this.setCondition(condition);\n this.priority = priority;\n this.scope = scope;\n this.target = target;\n }\n\n (0, _createClass3.default)(Rule, [{\n key: 'setCondition',\n value: function setCondition(condition) {\n if (!(condition instanceof _Condition2.default || condition instanceof _AdvancedCondition2.default || condition instanceof _AdvancedCondition2.default)) {\n var attribute = condition.attribute;\n switch (attribute) {\n case 'subscription':\n this.condition = new _AdvancedCondition2.default(condition.attribute, condition.operator, condition.params);\n break;\n case undefined:\n this.condition = new _AdvancedCondition2.default(condition);\n break;\n default:\n this.condition = new _Condition2.default(condition.attribute, condition.operator, condition.params);\n }\n } else {\n this.condition = condition;\n }\n }\n }, {\n key: 'evaluate',\n value: function evaluate(context, message, isIncoming) {\n var field = isIncoming ? message.to : message.from;\n var hypertyName = void 0;\n switch (this.scope) {\n case 'global':\n break;\n\n case 'hyperty':\n if ((0, _utils.isDataObjectURL)(field)) {\n var reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n if (reporter !== undefined) {\n hypertyName = context.runtimeRegistry.getHypertyName(reporter);\n }\n } else {\n if (field.split('://')[0] === 'hyperty') {\n hypertyName = context.runtimeRegistry.getHypertyName((0, _utils.removePathFromURL)(field));\n }\n }\n if (hypertyName === this.target) {\n break;\n }\n\n return 'Not Applicable';\n\n case 'identity':\n var owner = void 0;\n\n if ((0, _utils.isDataObjectURL)(field)) {\n var _reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n owner = context.runtimeRegistry.getHypertyOwner(_reporter);\n } else {\n if (field.split('://')[0] === 'hyperty') {\n owner = context.runtimeRegistry.getHypertyOwner((0, _utils.removePathFromURL)(field));\n }\n }\n if (owner !== undefined) {\n owner = (0, _utils.getUserEmailFromURL)(owner);\n }\n if (owner === this.target) {\n break;\n }\n\n return 'Not Applicable';\n }\n\n if (this.condition.isApplicable(context, message, this.scope, this.target)) {\n return this.decision;\n } else {\n return 'Not Applicable';\n }\n }\n }]);\n return Rule;\n}();\n\nexports.default = Rule;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUnVsZS5qc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IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldEh5cGVydHlOYW1lKHJlcG9ydGVyKTtcbiAgICAgICAgICB9XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgaWYgKGZpZWxkLnNwbGl0KCc6Ly8nKVswXSA9PT0gJ2h5cGVydHknKSB7XG4gICAgICAgICAgICBoeXBlcnR5TmFtZSA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldEh5cGVydHlOYW1lKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChoeXBlcnR5TmFtZSA9PT0gdGhpcy50YXJnZXQpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAnTm90IEFwcGxpY2FibGUnO1xuXG4gICAgICBjYXNlICdpZGVudGl0eSc6XG4gICAgICAgIGxldCBvd25lcjtcblxuICAgICAgICBpZiAoaXNEYXRhT2JqZWN0VVJMKGZpZWxkKSkge1xuICAgICAgICAgIGxldCByZXBvcnRlciA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldFJlcG9ydGVyVVJMU3luY2hvbm91cyhyZW1vdmVQYXRoRnJvbVVSTChmaWVsZCkpO1xuICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlcG9ydGVyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoZmllbGQuc3BsaXQoJzovLycpWzBdID09PSAnaHlwZXJ0eScpIHtcbiAgICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvd25lciAhPT0gdW5kZWZpbmVkKSB7XG4gICAgIC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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQXZDQTtBQUNBO0FBeUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///520\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Condition = __webpack_require__(153);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _Operators = __webpack_require__(152);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nvar _SubscriptionCondition = __webpack_require__(522);\n\nvar _SubscriptionCondition2 = _interopRequireDefault(_SubscriptionCondition);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AdvancedCondition = function () {\n function AdvancedCondition(condition) {\n (0, _classCallCheck3.default)(this, AdvancedCondition);\n\n this.operators = new _Operators2.default();\n if (condition.operators !== undefined) {\n condition = condition.condition;\n }\n condition = this.buildCondition(condition);\n this.condition = condition;\n }\n\n (0, _createClass3.default)(AdvancedCondition, [{\n key: 'buildCondition',\n value: function buildCondition(condition) {\n if (Array.isArray(condition[1])) {\n condition[1] = this.buildCondition(condition[1]);\n } else {\n if (condition[1].attribute === 'subscription') {\n condition[1] = new _SubscriptionCondition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n } else {\n condition[1] = new _Condition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n }\n }\n\n if (condition[2] !== undefined) {\n if (Array.isArray(condition[2])) {\n condition[2] = this.buildCondition(condition[2]);\n } else {\n if (condition[2].attribute === 'subscription') {\n condition[2] = new _SubscriptionCondition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n } else {\n condition[2] = new _Condition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n }\n }\n }\n return condition;\n }\n }, {\n key: 'isApplicable',\n value: function isApplicable(context, message, scope, target, operator, left, right) {\n if (!operator) {\n operator = this.condition[0];\n left = this.condition[1];\n right = this.condition[2];\n }\n\n while (!(left instanceof _Condition2.default) & !(left instanceof _SubscriptionCondition2.default) & typeof left !== 'boolean') {\n left = this.isApplicable(context, message, scope, target, left[0], left[1], left[2]);\n }\n if (right !== undefined) {\n while (!(right instanceof _Condition2.default) & !(right instanceof _SubscriptionCondition2.default) & typeof right !== 'boolean') {\n right = this.isApplicable(context, message, scope, target, right[0], right[1], right[2]);\n }\n }\n\n var resultLeft = typeof left === 'boolean' ? left : left.isApplicable(context, message, scope, target);\n var resultRight = void 0;\n if (right !== undefined) {\n resultRight = typeof right === 'boolean' ? right : right.isApplicable(context, message, scope, target);\n }\n return this.operators[operator]([resultLeft, resultRight]);\n }\n }]);\n return AdvancedCondition;\n}();\n\nexports.default = AdvancedCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9BZHZhbmNlZENvbmRpdGlvbi5qcz9iZDBmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb25kaXRpb24gZnJvbSAnLi9Db25kaXRpb24nO1xuaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuLi9PcGVyYXRvcnMnO1xuaW1wb3J0IFN1YnNjcmlwdGlvbkNvbmRpdGlvbiBmcm9tICcuL1N1YnNjcmlwdGlvbkNvbmRpdGlvbic7XG5cbmNsYXNzIEFkdmFuY2VkQ29uZGl0aW9uIHtcblxuICBjb25zdHJ1Y3Rvcihjb25kaXRpb24pIHtcb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TtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///521\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _Condition2 = __webpack_require__(153);\n\nvar _Condition3 = _interopRequireDefault(_Condition2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a subscription condition and evaluate its applicability.\n*/\nvar SubscriptionCondition = function (_Condition) {\n (0, _inherits3.default)(SubscriptionCondition, _Condition);\n\n /**\n * Creates a new SubscriptionCondition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function SubscriptionCondition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, SubscriptionCondition);\n return (0, _possibleConstructorReturn3.default)(this, (SubscriptionCondition.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition)).call(this, attribute, operator, params));\n }\n\n /**\n * Verifies if the subscription condition is applicable to the message. First, verifies if the message is of the subscription type; second, verifies if the message is from a remote runtime to guarantee that the subscription is being validated in the destination runtime; third, verifies if the subscription preference is met.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(SubscriptionCondition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n var isSubscription = message.type === 'subscribe';\n var isFromRemoteSM = context.isFromRemoteSM(message.from);\n if (isSubscription & isFromRemoteSM) {\n return (0, _get3.default)(SubscriptionCondition.prototype.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition.prototype), 'isApplicable', this).call(this, context, message);\n } else {\n return false;\n }\n }\n }]);\n return SubscriptionCondition;\n}(_Condition3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = SubscriptionCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9TdWJzY3JpcHRpb25Db25kaXRpb24uanM/YTkwMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjBcbipcbiogVW5sZXNzIHJlcXVpc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V4cG9ydCBkZWZhdWx0IFN1YnNjcmlwdGlvbkNvbmRpdGlvbjtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcG9saWN5L2NvbmRpdGlvbnMvU3Vic2NyaXB0aW9uQ29uZGl0aW9uLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7QUFDQTs7Ozs7QUFDQTs7OztBQUlBOzs7QUFFQTs7Ozs7OztBQU9BO0FBQUE7QUFBQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQkE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBOEJBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///522\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _Bus2 = __webpack_require__(211);\n\nvar _Bus3 = _interopRequireDefault(_Bus2);\n\nvar _Pipeline = __webpack_require__(524);\n\nvar _Pipeline2 = _interopRequireDefault(_Pipeline);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('MessageBus'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log system\n\n/**\n* @author micaelpedrosa@gmail.com\n* Message BUS Interface is an extension of the Bus\n* It doesn't support the default '*' listener, instead it uses the registry.resolve(..)\n*/\nvar MessageBus = function (_Bus) {\n (0, _inherits3.default)(MessageBus, _Bus);\n\n /* private\n _registry: Registry\n _forwards: { : { fl: MsgListener, sandboxToUrls: Map(Sandbox, [to-url]), urlToSandbox: { to-url: Sandbox } } }\n _pipeline: Pipeline\n */\n\n //TODO: future optimization\n //1. message batch processing with setInterval\n //2. resolve default gateway/protostub with register.resolve\n\n function MessageBus(registry) {\n (0, _classCallCheck3.default)(this, MessageBus);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (MessageBus.__proto__ || (0, _getPrototypeOf2.default)(MessageBus)).call(this));\n\n _this2._registry = registry;\n _this2._forwards = {};\n\n _this2._pipelineIn = new _Pipeline2.default(function (error) {\n log.error('PIPELINE-ERROR: ', (0, _stringify2.default)(error));\n });\n\n _this2._pipelineOut = new _Pipeline2.default(function (error) {\n log.error('PIPELINE-ERROR: ', (0, _stringify2.default)(error));\n });\n return _this2;\n }\n\n (0, _createClass3.default)(MessageBus, [{\n key: 'postMessage',\n\n\n /**\n * Post a message for routing. It will first search for a listener, if there is no one, it sends to a external routing using the _onPostMessage.\n * External routing use the registry.resolve(..) method to decide the destination sandbox.\n * @param {Message} inMsg JSON with mandatory Message structure {id, type, from, to}\n * @param {Callback} responseCallback Optional callback if a response is expected from the request. A response will be always sent, even if it is a \"Timeout\".\n * @return {number} the Message id\n */\n value: function postMessage(inMsg, responseCallback, timeout) {\n log.info('onPOSTMessage: ', inMsg);\n var _this = this;\n\n var deliver = function deliver(msg) {\n\n _this._responseCallback(inMsg, responseCallback, timeout);\n\n if (!_this._onResponse(msg)) {\n var itemList = _this._subscriptions[msg.to];\n if (itemList) {\n //do not publish on default address, because of loopback cycle\n _this._publishOn(itemList, msg);\n } else {\n //if there is no listener, send to external interface\n _this._onPostMessage(msg);\n }\n }\n };\n\n _this._genId(inMsg);\n\n if (_this._isToProcess(inMsg)) {\n var isIncoming = _this._isIncomingMessage(inMsg);\n\n if (isIncoming) _this._pipelineIn.process(inMsg, deliver);else _this._pipelineOut.process(inMsg, deliver);\n } else deliver(inMsg);\n\n return inMsg.id;\n }\n }, {\n key: '_isToProcess',\n value: function _isToProcess(message) {\n var schemasToIgnore = ['domain', 'domain-idp', 'global', 'hyperty-runtime', 'runtime'];\n var splitFrom = message.from.split('://');\n var fromSchema = splitFrom[0];\n var splitTo = message.to.split('://');\n var toSchema = splitTo[0];\n var from = message.from;\n var to = message.to;\n\n // Signalling messages between P2P Stubs don't have to be verified. FFS\n\n if (message.body && message.body.source) {\n from = message.body.source;\n }\n\n if (message.body && message.body.subscriber) {\n from = message.body.subscriber;\n }\n\n if (from.indexOf('/p2phandler/') !== -1 || from.indexOf('/p2prequester/') !== -1 || to.indexOf('/p2phandler/') !== -1 || to.indexOf('/p2prequester/') !== -1) {\n return false;\n }\n\n if (this._registry.isLocal(from) && this._registry.isLocal(message.to)) return false;\n\n if (message.from === fromSchema || message.to === toSchema || message.type === 'read' || message.type === 'response' || message.from.includes('hyperty://') && message.type === 'delete') {\n return false;\n } else {\n return schemasToIgnore.indexOf(fromSchema) === -1 || schemasToIgnore.indexOf(toSchema) === -1;\n }\n }\n }, {\n key: '_isIncomingMessage',\n value: function _isIncomingMessage(message) {\n var from = void 0;\n\n if (message.type === 'forward') {\n log.info('[MessageBus - isIncomingMessage] - message.type: ', message.type);\n from = message.body.from;\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('source') && message.body.source) {\n log.info('[MessageBus - isIncomingMessage] - message.body.source: ', message.body.source);\n from = message.body.source;\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('subscriber') && message.body.subscriber) {\n //TODO: this subscriber validation should not exist, because is outdated\n //TODO: the syncher and syncher manager not following the correct spec;\n log.info('[MessageBus - isIncomingMessage] - message.body.subscriber: ', message.body.subscriber);\n from = message.body.subscriber;\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('reporter') && message.body.reporter) {\n //TODO: this subscriber validation should not exist, because is outdated\n //TODO: the syncher and syncher manager not following the correct spec;\n log.info('[MessageBus - isIncomingMessage] - message.body.reporter: ', message.body.reporter);\n from = message.body.reporter;\n } else {\n log.info('[MessageBus - isIncomingMessage] - message.from ', message.from);\n from = message.from;\n }\n\n log.info('[MessageBus - isIncomingMessage] - check if isLocal: ', from);\n return !this._registry.isLocal(from);\n }\n\n /**\n * Adds an external publish address listener. Every message for the address will be forwarded to the external routing by _onPostMessage.\n * This means, even if there is a listener for the address, it will also send the message to the external routing.\n * @param {URL} from Publish address.\n */\n\n }, {\n key: 'addPublish',\n value: function addPublish(from) {\n var _this3 = this;\n\n var _this = this;\n\n //verify if forward exist\n var refCount = _this._forwards[from];\n if (!refCount) {\n var forwardListener = _this.addListener(from, function (msg) {\n log.info('MB-PUBLISH: ( ' + from + ' )');\n _this._onPostMessage(msg);\n });\n\n refCount = {\n counter: 0,\n fl: forwardListener,\n remove: function remove() {\n _this3.counter--;\n if (_this3.counter === 0) {\n _this3.fl.remove();\n delete _this._forwards[from];\n }\n }\n };\n\n _this._forwards[from] = refCount;\n }\n\n refCount.counter++;\n return refCount;\n }\n\n /**\n * Adds a forward listener for a message destination. Every message reaching an address will be also sent to the forward address.\n * @param {URL} from Message destination, it's actually the field \"to\" of the message.\n * @param {URL} to Forward address.\n */\n\n }, {\n key: 'addForward',\n value: function addForward(from, to) {\n var _this = this;\n\n return _this.addListener(from, function (msg) {\n log.info('MB-FORWARD: ( ' + from + ' to ' + to + ' )');\n _this.forward(to, msg);\n });\n }\n\n /**\n * Just forward's a message to the forward address. Listeners should be available for the forward address.\n * @param {URL} url Forward address.\n * @param {Message} msg Message to forward\n */\n\n }, {\n key: 'forward',\n value: function forward(url, msg) {\n var _this = this;\n\n var itemList = _this._subscriptions[url];\n if (itemList) {\n _this._publishOn(itemList, msg);\n }\n }\n\n //default route, if there are no listeners available for a message destination.\n\n }, {\n key: '_onPostMessage',\n value: function _onPostMessage(msg) {\n var _this = this;\n\n //resolve external protostub...\n _this._registry.resolve(msg).then(function (route, msg2route) {\n if (msg2route) _this.forward(route, msg2route);else _this.forward(route, msg);\n }).catch(function (e) {\n log.error('RESOLVE-ERROR: ', e);\n });\n }\n }, {\n key: 'pipelineIn',\n get: function get() {\n return this._pipelineIn;\n }\n }, {\n key: 'pipelineOut',\n get: function get() {\n return this._pipelineOut;\n }\n }]);\n return MessageBus;\n}(_Bus3.default);\n\nexports.default = MessageBus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIzLm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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFUQTtBQUNBO0FBV0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBckxBO0FBQUE7QUFBQTs7O0FBRUE7QUFBQTtBQUFBOzs7QUE1QkE7QUFDQTtBQWlOQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///523\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Pipeline');\n\n/**\n* @author micaelpedrosa@gmail.com\n* Sequencial processor of methods. Similar to how Sequential Promise's work, but better fit for message processing.\n* Normal use for this, is to intercept all messages with configured handlers, and act accordingly.\n*/\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\nvar Pipeline = function () {\n /* public\n handlers: ((PipeContext) => void)[]\n onFail: (error) => void\n */\n\n function Pipeline(_onFail) {\n (0, _classCallCheck3.default)(this, Pipeline);\n\n var _this = this;\n\n _this.handlers = [];\n _this.onFail = _onFail;\n }\n\n /**\n * Insert a message in the pipeline queue. All messages are wrapped with a PipeContext.\n * @param {Message} msg Message for the queue\n * @param {Callback} onDeliver When message is finished processing from all handlers, it will be delivered in this callback.\n */\n\n\n (0, _createClass3.default)(Pipeline, [{\n key: 'process',\n value: function process(msg, onDeliver) {\n var _this = this;\n\n if (_this.handlers.length > 0) {\n var iter = new Iterator(_this.handlers);\n iter.next(new PipeContext(_this, iter, msg, onDeliver));\n } else {\n onDeliver(msg);\n }\n }\n }]);\n return Pipeline;\n}();\n\n/**\n* @author micaelpedrosa@gmail.com\n* Wrapper around a message that adds actions that can be fired by any interceptor handler.\n* The Pipeline is asynchronous, so an handler should always call an action, the default one is \"next()\"\n*/\n\n\nvar PipeContext = function () {\n /* private\n _inStop: boolean\n _pipeline: Pipeline\n _iter: Iterator\n _msg: Message\n */\n\n function PipeContext(pipeline, iter, msg, onDeliver) {\n (0, _classCallCheck3.default)(this, PipeContext);\n\n var _this = this;\n\n _this._inStop = false;\n\n _this._pipeline = pipeline;\n _this._iter = iter;\n _this._msg = msg;\n _this._onDeliver = onDeliver;\n }\n\n (0, _createClass3.default)(PipeContext, [{\n key: 'next',\n\n\n /**\n * Proceed to the next interceptor handler, unless there was an error. If it's the last one, proceed to onDeliver handler.\n */\n value: function next() {\n var _this = this;\n\n if (!_this._inStop) {\n if (_this._iter.hasNext) {\n _this._iter.next(_this);\n } else {\n _this._onDeliver(_this._msg);\n }\n }\n }\n\n /**\n * Proceed directly to the onDeliver handler, unless there was an error.\n */\n\n }, {\n key: 'deliver',\n value: function deliver() {\n var _this = this;\n if (!_this._inStop) {\n _this._inStop = true;\n _this._onDeliver(_this._msg);\n }\n }\n\n /**\n * Mark the context with an error and proceed to the onFail handler.\n * @param {[type]} error [description]\n */\n\n }, {\n key: 'fail',\n value: function fail(error) {\n var _this = this;\n\n if (!_this._inStop) {\n _this._inStop = true;\n if (_this._pipeline.onFail) {\n _this._pipeline.onFail(error);\n }\n }\n }\n }, {\n key: 'pipeline',\n get: function get() {\n return this._pipeline;\n }\n }, {\n key: 'msg',\n get: function get() {\n return this._msg;\n },\n set: function set(inMsg) {\n this._msg = inMsg;\n }\n }]);\n return PipeContext;\n}();\n\nvar Iterator = function () {\n /* private\n _index: number\n _array: []\n */\n\n function Iterator(array) {\n (0, _classCallCheck3.default)(this, Iterator);\n\n this._index = -1;\n this._array = array;\n }\n\n (0, _createClass3.default)(Iterator, [{\n key: 'hasNext',\n get: function get() {\n return this._index < this._array.length - 1;\n }\n }, {\n key: 'next',\n get: function get() {\n this._index++;\n return this._array[this._index];\n }\n }]);\n return Iterator;\n}();\n\nexports.default = Pipeline;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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UFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBR0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///524\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utf = __webpack_require__(526);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('CryptoManager');\n\n/**\n* Class with the cryptographic functions for the authentication protocol\n*\n*/\n\nvar Crypto = function () {\n\n /**\n * Runtimefactory is passed in the costructor, because the nodeJS has a different crypto module\n * from the browser. RuntimeFactory provides a wrapper for the fuctions of nodeJS, so they can be\n * invoked browser like.\n */\n function Crypto(runtimeFactory) {\n (0, _classCallCheck3.default)(this, Crypto);\n\n var _this = this;\n typeof runtimeFactory.createWebcrypto === 'function' ? _this._crypto = runtimeFactory.createWebcrypto() : _this._crypto = crypto;\n }\n\n /**\n * Performs a RSA encryption\n * @param {ArrayBuffer} value the public key\n * @param {BufferSource} value data to be encryped\n * @return {Uint8Array} encrypted data\n */\n\n\n (0, _createClass3.default)(Crypto, [{\n key: 'encryptRSA',\n value: function encryptRSA(pubKey, data) {\n log.log('encryptRSA:pubKey', pubKey);\n log.log('encryptRSA:data', data);\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAencryptKey(new Uint8Array(pubKey)).then(function (publicKey) {\n\n _this._crypto.subtle.encrypt({\n name: 'RSA-OAEP'\n }, publicKey, //from generateKey or importKey above\n data //ArrayBuffer of data you want to encrypt\n ).then(function (encrypted) {\n //returns an ArrayBuffer containing the encrypted data\n // log.log('crypto-encryptRSA', new Uint8Array(encrypted));\n resolve(new Uint8Array(encrypted));\n }).catch(function (err) {\n // log.log('crypto-encryptRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA decryption\n * @param {ArrayBuffer} value the private key\n * @param {BufferSource} value data to be decrypted\n * @return {Uint8Array} decrypted data\n */\n\n }, {\n key: 'decryptRSA',\n value: function decryptRSA(privKey, data) {\n log.log('decryptRSA:privKey', privKey);\n log.log('decryptRSA:data', data);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAdecryptKey(privKey).then(function (privateKey) {\n\n _this._crypto.subtle.decrypt({\n name: 'RSA-OAEP'\n }, privateKey, //from generateKey or importKey above\n data //ArrayBuffer of the data\n ).then(function (decrypted) {\n\n var decryptedData = new Uint8Array(decrypted);\n\n // log.log('crypto-decryptRSA', decryptedData);\n resolve(decryptedData);\n }).catch(function (err) {\n // log.log('crypto-decryptRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA sign\n * @param {ArrayBuffer} value the private key\n * @param {BufferSource} value data to be signed\n * @return {Uint8Array} data signature\n */\n\n }, {\n key: 'signRSA',\n value: function signRSA(privKey, data) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAsignKey(privKey).then(function (privateKey) {\n\n _this._crypto.subtle.sign({\n name: 'RSASSA-PKCS1-v1_5'\n }, privateKey, //from generateKey or importKey above\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of data you want to sign\n ).then(function (signature) {\n //returns an ArrayBuffer containing the signature\n // log.log('crypto-signRSA', new Uint8Array(signature));\n resolve(new Uint8Array(signature));\n }).catch(function (err) {\n // log.log('crypto-signRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA signature verification\n * @param {ArrayBuffer} value the public key\n * @param {BufferSource} value data to be verified\n * @return {Boolean} result of the signature verification\n */\n\n }, {\n key: 'verifyRSA',\n value: function verifyRSA(pubKey, data, signature) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAverifyKey(pubKey).then(function (publicKey) {\n\n _this._crypto.subtle.verify({\n name: 'RSASSA-PKCS1-v1_5'\n }, publicKey, //from generateKey or importKey above\n signature, //ArrayBuffer of the signature\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of the data\n ).then(function (isvalid) {\n //returns a boolean on whether the signature is true or not\n // log.log('crypto-verifyRSA', isvalid);\n resolve(isvalid);\n }).catch(function (err) {\n // log.log('crypto-verifyRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA signature verification\n * @param {ArrayBuffer} value the public key\n * @param {BufferSource} value data to be verified\n * @return {Boolean} result of the signature verification\n */\n\n }, {\n key: 'encryptAES',\n value: function encryptAES(key, data, iv) {\n log.log('encryptAES:key', key);\n log.log('encryptAES:data', data);\n log.log('encryptAES:iv', iv);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importAESkey(key).then(function (aesKey) {\n\n _this._crypto.subtle.encrypt({\n name: 'AES-CBC',\n\n //Don't re-use initialization vectors!\n //Always generate a new iv every time your encrypt!\n iv: iv\n }, aesKey, //from generateKey or importKey above\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of data you want to encrypt\n ).then(function (encrypted) {\n //returns an ArrayBuffer containing the encrypted data\n // log.log('crypto-encryptAES', new Uint8Array(encrypted));\n resolve(new Uint8Array(encrypted));\n }).catch(function (err) {\n // log.log('crypto-encryptAES', err);\n reject(err);\n });\n });\n });\n }\n }, {\n key: 'decryptAES',\n value: function decryptAES(key, data, iv) {\n log.log('decryptAES:key', key);\n log.log('decryptAES:data', data);\n log.log('decryptAES:iv', iv);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importAESkey(key).then(function (aesKey) {\n\n _this._crypto.subtle.decrypt({\n name: 'AES-CBC',\n iv: iv\n }, aesKey, //from generateKey or importKey above\n data //ArrayBuffer of the data\n ).then(function (decrypted) {\n\n var decodedData = (0, _utf.decodeUTF8)(new Uint8Array(decrypted));\n log.log('crypto-decryptAES', decodedData);\n resolve(decodedData);\n }).catch(function (err) {\n // log.log('crypto-decryptAES', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * creates a hash using the HMAC algorithm\n * @param {byteArray} key key to be used in the hmac\n * @param {string} data information to be hashed\n * @return {byteArray} signature resulting hash\n */\n\n }, {\n key: 'hashHMAC',\n value: function hashHMAC(key, data) {\n log.log('hashHMAC:key', key);\n log.log('hashHMAC:data', data);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (typeof data != 'string') {\n data = (0, _stringify2.default)(data);\n log.log('Converting hashHMAC inpured DATA');\n log.log('HHashHMAC:', data);\n }\n\n _this._importHMACkey(key).then(function (hmacKey) {\n\n _this._crypto.subtle.sign({\n name: 'HMAC'\n }, hmacKey, //from generateKey or importKey above\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of data you want to sign\n ).then(function (signature) {\n log.log('HashHMAC signature:', new Uint8Array(signature));\n\n // log.log('crypto-hashHMAC', signature);\n //returns an ArrayBuffer containing the signature\n resolve(new Uint8Array(signature));\n }).catch(function (err) {\n // log.log('crypto-hashHMAC', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * verifies an hash using the HMAC algorithm\n * @param {byteArray} key key to be used in the hmac\n * @param {string} data information to be hashed to compare\n * @param {byteArray} signature hash to compare with the received data\n * @return {boolean} isvalid boolean saying if the data corresponds to the hash received\n */\n\n }, {\n key: 'verifyHMAC',\n value: function verifyHMAC(key, data, signature) {\n log.log('verifyHMAC:key', key);\n log.log('verifyHMAC:data', data);\n log.log('verifyHMAC:signature', signature);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._importHMACkey(key).then(function (hmacKey) {\n\n if (typeof data != 'string') {\n data = (0, _stringify2.default)(data);\n log.log('Converting verifyHMAC inputed DATA:', data);\n }\n\n _this._crypto.subtle.verify({\n name: 'HMAC'\n }, hmacKey, //from generateKey or importKey above\n signature, //ArrayBuffer of the signature\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of the data\n ).then(function (isvalid) {\n //returns a boolean on whether the signature is true or not\n // log.log('crypto-verifyHMAC', isvalid);\n log.log('verifyHMAC result', isvalid);\n isvalid ? resolve(isvalid) : reject(isvalid);\n }).catch(function (err) {\n log.error('crypto-verifyHMAC', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * generates a RSA public/private key pair with a modulus length of 2048 bits\n * @return {JSON} keyPair json containing the public and private keys\n */\n\n }, {\n key: 'generateRSAKeyPair',\n value: function generateRSAKeyPair() {\n var _this = this;\n var keyPair = {};\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.generateKey({\n name: 'RSA-PSS',\n modulusLength: 2048, //can be 1024, 2048, or 4096\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['sign', 'verify'] //can be any combination of 'sign' and 'verify'\n\n ).then(function (key) {\n //returns a keypair object\n // log.log(key);\n\n _this._crypto.subtle.exportKey('spki', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n key.publicKey //can be a publicKey or privateKey, as long as extractable was true\n ).then(function (publicKey) {\n //returns the exported key data\n keyPair.public = new Uint8Array(publicKey);\n return _this._crypto.subtle.exportKey('pkcs8', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n key.privateKey //can be a publicKey or privateKey, as long as extractable was true\n );\n }).then(function (privateKey) {\n keyPair.private = new Uint8Array(privateKey);\n\n // log.log('crypto-generateRSAKeyPair', keyPair);\n resolve(keyPair);\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n });\n }\n\n /**\n * Generates a 128 bit random value.\n * @return {byteArray} array random value\n */\n\n }, {\n key: 'generateIV',\n value: function generateIV() {\n var _this = this;\n\n var array = new Uint8Array(16);\n _this._crypto.getRandomValues(array);\n\n return array;\n }\n\n /**\n * Generates a 256 bit random value. 32 bits are extrated from the machine time,\n * the remaining are generated randomly\n * @return {byteArray} array random value\n */\n\n }, {\n key: 'generateRandom',\n value: function generateRandom() {\n var _this = this;\n\n var array = new Uint8Array(32);\n _this._crypto.getRandomValues(array);\n\n var date = Date.now();\n\n var dateEncoded = (0, _utf.encodeUTF8)(date.toString());\n\n //extract the least significant 4 bytes in the date\n var finalDate = dateEncoded.slice(dateEncoded.length - 4, dateEncoded.length);\n\n // add in the first 4 bytes of the array the bytes extracted previously;\n for (var i = 0; i < 4; i++) {\n array[i] = finalDate[i];\n }\n return array;\n }\n\n /**\n * generates a premaster secret (PMS) of 48 bytes (384 bits) randomly\n * @return {byteArray} array premaster secret key\n */\n\n }, {\n key: 'generatePMS',\n value: function generatePMS() {\n var _this = this;\n\n var array = new Uint8Array(48);\n _this._crypto.getRandomValues(array);\n return array;\n }\n\n /**\n * generates a masterKey secret (PMS) of 48 bytes (384 bits) using the premaster secret and\n * two randoms\n * @return {byteArray} array master secret key with 48 bytes\n */\n\n }, {\n key: 'generateMasterSecret',\n value: function generateMasterSecret(hmacKey, data) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var key = new Uint8Array(48);\n var seed = data;\n\n _this._digest(hmacKey).then(function (digestedKey) {\n\n _this.hashHMAC(digestedKey, seed).then(function (keypart0) {\n\n //copy the first 32 bytes into the key\n for (var i = 0; i < 32; i++) {\n key[i] = keypart0[i];\n }\n return _this.hashHMAC(digestedKey, seed + keypart0);\n }).then(function (keypart1) {\n\n //copy the first 16 bytes to the key remaining 16 bytes\n for (var i = 0; i < 16; i++) {\n key[i + 32] = keypart1[i];\n }\n\n // log.log('crypto-generateMasterSecret', key);\n resolve(key);\n }).catch(function (err) {\n // log.log('crypto-generateMasterSecret', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * generates both users MAC and encryption keys. generate as output an array\n * with 4 byteArray each with 32 bytes\n * @param {byteArray} secret secret to be used in the HMAC function\n * @param {String} data information to be used as seed\n * @return {Array} key array with the information to generate keys\n */\n\n }, {\n key: 'generateKeys',\n value: function generateKeys(hmacKey, data) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var key = [];\n var seed = data;\n\n // iterate 4 times to obtain a 1024 key size\n _this.hashHMAC(hmacKey, seed).then(function (keypart0) {\n key.push(keypart0);\n return _this.hashHMAC(hmacKey, seed + keypart0);\n }).then(function (keypart1) {\n key.push(keypart1);\n return _this.hashHMAC(hmacKey, seed + keypart1);\n }).then(function (keypart2) {\n key.push(keypart2);\n return _this.hashHMAC(hmacKey, seed + keypart2);\n }).then(function (keypart3) {\n key.push(keypart3);\n\n // log.log('crypto-generateKeys', key);\n resolve(key);\n }).catch(function (err) {\n // log.log('crypto-generateKeys', err);\n reject(err);\n });\n\n // log.log(hmacKey, data);\n });\n }\n }, {\n key: '_importRSAsignKey',\n value: function _importRSAsignKey(privKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('pkcs8', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n privKey, { //these are the algorithm options\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['sign'] //'verify' for public key import, 'sign' for private key imports\n ).then(function (privateKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAsignKey', privateKey);\n resolve(privateKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAsignKey', err);\n reject(err);\n });\n });\n }\n }, {\n key: '_importRSAverifyKey',\n value: function _importRSAverifyKey(pubKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('spki', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n pubKey, { //these are the algorithm options\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['verify'] //'verify' for public key import, 'sign' for private key imports\n ).then(function (publicKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAverifyKey', publicKey);\n resolve(publicKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAverifyKey', err);\n reject(err);\n });\n });\n }\n }, {\n key: '_importRSAencryptKey',\n value: function _importRSAencryptKey(pubKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('spki', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n pubKey, { //these are the algorithm options\n name: 'RSA-OAEP',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['encrypt'] //'encrypt' or 'wrapKey' for public key import or\n //'decrypt' or 'unwrapKey' for private key imports\n ).then(function (publicKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAencryptKey', publicKey);\n resolve(publicKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAencryptKey', err.name);\n reject(err);\n });\n });\n }\n }, {\n key: '_importRSAdecryptKey',\n value: function _importRSAdecryptKey(privKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('pkcs8', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n privKey, { //these are the algorithm options\n name: 'RSA-OAEP',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['decrypt'] //'encrypt' or 'wrapKey' for public key import or\n //'decrypt' or 'unwrapKey' for private key imports\n ).then(function (privateKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAdecryptKey', privateKey);\n resolve(privateKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAdecryptKey', err);\n reject(err);\n });\n });\n }\n }, {\n key: 'concatPMSwithRandoms',\n value: function concatPMSwithRandoms(pms, toRandom, fromRandom) {\n\n var finalKey = new Uint8Array(pms.length + toRandom.length + fromRandom.length);\n\n // add PremasterKey\n for (var i = 0; i < pms.length; i++) {\n finalKey[i] = pms[i];\n }\n\n //add to random\n for (var _i = 0; _i < toRandom.length; _i++) {\n finalKey[_i + pms.length] = pms[_i];\n }\n\n //add from random\n for (var _i2 = 0; _i2 < fromRandom.length; _i2++) {\n finalKey[_i2 + pms.length + toRandom.length] = pms[_i2];\n }\n\n return finalKey;\n }\n }, {\n key: '_generate256bitKey',\n value: function _generate256bitKey() {\n var _this = this;\n var array = new Uint8Array(32);\n _this._crypto.getRandomValues(array);\n\n return array;\n }\n\n /**\n * imports the secret to the HMAC function\n * @param {byteArray} arrayBuffer bytes to import as key\n * @return {JSON} key key ready to be used in the HMAC cryptographic function\n */\n\n }, {\n key: '_importHMACkey',\n value: function _importHMACkey(arrayBuffer) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._digest(arrayBuffer).then(function (key) {\n\n _this._crypto.subtle.importKey('raw', //can be 'jwk' or 'raw'\n key, { //this is the algorithm options\n name: 'HMAC',\n hash: { name: 'SHA-256' }, //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n length: 256 //optional, if you want your key length to differ from the hash function's block length\n }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['sign', 'verify'] //can be any combination of 'sign' and 'verify'\n ).then(function (key) {\n //returns the symmetric key\n // log.log('crypto-_importHMACkey', key);\n resolve(key);\n }).catch(function (err) {\n reject(err);\n });\n });\n });\n }\n }, {\n key: '_digest',\n value: function _digest(value) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.digest({\n name: 'SHA-256'\n }, value //The data you want to hash as an ArrayBuffer\n ).then(function (hash) {\n //returns the hash as an ArrayBuffer\n // log.log('crypto-digest', new Uint8Array(hash));\n resolve(new Uint8Array(hash));\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n });\n }\n }, {\n key: '_importAESkey',\n value: function _importAESkey(arrayBuffer) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('raw', //can be 'jwk' or 'raw'\n arrayBuffer, { //this is the algorithm options\n name: 'AES-CBC'\n }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['encrypt', 'decrypt'] //can be 'encrypt', 'decrypt', 'wrapKey', or 'unwrapKey'\n ).then(function (key) {\n //returns the symmetric key\n // log.log('crypto-importAESkey', key);\n resolve(key);\n }).catch(function (err) {\n log.error('crypto-importAESkey', err);\n reject(err);\n });\n });\n }\n }, {\n key: '_sha256',\n value: function _sha256(str) {\n var _this = this;\n var buffer = new TextEncoder('utf-8').encode(str);\n return _this._crypto.subtle.digest('SHA-256', buffer).then(function (hash) {\n return _this._hex(hash);\n });\n }\n }, {\n key: '_hex',\n value: function _hex(buffer) {\n var hexCodes = [];\n var view = new DataView(buffer);\n for (var i = 0; i < view.byteLength; i += 4) {\n // Using getUint32 reduces the number of iterations needed (we process 4 bytes each time)\n var value = view.getUint32(i);\n\n var stringValue = value.toString(16);\n\n var padding = '00000000';\n var paddedValue = (padding + stringValue).slice(-padding.length);\n hexCodes.push(paddedValue);\n }\n\n // Join all the hex strings into one\n return hexCodes.join('');\n }\n }]);\n return Crypto;\n}();\n\nexports.default = Crypto;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jcnlwdG9NYW5hZ2VyL0NyeXB0by5qcz9hZTY2Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZW5jb2RlVVRGOCwgZGVjb2RlVVRGOH0gZnJvbSAnLi91dGY4LmpzJztcbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignQ3J5cHRvTWFuYWdlcicpO1xuXG4vKipcbiogQ2xhc3Mgd2l0aCB0aGUgY3J5cHRvZ3JhcGhpYyBmdW5jdGlvbnMgZm9yIHRoZSBhdXRoZW50aWNhdGlvbiBwcm90b2NvbFxuKlxuKi9cbmNsYXNzIENyeXB0byB7XG5cbi8qKlxuKiBSdW50aW1lZmFjdG9yeSBpcyBwYXNzZWQgaW4gdGhlIGNvc3RydWN0b3IsIGJlY2F1c2UgdGhlIG5vZGVKUyBoYXMgYSBkaWZmZXJlbnQgY3J5cHRvIG1vZHVsZVxuKiBmcm9tIHRoZSBicm93c2VyLiBSdW50aW1lRmFjdG9yeSBwcm92aWRlcyBhIHdyYXBwZXIgZm9yIHRoZSBmdWN0aW9ucyBvZiBub2RlSlMsIHNvIHRoZXkgY2FuIGJlXG4qIGludm9rZWQgYnJvd3NlciBsaWtlLlxuKi9cbiAgY29uc3RydWN0b3IocnVudGltZUZhY3RvcnkpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuICAgIHR5cGVvZiBydW50aW1lRmFjdG9yeS5jcmVhdGVXZWJjcnlwdG8gPT09ICdmdW5jdGlvbicgPyBfdGhpcy5fY3J5cHRvID0gcnVudGltZUZhY3RvcnkuY3JlYX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IHtcbiAgICAgICAgICAgIG5hbWU6ICdBRVMtQ0JDJyxcbiAgICAgICAgICAgIGl2OiBpdlxuICAgICAgICAgIH0sXG4gICAgICAgICAgYWVzS2V5LCAvL2Zyb20gZ2VuZXJhdGVLZXkgb3IgaW1wb3J0S2V5IGFib3ZlXG4gICAgICAgICAgZGF0YSAvL0FycmF5QnVmZmVyIG9mIHRoZSBkYXRhXG4gICAgICAgIClcbiAgICAgICAgICAudGhlbihmdW5jdGlvbihkZWNyeXB0ZWQpIHtcblxuICAgICAgICAgICAgbGV0IGRlY29kZWREYXRhID0gZGVjb2RlVVRGOChuZXcgVWludDhBcnJheShkZWNyeXB0ZWQpKTtcbiAgICAgICAgICAgIGxvZy5sb2coJ2NyeXB0by1kZWNyeXB0QUVTJywgZGVjb2RlZERhdGEpO1xuICAgICAgICAgICAgcmVzb2x2ZShkZWNvZGVkRGF0YSk7XG5cbiAgICAgICAgICB9KS5jYXRjaChmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAvLyBsb2cubG9nKCdjcnlwdG8tZGVjcnlwdEFFUycsIGVycik7XG4gICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgfSk7XG5cbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAqIGNyZWF0ZXMgYSBoYXNoIHVzaW5nIHRoZSBITUFDIGFsZ29yaXRobVxuICAqIEBwYXJhbSAge2J5dGVBcnJheX0gICAga2V5ICAgICAgIGtleSB0byBiZSB1c2VkIGluIHRoZSBobWFjXG4gICogQHBhcmFtICB7c3RyaW5nfSAgICAgIGRhdGEgICAgICAgaW5mb3JtYXRpb24gdG8gYmUgaGFzaGVkXG4gICogQHJldHVybiAge2J5dGVBcnJheX0gICBzaWduYXR1cmUgIHJlc3VsdGluZyBoYXNoXG4gICovXG4gIGhhc2hITUFDKGtleSwgZGF0YSkge1xuICAgIGxvZy5sb2coJ2hhc2hITUFDOmtleScsIGtleSk7XG4gICAgbG9nLmxv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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUhBO0FBTUE7QUFUQTtBQVdBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBREE7QUFEQTtBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBREE7QUFJQTtBQVBBO0FBVUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFLQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///525\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports.encodeUTF8 = encodeUTF8;\nexports.decodeUTF8 = decodeUTF8;\n// Marshals a string to Uint8Array.\nfunction encodeUTF8(s) {\n\tvar i = 0;\n\tvar bytes = new Uint8Array(s.length * 4);\n\tfor (var ci = 0; ci != s.length; ci++) {\n\t\ttry {\n\t\t\tvar xxx = s.charCodeAt(ci);\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t\treturn;\n\t\t}\n\t\tvar c = s.charCodeAt(ci);\n\t\tif (c < 128) {\n\t\t\tbytes[i++] = c;\n\t\t\tcontinue;\n\t\t}\n\t\tif (c < 2048) {\n\t\t\tbytes[i++] = c >> 6 | 192;\n\t\t} else {\n\t\t\tif (c > 0xd7ff && c < 0xdc00) {\n\t\t\t\tif (++ci == s.length) throw 'UTF-8 encode: incomplete surrogate pair';\n\t\t\t\tvar c2 = s.charCodeAt(ci);\n\t\t\t\tif (c2 < 0xdc00 || c2 > 0xdfff) throw 'UTF-8 encode: second char code 0x' + c2.toString(16) + ' at index ' + ci + ' in surrogate pair out of range';\n\t\t\t\tc = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n\t\t\t\tbytes[i++] = c >> 18 | 240;\n\t\t\t\tbytes[i++] = c >> 12 & 63 | 128;\n\t\t\t} else {\n\t\t\t\t// c <= 0xffff\n\t\t\t\tbytes[i++] = c >> 12 | 224;\n\t\t\t}\n\t\t\tbytes[i++] = c >> 6 & 63 | 128;\n\t\t}\n\t\tbytes[i++] = c & 63 | 128;\n\t}\n\treturn bytes.subarray(0, i);\n}\n\n// Unmarshals an Uint8Array to string.\nfunction decodeUTF8(bytes) {\n\tvar s = '';\n\tvar i = 0;\n\twhile (i < bytes.length) {\n\t\tvar c = bytes[i++];\n\t\tif (c > 127) {\n\t\t\tif (c > 191 && c < 224) {\n\t\t\t\tif (i >= bytes.length) throw 'UTF-8 decode: incomplete 2-byte sequence';\n\t\t\t\tc = (c & 31) << 6 | bytes[i] & 63;\n\t\t\t} else if (c > 223 && c < 240) {\n\t\t\t\tif (i + 1 >= bytes.length) throw 'UTF-8 decode: incomplete 3-byte sequence';\n\t\t\t\tc = (c & 15) << 12 | (bytes[i] & 63) << 6 | bytes[++i] & 63;\n\t\t\t} else if (c > 239 && c < 248) {\n\t\t\t\tif (i + 2 >= bytes.length) throw 'UTF-8 decode: incomplete 4-byte sequence';\n\t\t\t\tc = (c & 7) << 18 | (bytes[i] & 63) << 12 | (bytes[++i] & 63) << 6 | bytes[++i] & 63;\n\t\t\t} else throw 'UTF-8 decode: unknown multibyte start 0x' + c.toString(16) + ' at index ' + (i - 1);\n\t\t\t++i;\n\t\t}\n\n\t\tif (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\n\t\t\tc -= 0x10000;\n\t\t\ts += String.fromCharCode(c >> 10 | 0xd800);\n\t\t\ts += String.fromCharCode(c & 0x3FF | 0xdc00);\n\t\t} else throw 'UTF-8 decode: code point 0x' + c.toString(16) + ' exceeds UTF-16 reach';\n\t}\n\treturn s;\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jcnlwdG9NYW5hZ2VyL3V0ZjguanM/M2IxOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBNYXJzaGFscyBhIHN0cmluZyB0byBVaW50OEFycmF5LlxuZXhwb3J0IGZ1bmN0aW9uIGVuY29kZVVURjgocykge1xuXHR2YXIgaSA9IDA7XG5cdHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KHMubGVuZ3RoICogNCk7XG5cdGZvciAodmFyIGNpID0gMDsgY2kgIT0gcy5sZW5ndGg7IGNpKyspIHtcbiAgICB0cnl7XG4gICAgICB2YXIgeHh4ID0gcy5jaGFyQ29kZUF0KGNpKTtcbiAgICB9IGNhdGNoIChlcnIpe1xuICAgICAgY29uc29sZS5sb2coZXJyLm1lc3NhZ2UpO1xuICAgICAgcmV0dXJuO1xuXG4gICAgfVxuXHRcdHZhciBjID0gcy5jaGFyQ29kZUF0KGNpKTtcblx0XHRpZiAoYyA8IDEyOCkge1xuXHRcdFx0Ynl0ZXNbaSsrXSA9IGM7XG5cdFx0XHRjb250aW51ZTtcblx0XHR9XG5cdFx0aWYgKGMg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n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('loader'); // Log System\n\nvar Loader = function () {\n function Loader(runtimeURL, runtimeConfiguration, runtimeDescriptorsInstance) {\n (0, _classCallCheck3.default)(this, Loader);\n\n if (!runtimeConfiguration) throw Error('[Runtime.Loader] The descriptor need to know the runtime configuration');\n if (!runtimeDescriptorsInstance) throw Error('[Runtime.Loader] The descriptor need to know the runtime Descriptor instance');\n\n this.log = log;\n\n this.runtimeConfiguration = runtimeConfiguration;\n this.descriptors = runtimeDescriptorsInstance;\n }\n\n /**\n * Set runtime url\n * @param {string} value runtimeURL\n */\n\n\n (0, _createClass3.default)(Loader, [{\n key: 'loadHyperty',\n\n\n /**\n * Deploy Hyperty from Catalogue URL\n *\n * @see https://github.com/reTHINK-project/specs/tree/master/datamodel/core/address\n *\n * @param {URL.HypertyCatalogueURL} hypertyCatalogueURL - The Catalogue URL used to identify descriptors in the Catalogue.\n * @param {boolean|URL.HypertyURL} [reuseURL=false] reuseURL - reuseURL is used to reuse the hypertyURL previously registred, by default the reuse is disabled;\n * @param {URL} appURL - the app url origin address;\n * @param {object} IdpConstraint - constraints to be used when selecting the identity to be associated with the Hyperty including origin, idp, and idHint.\n * @returns {Promise} this is Promise and returns true if all components are loaded with success or an error if someone fails.\n *\n * @memberOf Loader\n */\n value: function loadHyperty(hypertyCatalogueURL) {\n var reuseURL = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var _this = this;\n\n var IdpConstraint = arguments[2];\n var appURL = arguments[3];\n\n\n if (!this._readyToUse()) return false;\n if (!hypertyCatalogueURL) throw new Error('[Runtime.Loader] Hyperty descriptor url parameter is needed');\n\n return new _promise2.default(function (resolve, reject) {\n\n var _hypertyURL = void 0;\n var _hypertySandbox = void 0;\n var _hypertyDescriptor = void 0;\n var _hypertySourcePackage = void 0;\n var haveError = false;\n\n var errorReason = function errorReason(reason) {\n log.info('[Runtime.Loader] Something failed on the deploy hyperty: ', reason);\n reject(reason);\n };\n\n var handleError = function handleError(reason) {\n haveError = true;\n reject(reason);\n };\n\n // Get Hyperty descriptor\n // TODO: the request Module should be changed,\n // because at this moment it is incompatible with nodejs;\n // Probably we need to pass a factory like we do for sandboxes;\n log.info('[Runtime.Loader] ------------------ Hyperty ------------------------');\n log.info('[Runtime.Loader] Get hyperty descriptor for :', hypertyCatalogueURL);\n return _this.descriptors.getHypertyDescriptor(hypertyCatalogueURL).then(function (hypertyDescriptor) {\n // at this point, we have completed \"step 2 and 3\" as shown in https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md\n log.info('[Runtime.Loader] 1: return hyperty descriptor');\n\n // hyperty contains the full path of the catalogue URL, e.g.\n // catalogue.rethink.eu/.well-known/..........\n _hypertyDescriptor = hypertyDescriptor;\n\n var sourcePackageURL = hypertyDescriptor.sourcePackageURL;\n\n if (sourcePackageURL === '/sourcePackage') {\n return hypertyDescriptor.sourcePackage;\n }\n\n // Get the hyperty source code\n return _this.runtimeCatalogue.getSourcePackageFromURL(sourcePackageURL);\n }, handleError).then(function (sourcePackage) {\n if (haveError) return false;\n\n log.info('[Runtime.Loader] 2: return hyperty source code');\n\n // at this point, we have completed \"step 4 and 5\" as shown in https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md\n\n _hypertySourcePackage = sourcePackage;\n\n //\n // steps 6 -- 9 are skipped.\n // TODO: on release of core 0.2;\n // TODO: Promise to check the policy engine\n\n // mock-up code;\n // temporary code, only\n var policy = true;\n\n return policy;\n }, handleError).then(function (policyResult) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 3: return policy engine result' + policyResult);\n\n // we have completed step 6 to 9 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n //\n // Steps 6 -- 9\n // As a result of the sipped steps, we know at this point if we execute\n // inSameSandbox or not.\n //\n\n // For testing, just assume we execute in same Sandbox.\n var inSameSandbox = true;\n var sandbox = void 0;\n\n if (inSameSandbox) {\n\n // this don't need be a Promise;\n sandbox = _this.registry.getAppSandbox();\n\n // we have completed step 11 here.\n } else {\n\n var domain = (0, _utils.divideURL)(hypertyCatalogueURL).domain;\n\n // getSandbox, this will return a promise;\n sandbox = _this.registry.getSandbox(domain);\n }\n\n // this will return the sandbox or one promise to getSandbox;\n return sandbox;\n }, handleError).then(function (sandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 4: return the sandbox', sandbox);\n\n // Return the sandbox indepentely if it running in the same sandbox or not\n // we have completed step 14 here.\n return sandbox;\n }, function (reason) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 4.1: Try to register a new sandbox');\n\n // check if the sandbox is registed for this hyperty descriptor url;\n // Make Steps xxx --- xxx\n // Instantiate the Sandbox\n\n var hypertyCapabilities = {};\n if (_hypertyDescriptor && _hypertyDescriptor.hasOwnProperty('capabilities')) {\n hypertyCapabilities = _hypertyDescriptor.stubCapabilities;\n }\n\n return _this._runtimeFactory.createSandbox(hypertyCapabilities).then(function (sandbox) {\n\n sandbox.addListener('*', function (msg) {\n _this.messageBus.postMessage(msg);\n });\n\n return sandbox;\n });\n }, handleError).then(function (sandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 5: return sandbox and register');\n\n _hypertySandbox = sandbox;\n\n var numberOfAddresses = 1;\n //debugger;\n return _this._addressAllocation.create(_this._registry._domain, numberOfAddresses, _hypertyDescriptor, 'hyperty', reuseURL);\n }, handleError).then(function (addresses) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 6: return the addresses for the hyperty', addresses);\n\n // Register hyperty\n return _this.registry.registerHyperty(_hypertySandbox, hypertyCatalogueURL, _hypertyDescriptor, addresses, IdpConstraint);\n }, handleError).then(function (registrationResult) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 7: registration result', registrationResult);\n\n // we have completed step 16 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n _hypertyURL = registrationResult.url;\n\n // Extend original hyperty configuration;\n var configuration = {};\n if (!(0, _utils.emptyObject)(_hypertyDescriptor.configuration)) {\n try {\n configuration = (0, _assign2.default)({}, JSON.parse(_hypertyDescriptor.configuration));\n } catch (e) {\n configuration = _hypertyDescriptor.configuration;\n }\n }\n configuration.runtimeURL = _this._runtimeURL;\n\n if (registrationResult.p2pHandler) {\n configuration.p2pHandler = registrationResult.p2pHandler;\n configuration.p2pRequester = registrationResult.p2pRequester;\n }\n\n // We will deploy the component - step 17 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n\n try {\n return _hypertySandbox.deployComponent(_hypertySourcePackage.sourceCode, _hypertyURL, configuration);\n } catch (e) {\n log.info('[Runtime.Loader] Error on deploy component:', e);\n reject(e);\n }\n }, handleError).then(function (deployComponentStatus) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 8: Deploy component status for hyperty: ', deployComponentStatus);\n\n // we have completed step 19 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n\n // Add the message bus listener to the appSandbox or hypertSandbox;\n _this.messageBus.addListener(_hypertyURL, function (msg) {\n _hypertySandbox.postMessage(msg);\n });\n\n // Add the message bus listener to the appSandbox or hypertSandbox;\n _this.messageBus.addListener(_this.runtimeURL + '/status', function (msg) {\n _hypertySandbox.postMessage(msg);\n });\n\n // we have completed step 20 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n var hyperty = {\n runtimeHypertyURL: _hypertyURL,\n status: deployComponentStatus\n };\n\n log.info('[Runtime.Loader] Hyperty: ', hyperty);\n resolve(hyperty);\n\n // we have completed step 21 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n log.info('[Runtime.Loader] ------------------ END ------------------------');\n }, handleError).catch(errorReason);\n });\n }\n\n /**\n * Deploy Stub from Catalogue URL or domain url\n * @param {URL.URL} protostubURL Catalogue URL for the ProtoStub to be loaded or the domain to be target by the protostub\n * @param {Object} p2pConfig configuration of p2p\n */\n\n }, {\n key: 'loadStub',\n value: function loadStub(protostubURL, p2pConfig) {\n var _this2 = this;\n\n if (!this._readyToUse()) return false;\n if (!protostubURL) throw new Error('[Runtime.Loader.loadStub]ProtoStub descriptor url parameter is needed');\n\n return new _promise2.default(function (resolve, reject) {\n\n // to analyse if domain for p2pHandlers should be something else and not the default domain itself\n\n var domain = (0, _utils.divideURL)(protostubURL).domain;\n\n if (!domain) {\n domain = protostubURL;\n }\n\n var _stubSandbox = void 0;\n var _stubDescriptor = void 0;\n var _runtimeProtoStubURL = void 0;\n var _stubSourcePackage = void 0;\n var haveError = false;\n var stubId = void 0;\n\n var errorReason = function errorReason(reason) {\n log.info('[Runtime.Loader.loadStub]Something failed on the deploy of protocolstub: ', reason);\n reject(reason);\n };\n\n var handleError = function handleError(reason) {\n haveError = true;\n reject(reason);\n };\n\n // Discover Protocol Stub\n var discoverStub = void 0;\n var isP2PHandler = false;\n var isP2PRequester = false;\n var stubCapabilities = {};\n\n log.info('[Runtime.Loader.loadStub] starting loading for ', protostubURL, ' with p2pconfig ', p2pConfig);\n log.info('[Runtime.Loader.loadStub]Discover or Create a new ProtoStub for domain: ', domain);\n\n // step 2 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n try {\n if (p2pConfig) {\n\n if (p2pConfig.hasOwnProperty('isHandlerStub') && p2pConfig.isHandlerStub) {\n // step 6 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n isP2PHandler = true;\n stubId = _this2.runtimeURL;\n discoverStub = _this2.registry.discoverP2PStub();\n } else {\n isP2PRequester = true;\n var p2pHandlerRuntimeURL = p2pConfig.remoteRuntimeURL;\n stubId = p2pHandlerRuntimeURL;\n\n // step 4 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // step 5 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n discoverStub = _this2.registry.discoverP2PStub(p2pHandlerRuntimeURL);\n }\n } else {\n // step 3 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n stubId = domain;\n discoverStub = _this2.registry.discoverProtostub(domain);\n }\n\n // Is registed?\n log.info('[Runtime.Loader.loadStub]1. Proto Stub Discovered for ', protostubURL, ': ', discoverStub);\n\n // step 23 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n resolve(discoverStub);\n log.info(' [Runtime.Loader]------------------- END ---------------------------\\n');\n } catch (reason) {\n\n // is not registed?\n log.info('[Runtime.Loader.loadStub]1. Proto Stub not found ' + reason);\n\n // step 8 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _this2.descriptors.getStubDescriptor(protostubURL).then(function (stubDescriptor) {\n\n if (haveError) return false;\n log.info('[Runtime.Loader.loadStub]2. return the ProtoStub descriptor');\n\n // step 9 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _stubDescriptor = stubDescriptor;\n\n var sourcePackageURL = stubDescriptor.sourcePackageURL;\n\n if (sourcePackageURL === '/sourcePackage') {\n return stubDescriptor.sourcePackage;\n }\n\n // step 10 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2.runtimeCatalogue.getSourcePackageFromURL(sourcePackageURL);\n }, handleError).catch(errorReason).then(function (stubSourcePackage) {\n if (haveError) return false;\n\n // According to debug, it seems RuntimeCatalogue does not support yet constraints. It appears empty!!!!\n\n if (_stubDescriptor && _stubDescriptor.constraints) {\n stubCapabilities = _stubDescriptor.constraints;\n }\n\n // step 11 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]3. return the ProtoStub Source Code');\n _stubSourcePackage = stubSourcePackage;\n\n // this will return the sandbox or one promise to getSandbox;\n // step 12 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2.registry.getSandbox(domain, stubCapabilities);\n }).then(function (stubSandbox) {\n if (haveError) return false;\n\n // step 15 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]4. if the sandbox is registered then return the sandbox ', stubSandbox);\n\n _stubSandbox = stubSandbox;\n return stubSandbox;\n }).catch(function (reason) {\n if (haveError) return false;\n\n // step 13 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]5. Sandbox was not found, creating a new one ', reason);\n\n // check if the sandbox is registed for this stub descriptor url;\n\n\n // step 14 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2._runtimeFactory.createSandbox(stubCapabilities).then(function (sandbox) {\n sandbox.addListener('*', function (msg) {\n _this2.messageBus.postMessage(msg);\n });\n\n return sandbox;\n });\n }).then(function (sandbox) {\n if (haveError) return false;\n\n // step 16 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]6. return the sandbox instance and register', sandbox, 'to domain ', domain);\n\n _stubSandbox = sandbox;\n\n // we need register stub on registry - step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2.registry.registerStub(_stubSandbox, stubId, p2pConfig, protostubURL, _stubDescriptor);\n }, handleError).then(function (runtimeProtoStub) {\n if (haveError) return false;\n\n // step 23 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub] 7. return the runtime protostub url: ', runtimeProtoStub);\n\n _runtimeProtoStubURL = runtimeProtoStub.url;\n\n // Extend original hyperty configuration;\n var configuration = {};\n if (!(0, _utils.emptyObject)(_stubDescriptor.configuration)) {\n try {\n configuration = (0, _assign2.default)({}, JSON.parse(_stubDescriptor.configuration));\n } catch (e) {\n configuration = _stubDescriptor.configuration;\n }\n }\n\n if (p2pConfig) {\n try {\n configuration = (0, _assign2.default)(configuration, JSON.parse(p2pConfig));\n } catch (e) {\n configuration = (0, _assign2.default)(configuration, p2pConfig);\n }\n }\n\n // required for protostub session\n\n configuration.runtimeURL = _this2._runtimeURL;\n\n // step 24 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n try {\n // step 26 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub] 8: adding sandbox listener to protostubURL : ', _runtimeProtoStubURL);\n\n // step 27 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n // Add the message bus listener\n _this2.messageBus.addListener(_runtimeProtoStubURL, function (msg) {\n _stubSandbox.postMessage(msg);\n });\n\n return _stubSandbox.deployComponent(_stubSourcePackage.sourceCode, _runtimeProtoStubURL, configuration);\n } catch (e) {\n log.error('[Runtime.Loader.loadStub] Error on deploy component:', e);\n reject(e);\n }\n }, handleError).then(function () {\n if (haveError) return false;\n\n // step 28 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n var stub = void 0;\n if (p2pConfig) {\n log.log('[Runtime.Loader.loadStub] p2pConfig: ', p2pConfig);\n\n if (p2pConfig.hasOwnProperty('isHandlerStub')) stub = _this2.registry.p2pHandlerStub[_this2._runtimeURL];\n if (p2pConfig.hasOwnProperty('p2pRequesterStub')) stub = _this2.registry.p2pRequesterStub[p2pConfig.remoteRuntimeURL];\n } else {\n stub = _this2.registry.protostubsList[domain];\n }\n\n log.log('[Runtime.Loader.loadStub] Stub: ', stub);\n resolve(stub);\n log.info('[Runtime.Loader.loadStub]------------------- END ---------------------------\\n');\n }, handleError).catch(errorReason);\n }\n });\n }\n\n /**\n * Deploy idpProxy from Catalogue URL or domain url\n * @param {URL.URL} domain domain\n */\n\n }, {\n key: 'loadIdpProxy',\n value: function loadIdpProxy(idpProxyURL) {\n var _this3 = this;\n\n if (!this._readyToUse()) return false;\n if (!idpProxyURL) throw new Error('[Runtime.Loader] IdpProxy descriptor url parameter is needed');\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = (0, _utils.divideURL)(idpProxyURL).domain;\n\n if (!domain) {\n domain = idpProxyURL;\n }\n\n var _proxySandbox = void 0;\n var _proxyDescriptor = void 0;\n var _runtimeIdpProxyURL = void 0;\n var _proxySourcePackage = void 0;\n var haveError = false;\n\n var errorReason = function errorReason(reason) {\n log.info('[Runtime.Loader] Something failed on the deploy of IdpProxy: ', reason);\n reject(reason);\n };\n\n var handleError = function handleError(reason) {\n haveError = true;\n reject(reason);\n };\n\n // Discover IDPProxy\n log.info('[Runtime.Loader] ------------------- IDP Proxy Deploy ---------------------------\\n');\n log.info('[Runtime.Loader] Discover or Create a new IdpProxy for domain/URL: ', domain);\n\n try {\n var runtimeIdpProxyURL = _this3.registry.discoverIdpProxy(domain);\n\n // Is registed?\n log.info('[Runtime.Loader] 1. IDPProxy Discovered: ', runtimeIdpProxyURL);\n\n // we have completed step 2 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n var idpProxy = _this3.registry.idpProxyList[domain];\n log.log('Deployed: ', idpProxy);\n\n resolve(idpProxy);\n log.info('[Runtime.Loader] ------------------- END ---------------------------\\n');\n } catch (reason) {\n\n // is not registed?\n log.info('[Runtime.Loader] 1. IdpProxy not found:', reason);\n\n // we have completed step 3 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // we need to get ProtoStub descriptor step 4 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _this3.descriptors.getIdpProxyDescriptor(idpProxyURL).then(function (proxyDescriptor) {\n\n log.info('[Runtime.Loader] 2. Return the IDPProxy descriptor');\n\n // we have completed step 5 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _proxyDescriptor = proxyDescriptor;\n\n var sourcePackageURL = proxyDescriptor.sourcePackageURL;\n\n if (sourcePackageURL === '/sourcePackage') {\n return proxyDescriptor.sourcePackage;\n }\n\n // we need to get ProtoStub Source code from descriptor - step 6 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this3.runtimeCatalogue.getSourcePackageFromURL(sourcePackageURL);\n }, handleError).then(function (sourcePackage) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 3. return the IDPProxy source package');\n\n // we have completed step 7 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n _proxySourcePackage = sourcePackage;\n\n // TODO: Check on PEP (policy Engine) if we need the sandbox and check if the Sandbox Factory have the context sandbox;\n var policy = true;\n return policy;\n }, handleError).then(function (policy) {\n if (haveError) return false;\n\n // this will return the sandbox or one promise to getSandbox;\n return _this3.registry.getSandbox(domain);\n }).then(function (proxySandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 4. if the sandbox is registered then return the sandbox', proxySandbox);\n\n _proxySandbox = proxySandbox;\n return proxySandbox;\n }).catch(function (reason) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 5. Sandbox was not found, creating a new one', reason);\n\n var proxyCapabilities = {};\n if (_proxyDescriptor && _proxyDescriptor.hasOwnProperty('capabilities')) {\n _proxyDescriptor = _proxyDescriptor.stubCapabilities;\n }\n\n return _this3._runtimeFactory.createSandbox(proxyCapabilities).then(function (sandbox) {\n\n sandbox.addListener('*', function (msg) {\n _this3.messageBus.postMessage(msg);\n });\n\n return sandbox;\n });\n }).then(function (sandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 6. return the sandbox instance and register', sandbox, 'to domain ', domain);\n\n _proxySandbox = sandbox;\n\n // we need register stub on registry - step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this3.registry.registerIdpProxy(sandbox, domain);\n }, handleError).then(function (runtimeIdpProxyURL) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 7. Return the runtime Idp Proxy URL: ', runtimeIdpProxyURL);\n\n // we have completed step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n _runtimeIdpProxyURL = runtimeIdpProxyURL;\n\n // Extend original hyperty configuration;\n var configuration = {};\n if (!(0, _utils.emptyObject)(_proxyDescriptor.configuration)) {\n try {\n configuration = (0, _assign2.default)({}, JSON.parse(_proxyDescriptor.configuration));\n } catch (e) {\n configuration = _proxyDescriptor.configuration;\n }\n }\n configuration.runtimeURL = _this3._runtimeURL;\n\n // Deploy Component step xxx\n try {\n // we have completed step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // Add the message bus listener\n _this3.messageBus.addListener(_runtimeIdpProxyURL, function (msg) {\n _proxySandbox.postMessage(msg);\n });\n\n return _proxySandbox.deployComponent(_proxySourcePackage.sourceCode, runtimeIdpProxyURL, configuration);\n } catch (e) {\n log.info('[Runtime.Loader] Error on deploy component:', e);\n reject(e);\n }\n }, handleError).then(function () {\n if (haveError) return false;\n\n // we have completed step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // Load Stub function resolved with success;\n // let idpProxy = {\n // runtimeIdpProxyURL: _runtimeIdpProxyURL,\n // status: deployComponentStatus\n // };\n\n //this.registry.idpProxyList[domain].status = 'deployed';\n var idpProxy = _this3.registry.idpProxyList[domain];\n\n log.log('[Runtime.Loader.loadIdpProxy] 8: loaded: ', idpProxy);\n\n resolve(idpProxy);\n log.info('[Runtime.Loader.loadIdpProxy] ------------------- END ---------------------------\\n');\n }, handleError).catch(errorReason);\n }\n });\n }\n\n // Check if the loader is ready to load all components\n\n }, {\n key: '_readyToUse',\n value: function _readyToUse() {\n\n var status = false;\n\n if (!this._runtimeURL) throw new Error('[Runtime.Loader] The loader need the runtime url address');\n if (!this._messagesBus) throw new Error('[Runtime.Loader] The loader need the messageBus component');\n if (!this._registry) throw new Error('[Runtime.Loader] The loader need the registry component');\n if (!this._runtimeFactory) throw new Error('[Runtime.Loader] The loader need the runtime factory component');\n\n status = true;\n return status;\n }\n }, {\n key: 'runtimeURL',\n set: function set(value) {\n this._runtimeURL = value;\n }\n\n /**\n * Get runtime url\n * @return {string} value runtimeURL\n */\n ,\n get: function get() {\n return this._runtimeURL;\n }\n\n /**\n * Set Registry component\n * @param {Registry} value Registry Component\n */\n\n }, {\n key: 'registry',\n set: function set(value) {\n this._registry = value;\n\n // Install AddressAllocation\n var addressAllocation = _AddressAllocation2.default.instance;\n this._addressAllocation = addressAllocation;\n\n log.log('[Loader - AddressAllocation] - ', addressAllocation);\n }\n\n /**\n * Get Registry component\n * @return {Registry} Registry component\n */\n ,\n get: function get() {\n return this._registry;\n }\n\n /**\n * Set Message Bus component\n * @param {MessageBus} value Message bus component\n */\n\n }, {\n key: 'messageBus',\n set: function set(value) {\n this._messagesBus = value;\n }\n\n /**\n * Get Message Bus component\n * @return {MessageBus} Message Bus component\n */\n ,\n get: function get() {\n return this._messagesBus;\n }\n\n /**\n * Set Runtime Factory component\n * @param {runtimeFactory} value Factory includes the specific implementations for each environment\n */\n\n }, {\n key: 'runtimeFactory',\n set: function set(value) {\n this._runtimeFactory = value;\n }\n\n /**\n * Get Runtime Factory component\n * @return {runtimeFactory} Runtime Factory component\n */\n ,\n get: function get() {\n return this._runtimeFactory;\n }\n }]);\n return Loader;\n}();\n\nexports.default = Loader;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL0xvYWRlci5qcz9jYzkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignbG9hZGVyJyk7XG5cbmltcG9ydCB7ZGl2aWRlVVJMLCBlbXB0eU9iamVjdH0gZnJvbSAnLi4vdXRpbHMvdXRpbHMnO1xuaW1wb3J0IEFkZHJlc3NBbGxvY2F0aW9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gICAgICAgICAgcmV0dXJuIHByb3h5U2FuZGJveDtcbiAgICAgICAgICB9KVxuICAgICAgICAgIC5jYXRjaCgocmVhc29uKSA9PiB7XG4gICAgICAgICAgICBpZiAoaGF2ZUVycm9yKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICBsb2cuaW5mbygnW1J1bnRpbWUuTG9hZGVyXSA1LiBTYW5kYm94IHdhcyBub3QgZm91bmQsIGNyZWF0aW5nIGEgbmV3IG9uZScsIHJlYXNvbik7XG5cbiAgICAgICAgICAgIGxldCBwcm94eUNhcGFiaWxpdGllcyA9IHt9O1xuICAgICAgICAgICAgaWYgKF9wcm94eURlc2NyaXB0b3IgJiYgX3Byb3h5RGVzY3JpcHRvci5oYXNPd25Qcm9wZXJ0eSgnY2FwYWJpbGl0aWVzJykpIHtcbiAgICAgICAgICAgICAgX3Byb3h5RGVzY3JpcHRvciA9IF9wcm94eURlc2NyaXB0b3Iuc3R1YkNhcGFiaWxpdGllcztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3J1bnRpbWVGYWN0b3J5LmNyZWF0ZVNhbmRib3gocHJveHlDYXBhYmlsaXRpZXMpLnRoZW4oKHNhbmRib3gpID0+IHtcblxuICAgICAgICAgICAgICBzYW5kYm94LmFkZExpc3RlbmVyKCcqJywgKG1zZykgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMubWVzc2FnZUJ1cy5wb3N0TWVzc2FnZShtc2cpO1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICByZXR1cm4gc2FuZGJveDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pXG4gICAgICAgICAgLnRoZW4oKHNhbmRib3gpID0+IHtcbiAgICAgICAgICAgIGlmIChoYXZlRXJyb3IpIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIGxvZy5pbmZvKCdbUnVudGltZS5Mb2FkZXJdIDYuIHJldHVybiB0aGUgc2FuZGJveCBpbnN0Y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VyYXRpb247XG4gICAgICAgICAgICBsZXQgY29uZmlndXJhdGlvbiA9IHt9O1xuICAgICAgICAgICAgaWYgKCFlbXB0eU9iamVjdChfcHJveHlEZXNjcmlwdG9yLmNvbmZpZ3VyYXRpb24pKSB7XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiA9IE9iamVjdC5hc3NpZ24oe30sIEpTT04ucGFyc2UoX3Byb3h5RGVzY3JpcHRvci5jb25maWd1cmF0aW9uKSk7XG4gICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uID0gX3Byb3h5RGVzY3JpcHRvci5jb25maWd1cmF0aW9uO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25maWd1cmF0aW9uLnJ1bnRpbWVVUkwgPSB0aGlzLl9ydW50aW1lVVJMO1xuXG4gICAgICAgICAgICAvLyBEZXBsb3kgQ29tcG9uZW50IHN0ZXAgeHh4XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAvLyB3ZSBoYXZlIGNvbXBsZXRlZCBzdGVwIHh4eCBodHRwczovL2dpdGh1Yi5jb20vcmVUSElOSy1wcm9qZWN0L2NvcmUtZnJhbWV3b3JrL2Jsb2IvbWFzdGVyL2RvY3Mvc3BlY3MvcnVudGltZS9keW5hbWljLXZpZXcvYmFzaWNzL2RlcGxveS1wcm90b3N0dWIubWRcblxuICAgICAgICAgICAgICAvLyBBZGQgdGhlIG1lc3NhZ2UgYnVzIGxpc3RlbmVyXG4gICAgICAgICAgICAgIHRoaXMubWVzc2FnZUJ1cy5hZGRMaXN0ZW5lcihfcnVudGltZUlkcFByb3h5VVJMLCAobXNnKSA9PiB7XG4gICAgICAgICAgICAgICAgX3Byb3h5U2FuZGJveC5wb3N0TWVzc2FnZShtc2cpO1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICByZXR1c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QUNBO0FBQ0E7Ozs7O0FBeXBCQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///527\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Descriptors');\n\nvar Descriptors = function () {\n function Descriptors(runtimeURL, catalogue, runtimeConfiguration) {\n (0, _classCallCheck3.default)(this, Descriptors);\n\n if (!runtimeURL) throw Error('The descriptor need to know the runtime url to be used');\n if (!catalogue) throw Error('The descriptor needs the catalogue instance');\n if (!runtimeConfiguration) throw Error('The descriptor needs the runtime configuration');\n\n this.log = log;\n\n this.runtimeConfiguration = runtimeConfiguration;\n this.runtimeURL = runtimeURL;\n this.catalogue = catalogue;\n\n this.constraints = _runtimeUtils.runtimeUtils.runtimeCapabilities;\n }\n\n (0, _createClass3.default)(Descriptors, [{\n key: 'getHypertyDescriptor',\n value: function getHypertyDescriptor(hypertyURL) {\n return this.catalogue.getHypertyDescriptor(hypertyURL, true, this.constraints);\n }\n }, {\n key: 'getStubDescriptor',\n value: function getStubDescriptor(stubURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = void 0;\n var protostub = void 0;\n var protoStubURL = void 0;\n\n var originDividedURL = (0, _utils.divideURL)(_this.runtimeURL);\n var originDomain = originDividedURL.domain;\n\n if (stubURL.includes('://')) {\n var dividedURL = (0, _utils.divideURL)(stubURL);\n domain = dividedURL.domain;\n var path = dividedURL.identity;\n\n if (path) {\n protostub = path.substring(path.lastIndexOf('/') + 1);\n } else {\n protostub = 'default';\n }\n } else {\n protostub = 'default';\n domain = stubURL;\n }\n\n protoStubURL = (0, _utils.buildURL)(_this.runtimeConfiguration, 'catalogueURLs', 'protocolstub', protostub);\n if (domain !== _this.runtimeConfiguration.domain) {\n if (!stubURL.indexOf('https') || !stubURL.indexOf('hyperty-catalogue')) {\n protoStubURL = stubURL;\n } else {\n\n // TODO: check how to load form different configuration domain\n var resource = (0, _utils.getConfigurationResources)(_this.runtimeConfiguration, 'catalogueURLs', 'protocolstub');\n protoStubURL = resource.prefix + domain + resource.suffix + protostub;\n }\n }\n\n log.log('Load ProtocolStub for domain, ' + domain + ' : ', protoStubURL);\n return _this.catalogue.getStubDescriptor(protoStubURL, true, _this.constraints).then(function (result) {\n\n resolve(result);\n }).catch(function (error) {\n\n // log.log('Error: ', error);\n\n protostub = domain;\n domain = originDomain;\n\n var resource = (0, _utils.getConfigurationResources)(_this.runtimeConfiguration, 'catalogueURLs', 'protocolstub');\n protoStubURL = resource.prefix + domain + resource.suffix + protostub;\n\n // log.log('Fallback -> Load Protocolstub for domain, ' + domain + ' : ', protostub);\n return _this.catalogue.getStubDescriptor(protoStubURL, true, _this.constraints);\n }).then(function (result) {\n resolve(result);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'getIdpProxyDescriptor',\n value: function getIdpProxyDescriptor(idpProxyURL) {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = void 0;\n var idpproxy = void 0;\n\n var originDividedURL = (0, _utils.divideURL)(_this2.runtimeURL);\n var originDomain = originDividedURL.domain;\n var constraints = _this2.constraints;\n\n constraints.constraints.onlyAccessToken = true;\n constraints.constraints.onlyIdAssertionValidation = true;\n console.log('LOG HERE', constraints);\n if (idpProxyURL.includes('://')) {\n var dividedURL = (0, _utils.divideURL)(idpProxyURL);\n domain = dividedURL.domain;\n var path = dividedURL.identity;\n if (path) {\n idpproxy = path.substring(path.lastIndexOf('/') + 1);\n } else {\n idpproxy = 'default';\n }\n } else {\n idpproxy = 'default';\n domain = idpProxyURL;\n }\n\n var resource = (0, _utils.getConfigurationResources)(_this2.runtimeConfiguration, 'catalogueURLs', 'idpProxy');\n\n idpProxyURL = resource.prefix + domain + resource.suffix + idpproxy;\n // log.log('Load Idp Proxy for domain, ' + domain + ' : ', idpProxyURL);\n return _this2.catalogue.getIdpProxyDescriptor(idpProxyURL, true, constraints).then(function (result) {\n\n resolve(result);\n }).catch(function () {\n\n idpproxy = domain;\n domain = originDomain;\n\n idpProxyURL = (0, _utils.buildURL)(_this2.runtimeConfiguration, 'catalogueURLs', 'idpProxy', idpproxy);\n\n // log.log('Load Idp Proxy for domain, ' + domain + ' : ', idpProxyURL);\n return _this2.catalogue.getIdpProxyDescriptor(idpProxyURL, true, constraints);\n }).then(function (result) {\n resolve(result);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }]);\n return Descriptors;\n}();\n\nexports.default = Descriptors;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL0Rlc2NyaXB0b3JzLmpzP2ZjZDgiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtkaXZpZGVVUkwsIGdldENvbmZpZ3VyYXRpb25SZXNvdXJjZXMsIGJ1aWxkVVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5pbXBvcnQgeyBydW50aW1lVXRpbHMgfSBmcm9tICcuL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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7OztBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBOzs7OztBQUdBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///528\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('RuntimeUA'); /**\n * Class where message bus handlers are built. To be used by the RuntimeUA to initialise the runtime UA.\n */\n\n//import { log as logLevels } from '../logLevels';\n\n// Log System\n\nvar MsgBusHandlers = function () {\n function MsgBusHandlers(pep, idm, crypto) {\n (0, _classCallCheck3.default)(this, MsgBusHandlers);\n\n if (!pep) throw Error('[MsgBusHandlers] pep input paramenter is mandatory');\n if (!idm) throw Error('[MsgBusHandlers] idm input paramente is mandatory');\n if (!crypto) throw Error('[MsgBusHandlers] crypto input paramente is mandatory');\n\n this.policyEngine = pep;\n this.identityManager = idm;\n this.cryptoManager = crypto;\n }\n\n // Policy based access control for incoming messages\n\n (0, _createClass3.default)(MsgBusHandlers, [{\n key: 'pepInHandler',\n get: function get() {\n var _this = this;\n\n return function (ctx) {\n _this.policyEngine.authorise(ctx.msg, true).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // Policy based access control for outgoing messages\n\n }, {\n key: 'pepOutHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.policyEngine.authorise(ctx.msg, false).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // Add Identity info to messages\n\n }, {\n key: 'idmHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.identityManager.processMessage(ctx.msg).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // encrypt messages\n\n }, {\n key: 'encryptHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.cryptoManager.encryptMessage(ctx.msg).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // decrypt messages\n\n }, {\n key: 'decryptHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.cryptoManager.decryptMessage(ctx.msg).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.warn(reason);\n ctx.fail(reason);\n });\n };\n }\n }]);\n return MsgBusHandlers;\n}();\n\nexports.default = MsgBusHandlers;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL01zZ0J1c0hhbmRsZXJzLmpzPzZiYmEiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiAgQ2xhc3Mgd2hlcmUgbWVzc2FnZSBidXMgaGFuZGxlcnMgYXJlIGJ1aWx0LiBUbyBiZSB1c2VkIGJ5IHRoZSBSdW50aW1lVUEgdG8gaW5pdGlhbGlzZSB0aGUgcnVudGltZSBVQS5cbiAqL1xuXG4vL2ltcG9ydCB7IGxvZyBhcyBsb2dMZXZlbHMgfSBmcm9tICcuLi9sb2dMZXZlbHMnO1xuXG4vLyBMb2cgU3lzdGVtXG5pbXBvcnQgKiBhcyBsb2dnZXIgZnJvbSAnbG9nbGV2ZWwnO1xubGV0IGxvZyA9IGxvZ2dlci5nZXRMb2dnZXIoJ1J1bnRpbWVVQScpO1xuXG5jbGFzcyBNc2dCdXNIYW5kbGVycyB7XG5cbiAgY29uc3RydWN0b3IocGVwLCBpZG0sIGNyeXB0bykge1xuICAgIGlmICghcGVwKSB0a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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///529\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('CoreDiscovery'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* Core Discovery interface\n* Class to allow applications to search for hyperties and DataObjects using the message bus\n*/\nvar CoreDiscovery = function () {\n\n /**\n * To initialise the Discovery, which will provide the support for hyperties to\n * query users registered in outside the internal core.\n * @param {MessageBus} msgbus msgbus\n * @param {RuntimeURL} runtimeURL runtimeURL\n * @param {graphConnector} graphConnector\n */\n function CoreDiscovery(runtimeURL, msgBus, graphConnector, runtimeFactory, registry) {\n (0, _classCallCheck3.default)(this, CoreDiscovery);\n\n if (!runtimeFactory) throw Error('The catalogue needs the runtimeFactory');\n\n var _this = this;\n this._messageBus = msgBus;\n _this.graphConnector = graphConnector;\n _this.httpRequest = runtimeFactory.createHttpRequest();\n _this.domain = (0, _utils.divideURL)(runtimeURL).domain;\n _this.discoveryURL = runtimeURL + '/discovery/';\n _this.registry = registry;\n\n _this.messageBus.addListener(_this.discoveryURL, function (msg) {\n\n _this.discoveryManager(msg).then(function (result) {\n\n //FLOW-OUT: message response\n _this.messageBus.postMessage({\n id: msg.id,\n type: 'response',\n from: msg.to,\n to: msg.from,\n body: {\n code: 200,\n value: result\n }\n });\n }).catch(function (err) {\n var description = void 0;\n var code = void 0;\n\n if (err === 'GraphConnector') {\n description = 'This search is not available at the moment. Try later.';\n code = 500;\n } else {\n description = 'Not Found';\n code = 404;\n }\n\n //FLOW-OUT: error message response\n _this.messageBus.postMessage({\n id: msg.id,\n type: 'response',\n from: msg.to,\n to: msg.from,\n body: {\n code: code,\n description: description\n }\n });\n });\n });\n }\n\n /**\n * Returns the MessageBus.\n */\n\n\n (0, _createClass3.default)(CoreDiscovery, [{\n key: 'discoveryManager',\n\n\n /* function to decide what discovery method to call and later return the response msg */\n value: function discoveryManager(msg) {\n var _this = this;\n var domain = (0, _utils.divideURL)(msg.from).domain;\n var atributes = msg.body.resource.split('/').filter(Boolean);\n var resources = [];\n var dataSchemes = [];\n\n log.log('[CoreDiscovery.discoveryManager] received: ', msg);\n\n if (msg.body.criteria) {\n if (msg.body.criteria.resources) {\n resources = msg.body.criteria.resources;\n }\n if (msg.body.criteria.dataSchemes) {\n dataSchemes = msg.body.criteria.dataSchemes;\n }\n }\n\n switch (atributes[1]) {\n case 'user':\n if (atributes[0] == 'hyperty') {\n return _this.discoverHyperties(msg.body.resource.split('user/')[1], dataSchemes, resources, msg.body.criteria.domain);\n } else {\n return _this.discoverDataObjects(msg.body.resource.split('user/')[1], dataSchemes, resources, msg.body.criteria.domain);\n }\n break;\n\n case 'url':\n if (atributes[0] == 'hyperty') {\n return _this.discoverHypertyPerURL(msg.body.resource.split('url/')[1], msg.body.criteria.domain);\n } else {\n return _this.discoverDataObjectPerURL(msg.body.resource.split('url/')[1], msg.body.criteria.domain);\n }\n break;\n case 'name':\n return _this.discoverDataObjectsPerName(msg.body.resource.split('name/')[1], dataSchemes, resources, msg.body.criteria.domain);\n break;\n case 'reporter':\n return _this.discoverDataObjectsPerReporter(msg.body.resource.split('reporter/')[1], dataSchemes, resources, msg.body.criteria.domain);\n break;\n case 'guid':\n if (typeof _this.graphConnector !== 'undefined' && _this.graphConnector !== null) {\n if (atributes[0] == 'hyperty') {\n return _this.discoverHypertiesPerGUID(msg.body.resource.split('user-guid://')[1], dataSchemes, resources);\n } else {\n return _this.discoverDataObjectsPerGUID(msg.body.resource.split('user-guid://')[1], dataSchemes, resources);\n }\n break;\n } else {\n return _promise2.default.reject('GraphConnector');\n break;\n }\n case 'userprofile':\n if (typeof _this.graphConnector !== 'undefined' && _this.graphConnector !== null) {\n if (atributes[0] == 'hyperty') {\n return _this.discoverHypertiesPerUserProfileData(msg.body.resource.split('userprofile/')[1], dataSchemes, resources);\n } else {\n return _this.discoverDataObjectsPerUserProfileData(msg.body.resource.split('userprofile/')[1], dataSchemes, resources);\n }\n break;\n } else {\n return _promise2.default.reject('GraphConnector');\n break;\n }\n }\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerUserProfileData',\n value: function discoverHypertiesPerUserProfileData(userIdentifier, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate user identifier (e.g. email, name...) into the associated GUIDs\n _this.discoverGUIDPerUserIdentifier(userIdentifier).then(function (guids) {\n\n var hypertiesPromises = guids.map(function (guid) {\n\n return new _promise2.default(function (resolve, reject) {\n _this.discoverHypertiesPerGUID(guid, dataSchemes, resources).then(function (hyperties) {\n resolve(hyperties);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(hypertiesPromises).then(function (hypertiesResult) {\n\n var hyperties = [].concat.apply([], hypertiesResult);\n\n if (hyperties.length === 0) {\n return reject('No hyperties were found');\n }\n\n resolve(hyperties);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverDataObjectsPerUserProfileData',\n value: function discoverDataObjectsPerUserProfileData(userIdentifier, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate user identifier (e.g. email, name...) into the associated GUIDs\n _this.discoverGUIDPerUserIdentifier(userIdentifier).then(function (guids) {\n\n var dataObjectsPromises = guids.map(function (guid) {\n\n return new _promise2.default(function (resolve, reject) {\n _this.discoverDataObjectsPerGUID(guid, dataSchemes, resources).then(function (dataObjects) {\n resolve(dataObjects);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(dataObjectsPromises).then(function (dataObjectsResult) {\n\n var dataObjects = [].concat.apply([], dataObjectsResult);\n\n if (dataObjects.length === 0) {\n return reject('No dataObjects were found');\n }\n\n resolve(dataObjects);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some GUID\n * @param {String} guid\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerGUID',\n value: function discoverHypertiesPerGUID(guid, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate GUID into the user IDs to query the domain registry\n _this.discoverUserIdsPerGUID(guid).then(function (uids) {\n\n //translate user IDs into the associated hyperties registered in some domain\n var hypertiesPromises = uids.map(function (uid) {\n return new _promise2.default(function (resolve, reject) {\n _this.discoverHyperties(uid.uID, dataSchemes, resources, uid.domain).then(function (hyperties) {\n resolve(hyperties);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(hypertiesPromises).then(function (hypertiesResult) {\n\n var hyperties = [].concat.apply([], hypertiesResult);\n\n if (hyperties.length === 0) {\n return reject('No hyperties were found');\n }\n\n // log.log('Hyperties : ', hyperties);\n resolve(hyperties);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some GUID\n * @param {String} guid\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverDataObjectsPerGUID',\n value: function discoverDataObjectsPerGUID(guid, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate GUID into the user IDs to query the domain registry\n _this.discoverUserIdsPerGUID(guid).then(function (uids) {\n\n //translate user IDs into the associated dataObjects registered in some domain\n var dataObjectPromises = uids.map(function (uid) {\n return new _promise2.default(function (resolve, reject) {\n _this.discoverDataObjects(uid.uID, dataSchemes, resources, uid.domain).then(function (dataObjects) {\n resolve(dataObjects);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(dataObjectPromises).then(function (dataObjectsResult) {\n\n var dataObjects = [].concat.apply([], dataObjectsResult);\n\n if (dataObjects.length === 0) {\n return reject('No dataObjects were found');\n }\n\n // log.log('DataObjects : ', dataObjects);\n resolve(dataObjects);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry and associated with some user ID\n * @param {String} user user identifier, either in url or email format\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHyperties',\n value: function discoverHyperties(user, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {}\n };\n\n if (user.indexOf('user://') > -1) {\n msg.body.resource = user;\n } else {\n msg.body.resource = '/hyperty/idp-identifier/' + user;\n }\n\n if (dataSchemes.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.dataSchemes = dataSchemes;\n }\n\n if (resources.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.resources = resources;\n }\n\n return new _promise2.default(function (resolve, reject) {\n // log.log(\"[CoreDiscovery.discoverHyperties] sending msg \", msg);\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n // log.log(\"[CoreDiscovery.discoverHyperties] rcved reply \", reply);\n\n if (reply.body.code === 200 || reply.body.code === 500) {\n var hyperties = reply.body.value;\n\n var finalHyperties = [];\n for (var key in hyperties) {\n finalHyperties.push(hyperties[key]);\n }if (finalHyperties.length > 0) {\n // log.log(\"[CoreDiscovery.discoverHyperties] Hyperties Found: \", finalHyperties);\n resolve(finalHyperties);\n } else {\n return reject('No Hyperty was found');\n }\n } else {\n return reject('No Hyperty was found');\n }\n\n /*_this.registry.isLegacy(user).then((legacy) => {\n if (legacy) resolve([{hypertyID: user }])\n else return reject('No Hyperty was found');\n });*/\n });\n });\n }\n\n /** Advanced Search for DataObjects registered in domain registry and associated with some user ID\n * @param {String} user user identifier, either in url or email format\n * @param {Array} dataSchemes (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjects',\n value: function discoverDataObjects(user, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n var dataObjectsArray = [];\n\n activeDomain = !domain ? _this.domain : domain;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate user identifier (e.g. email, name...) into the associated hyperties\n _this.discoverHyperties(user, [], [], activeDomain).then(function (hyperties) {\n\n var finalHyperties = [];\n for (var key in hyperties) {\n finalHyperties.push(hyperties[key]);\n } //translate hyperties URLs into the associated dataObjects registered in some domain\n var dataObjectsPromises = finalHyperties.map(function (hyperty) {\n return new _promise2.default(function (resolve, reject) {\n _this.discoverDataObjectsPerReporter(hyperty.hypertyID, dataSchemes, resources, activeDomain).then(function (dataObject) {\n resolve(dataObject);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(dataObjectsPromises).then(function (dataObjectsResult) {\n\n var dataObjects = [].concat.apply([], dataObjectsResult);\n\n dataObjects.forEach(function (dataObject) {\n dataObjectsArray.push(dataObject);\n });\n\n var finalDataObjects = [];\n for (var key in dataObjectsArray) {\n finalDataObjects.push(dataObjectsArray[key]);\n }if (finalDataObjects.length === 0) {\n return reject('No dataObjects were found');\n }\n\n // log.log('DataObjects Found: ', finalDataObjects);\n resolve(finalDataObjects);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * function to request about hyperties registered in domain registry, and\n * return the hyperty information, if found.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverHypertyPerURL',\n value: function discoverHypertyPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: url\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code !== 200 && reply.body.code !== 500) {\n return reject('No Hyperty was found');\n }\n\n var hyperty = reply.body.value;\n\n if (hyperty) {\n // log.log('Hyperty found: ', hyperty);\n resolve(hyperty);\n } else {\n return reject('No Hyperty was found');\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * return the dataObject information, if found.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverDataObjectPerURL',\n value: function discoverDataObjectPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: url\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var dataObject = reply.body.value;\n\n if (dataObject) {\n // log.log('DataObject found: ', dataObject);\n resolve(dataObject);\n } else {\n return reject('DataObject not found');\n }\n });\n });\n }\n\n /** Advanced Search for dataObjects registered in domain registry\n * @param {String} name name of the dataObject\n * @param {Array} dataSchemes (Optional) types of dataObject schemas\n * @param {Array} resources (Optional) types of dataObject resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerName',\n value: function discoverDataObjectsPerName(name, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: name\n }\n };\n\n if (dataSchemes.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.dataSchemes = dataSchemes;\n }\n\n if (resources.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.resources = resources;\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var dataObjects = reply.body.value;\n\n var finalDataObjects = [];\n for (var key in dataObjects) {\n finalDataObjects.push(dataObjects[key]);\n }if (finalDataObjects.length > 0) {\n // log.log(\"DataObjects Found: \", finalDataObjects);\n resolve(finalDataObjects);\n } else {\n return reject('No DataObject was found');\n }\n });\n });\n }\n\n /**\n * function to request about specific reporter dataObject registered in domain registry, and\n * return the dataObjects from that reporter.\n * @param {String} reporter dataObject reporter\n * @param {Array} scdataSchemeshema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerReporter',\n value: function discoverDataObjectsPerReporter(reporter, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: '/comm',\n criteria: {\n reporter: reporter\n }\n }\n };\n\n if (dataSchemes.length > 0) {\n msg.body.criteria.dataSchemes = dataSchemes;\n }\n\n if (resources.length > 0) {\n msg.body.criteria.resources = resources;\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var dataObjects = reply.body.value;\n\n var finalDataObjects = [];\n for (var key in dataObjects) {\n finalDataObjects.push(dataObjects[key]);\n }if (finalDataObjects.length > 0) {\n // log.log(\"DataObjects Found: \", finalDataObjects);\n resolve(finalDataObjects);\n } else {\n return reject('No DataObject was found');\n }\n });\n });\n }\n\n /**\n * function to request global registry about the user IDs associated with some GUID\n * @param {String} guid\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverUserIdsPerGUID',\n value: function discoverUserIdsPerGUID(guid) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n // log.log(\"GO graphConnector:\", guid);\n\n _this.graphConnector.queryGlobalRegistry(guid).then(function (graphConnectorContactData) {\n\n // log.log('Information returned from Global Registry: ', graphConnectorContactData);\n\n if (typeof graphConnectorContactData === 'string' || !graphConnectorContactData) {\n return reject('Unsuccessful discover userIDs by GUID');\n } else {\n\n var userids = graphConnectorContactData.userIDs;\n\n if (userids.length === 0) {\n return reject('UserIDs not available');\n }\n\n resolve(userids);\n }\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * function to request discovery service about the GUID associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverGUIDPerUserIdentifier',\n value: function discoverGUIDPerUserIdentifier(userIdentifier) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var lookupURLDiscoveryService = 'https://rethink.tlabscloud.com/discovery/rest/discover/lookup?searchquery=';\n _this.httpRequest.get(lookupURLDiscoveryService + userIdentifier).then(function (json) {\n // log.log('discover GUID by user identifier', json);\n\n var response = JSON.parse(json);\n var filteredGuid = response.results.filter(function (x) {\n return x.rethinkID != undefined;\n });\n\n if (filteredGuid.length === 0) {\n return reject('Unsuccessful discover GUID by user identifier');\n }\n\n var guids = filteredGuid.map(function (x) {\n return x.rethinkID;\n });\n\n return resolve(guids);\n }).catch(function (err) {\n // log.log(\"HTTP Request error: \", err);\n return reject(err);\n });\n });\n }\n }, {\n key: 'messageBus',\n get: function get() {\n return this._messageBus;\n }\n\n /**\n * Sets the MessageBus.\n * @param {MessageBus} messageBus The Message Bus.\n */\n ,\n set: function set(messageBus) {\n this._messageBus = messageBus;\n }\n }]);\n return CoreDiscovery;\n}();\n\nexports.default = CoreDiscovery;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvQ29yZURpc2NvdmVyeS5qcz8yMzdkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4qIFlvdSBtYXkg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Jlc3VsdCA9PntcblxuICAgICAgICAvL0ZMT1ctT1VUOiBtZXNzYWdlIHJlc3BvbnNlXG4gICAgICAgIF90aGlzLm1lc3NhZ2VCdXMucG9zdE1lc3NhZ2Uoe1xuICAgICAgICAgIGlkOiBtc2cuaWQsXG4gICAgICAgICAgdHlwZTogJ3Jlc3BvbnNlJyxcbiAgICAgICAgICBmcm9tOiBtc2cudG8sXG4gICAgICAgICAgdG86IG1zZy5mcm9tLFxuICAgICAgICAgIGJvZHk6IHtcbiAgICAgICAgICAgIGNvZGU6IDIwMCxcbiAgICAgICAgICAgIHZhbHVlOiByZXN1bHRcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSlcbiAgICAgICAgLmNhdGNoKGZ1bmN0aW9uKGVycikge1xuICAgICAgICAgIGxldCBkZXNjcmlwdGlvbjtcbiAgICAgICAgICBsZXQgY29kZTtcblxuICAgICAgICAgIGlmIChlcnIgPT09ICdHcmFwaENvbm5lY3RvcicpIHtcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uID0gJ1RoaXMgc2VhcmNoIGlzIG5vdCBhdmFpbGFibGUgYXQgdGhlIG1vbWVudC4gVHJ5IGxhdGVyLic7XG4gICAgICAgICAgICBjb2RlID0gNTAwO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkZXNjcmlwdGlvbiA9ICdOb3QgRm91bmQnO1xuICAgICAgICAgICAgY29kZSA9IDQwNDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvL0ZMT1ctT1VUOiBlcnJvciBtZXNzYWdlIHJlc3BvbnNlXG4gICAgICAgICAgX3RoaXMubWVzc2FnZUJ1cy5wb3N0TWVzc2FnZSh7XG4gICAgICAgICAgICBpZDogbXNnLmlkLFxuICAgICAgICAgICAgdHlwZTogJ3Jlc3BvbnNlJyxcbiAgICAgICAgICAgIGZyb206IG1zZy50byxcbiAgICAgICAgICAgIHRvOiBtc2cuZnJvbSxcbiAgICAgICAgICAgIGJvZH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zb3VyY2VzXG4gICovXG4gIGRpc2NvdmVyRGF0YU9iamVjdHNQZXJVc2VyUHJvZmlsZURhdGEodXNlcklkZW50aWZpZXIsIGRhdGFTY2hlbWVzLCByZXNvdXJjZXMpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuXG4gICAgICAvL3RyYW5zbGF0ZSB1c2VyIGlkZW50aWZpZXIgKGUuZy4gZW1haWwsIG5hbWUuLi4pIGludG8gdGhlIGFzc29jaWF0ZWQgR1VJRHNcbiAgICAgIF90aGlzLmRpc2NvdmVyR1VJRFBlclVzZXJJZGVudGlmaWVyKHVzZXJJZGVudGlmaWVyKVxuICAgICAgICAudGhlbihmdW5jdGlvbihndWlkcykge1xuXG4gICAgICAgICAgbGV0IGRhdGFPYmplY3RzUHJvbWlzZXMgPSBndWlkcy5tYXAoZnVuY3Rpb24oZ3VpZCkge1xuXG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgIF90aGlzLmRpc2NvdmVyRGF0YU9iamVjdHNQZXJHVUlEKGd1aWQsIGRhdGFTY2hlbWVzLCByZXNvdXJjZXMpXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdHMpIHtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUoZGF0YU9iamVjdHMpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uKGVycikge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShbXSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIFByb21pc2UuYWxsKGRhdGFPYmplY3RzUHJvbWlzZXMpXG4gICAgICAgIC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byBxdWVyeSB0aGUgZG9tYWluIHJlZ2lzdHJ5XG4gICAgICBfdGhpcy5kaXNjb3ZlclVzZXJJZHNQZXJHVUlEKGd1aWQpXG4gICAgICAgIC50aGVuKGZ1bmN0aW9uKHVpZHMpIHtcblxuICAgICAgICAvL3RyYW5zbGF0ZSB1c2VyIElEcyBpbnRvIHRoZSBhc3NvY2lhdGVkIGRhdGFPYmplY3RzIHJlZ2lzdGVyZWQgaW4gc29tZSBkb21haW5cbiAgICAgICAgICBsZXQgZGF0YU9iamVjdFByb21pc2VzID0gdWlkcy5tYXAoZnVuY3Rpb24odWlkKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgIF90aGlzLmRpc2NvdmVyRGF0YU9iamVjdHModWlkLnVJRCwgZGF0YVNjaGVtZXMsIHJlc291cmNlcywgdWlkLmRvbWFpbilcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbihkYXRhT2JqZWN0cykge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShkYXRhT2JqZWN0cyk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKFtdKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgUHJvbWlzZS5hbGwoZGF0YU9iamVjdFByb21pc2VzKVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdHNSZXN1bHQpIHtcblxuICAgICAgICAgICAgICBsZXQgZGF0YU9iamVjdHMgPSBbXS5jb25jYXQuYXBwbHkoW10sIGRhdGFPYmplY3RzUmVzdWx0KTtcblxuICAgICAgICAgICAgICBpZiAoZGF0YU9iamVjdHMubGVuZ3RoID09PSAwKSB7XG4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hlIGFzc29jaWF0ZWQgaHlwZXJ0aWVzXG4gICAgICBfdGhpcy5kaXNjb3Zlckh5cGVydGllcyh1c2VyLCBbXSwgW10sIGFjdGl2ZURvbWFpbilcbiAgICAgICAgLnRoZW4oZnVuY3Rpb24oaHlwZXJ0aWVzKSB7XG5cbiAgICAgICAgICBsZXQgZmluYWxIeXBlcnRpZXMgPSBbXTtcbiAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gaHlwZXJ0aWVzKSBmaW5hbEh5cGVydGllcy5wdXNoKGh5cGVydGllc1trZXldKTtcblxuICAgICAgICAgIC8vdHJhbnNsYXRlIGh5cGVydGllcyBVUkxzIGludG8gdGhlIGFzc29jaWF0ZWQgZGF0YU9iamVjdHMgcmVnaXN0ZXJlZCBpbiBzb21lIGRvbWFpblxuICAgICAgICAgIGxldCBkYXRhT2JqZWN0c1Byb21pc2VzID0gZmluYWxIeXBlcnRpZXMubWFwKGZ1bmN0aW9uKGh5cGVydHkpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgICAgX3RoaXMuZGlzY292ZXJEYXRhT2JqZWN0c1BlclJlcG9ydGVyKGh5cGVydHkuaHlwZXJ0eUlELCBkYXRhU2NoZW1lcywgcmVzb3VyY2VzLCBhY3RpdmVEb21haW4pXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdCkge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShkYXRhT2JqZWN0KTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUoW10pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBQcm9taXNlLmFsbChkYXRhT2JqZWN0c1Byb21pc2VzKVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdHNSZXN1bHQpIHtcblxuICAgICAgICAgICAgICBsZXQgZGF0YU9iamVjdHMgPSBbXS5jb25jYXQuYXBwbHkoW10sIGRhdGFPYmplY3RzUmVzdWx0KTtcblxuICAgICAgICAgICAgICBkYXRhT2JqZWN0cy5mb3JFYWNoKGZ1bmN0aW9uKGRhdGFPYmplY3QpIHtcbiAgICAgICAgICAgICAgICBkYXRhT2JqZWN0c0FycmF5LnB1c2goZGF0YU9iamVjdCk7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIGxldCBmaW5hbERhdGFPYmplY3RzID0gW107XG4gICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBkYXRhT2JqZWN0c0FycmF5KSBmaW5hbERhdGFPYmplY3RzLnB1c2goZGF0YU9iamVjdHNBcnJheVtrZXldKTtcblxuICAgICAgICAgICAgICBpZiAoZmluYWxEYXRhT2JqZWN0cy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KCdObyBkYXRhT2JqZWN0cyB3ZXJlIGZvdW5kJyk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBsb2cubG9nKCdEYXRhT2JqZWN0cyBGb3VuZDogJywgZmluYWxEYXRhT2JqZWN0cyk7XG4gICAgICAgICAgICAgIHJlc29sdmUoZmluYWxEYXRhT2JqZWN0cyk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICB9KVxuICAgICAgICAuY2F0Y2goZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAqIGZ1bmN0aW9uIHRvIHJlcXVlc3QgYWJvdXQgaHlwZXJ0aWVzIHJlZ2lzdGVyZWQgaW4gZG9tYWluIHJlZ2lzdHJ5LCBhbmRcbi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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUF2bUJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBOzs7OztBQWdtQkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///530\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _from = __webpack_require__(219);\n\nvar _from2 = _interopRequireDefault(_from);\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _assign = __webpack_require__(46);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Storage = __webpack_require__(218);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectsStorage'); // Log System\n\nvar DataObjectsStorage = function () {\n function DataObjectsStorage(storageManager) {\n var storedDataObjects = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var factory = arguments[2];\n var runtimeStatusUpdate = arguments[3];\n (0, _classCallCheck3.default)(this, DataObjectsStorage);\n\n if (!storageManager) throw new Error('[Store Data Objects] - Needs the storageManager component');\n\n this._storageManager = storageManager;\n\n this._storeDataObject = storedDataObjects;\n\n this._cache = {};\n\n this._createSyncDB = _Storage.createSyncDB; // to create Data Objects to be synched with remote storages\n this._remotes = {}; // List of DO synched with remote storages\n this._factory = factory;\n this._table = 'syncherManager:ObjectURLs';\n this._remoteStorageTable = 'dataObjectStorage';\n this._remoteSchema = 'url';\n this._runtimeStatusUpdate = runtimeStatusUpdate;\n }\n\n // load Data Objects synched with remote Storages\n\n (0, _createClass3.default)(DataObjectsStorage, [{\n key: 'loadRemote',\n value: function loadRemote() {\n var _this2 = this;\n\n var resume = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n var loading = [];\n var loadingDBs = [];\n\n _this._storageManager.get(null, null, 'remotes').then(function (remotes) {\n\n // in case we don't have any remotes locally stored\n log.info('[StoreDataObjects.loadRemote] remotes: ', remotes);\n if (!remotes) resolve();\n\n if (!resume) _this._remotes = remotes;\n\n log.info('[StoreDataObjects.loadRemote] loading: ', _this._remotes);\n\n var remoteObjects = (0, _keys2.default)(remotes);\n\n // in case we don't have any remotes locally stored\n\n if (remoteObjects.length === 0) resolve();\n\n remoteObjects.forEach(function (db) {\n var schema = {};\n var table = db.split('/')[3];\n schema[table] = _this2._remoteSchema;\n _this._remotes[db] = (0, _Storage.createSyncDB)(db, _this2._factory, schema, _this2._runtimeStatusUpdate);\n // _this._remotes[remote] = createSyncDB(remote, _this._factory, 'remoteDataObjectStorage' );\n loading.push(_this._remotes[db].get(null, null, table));\n });\n\n _promise2.default.all(loading).then(function () {\n log.log('[StoreDataObjects.loadRemote] loaded. Starting init');\n //TODO: init this._storeDataObject with loaded data objects\n (0, _keys2.default)(_this._remotes).forEach(function (remote) {\n var table = remote.split('/')[3];\n loadingDBs.push(_this._remotes[remote].get(null, null, table));\n });\n _promise2.default.all(loadingDBs).then(function (dataObjs) {\n\n dataObjs.forEach(function (dO) {\n (0, _keys2.default)(dO).forEach(function (url) {\n log.log('[StoreDataObjects.loadRemote] loaded remote ', dO);\n\n // if (dO[remote].isReporter) {\n var type = _this2._getTypeOfObject(dO[url].isReporter);\n\n if (!_this._storeDataObject) _this._storeDataObject = {};\n\n if (!_this._storeDataObject.hasOwnProperty(type)) _this._storeDataObject[type] = {};\n\n // let backupRevision \n\n var synching = [];\n\n synching.push(_this._sync(url, dO[url].data.backupRevision, true, url.split('/')[3]).then(function (synchedObj) {\n _this._storeDataObject[type][url] = synchedObj;\n log.log('[StoreDataObjects.loadRemote] storeDataObject updated: ', _this._storeDataObject);\n }));\n\n _promise2.default.all(synching).then(function () {\n resolve(_this._storeDataObject);\n });\n\n setTimeout(function () {\n _this._remotes[url].disconnect().then(function () {\n log.log('[DataObjectStorage.loadRemote] disconnected ');\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error synching with remote storage');\n reject(error);\n });\n }, 1000);\n });\n });\n }, function (error) {\n reject(error);\n });\n });\n }, function (error) {\n reject(error);\n });\n\n // resolve();\n });\n }\n\n /**\n * @description should set the initial state of the dataObjectURL to be resumed if necessary;\n *\n * @param {DataObjectURL} url - dataObjectURL to be saved;\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {SchemaURL} schema - the schema url\n * @param {String} status - the status of current dataObject\n * @param {HypertyURL} reporter - the Reporter hypertyURL\n * @param {Array} subscription - list of subscriptions\n * @param {Array} children - list of childs of dataObjectURL\n * @param {Array} childrens - list of childrens, like, 'chatmessage';\n * @param {Array {\n \n console.log('[DataObjectStorage.initialObserverSync] connected ');\n \n setTimeout(function() {\n _this._remotes[resource].disconnect().then(()=>{\n console.log('[DataObjectStorage.initialObserverSync] disconnected ');\n },(error)=> {\n log.error('[DataObjectStorage.initialObserverSync] Error disconnecting with remote storage');\n reject(error);\n });\n }, 15000)\n \n }, (error) => {\n log.error('[DataObjectStorage.initialObserverSync] Error connecting to remote storage');\n reject(error)\n });\n \n }*/\n\n /**\n * @description should save and update the current dataObject data information\n *\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {DataObjectURL} resource - dataObjectURL to be saved or updated;\n * @param {String} attribute - attribute inside the data which will be saved\n * @param {any} data - value will be saved inside the attribute;\n */\n\n }, {\n key: 'saveData',\n value: function saveData(isReporter, resource, attribute, value, updateRuntimeStatus) {\n\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - save data] - not saved');\n return;\n }\n\n log.log('[StoreDataObjects - saveData] - ', isReporter, type, resource, attribute, value);\n\n if (!storeDataObject[type][resource].hasOwnProperty('data')) {\n storeDataObject[type][resource].data = {};\n }\n\n if (attribute) {\n var _data = void 0;\n if ((typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object') _data = (0, _utils.deepClone)(value);else _data = value;\n\n (0, _utils.assign)(storeDataObject[type][resource].data, attribute, _data);\n } else {\n storeDataObject[type][resource].data = (0, _utils.deepClone)(value) || {};\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : storeDataObject;\n storage.set(db, 1, data, table, updateRuntimeStatus).then(function () {\n return storeDataObject[type][resource];\n }, function (error) {\n console.error(error);\n return storeDataObject[type][resource];\n });\n }\n }, {\n key: 'saveChildrens',\n value: function saveChildrens(isReporter, resource, attribute, value) {\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - save childrens] - not saved');\n return;\n }\n\n if (!storeDataObject[type][resource].hasOwnProperty('childrens')) {\n storeDataObject[type][resource].childrenObjects = {};\n }\n\n /* if (!storeDataObject[type][resource].childrenObjects.hasOwnProperty('resources')) {\n storeDataObject[type][resource].childrenObjects.resources = {};\n }*/\n\n if (attribute) {\n (0, _utils.assign)(storeDataObject[type][resource].childrenObjects, attribute, (0, _utils.deepClone)(value));\n } else {\n storeDataObject[type][resource].childrenObjects = (0, _utils.deepClone)(value) || {};\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : storeDataObject;\n storage.set(db, 1, data, table).then(function () {\n return storeDataObject[type][resource];\n });\n }\n\n /**\n * @description should save and update the current dataObject information\n *\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {DataObjectURL} resource - dataObjectURL to be saved or updated;\n * @param {String} attribute - attribute inside the data which will be saved\n * @param {any} data - value will be saved inside the attribute;\n */\n\n }, {\n key: 'update',\n value: function update(isReporter, resource, attribute, value, updateRuntimeStatus) {\n\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - update] - not saved');\n return;\n }\n\n log.log('[StoreDataObjects - update] - ', isReporter, type, resource, attribute, value);\n\n if (storeDataObject[type] && storeDataObject[type][resource] && resource && attribute && value) {\n\n if (attribute === 'subscriptions' || attribute === 'subscriberUsers') {\n var update = true;\n\n if (attribute === 'subscriptions') {\n update = !this._isOwner(storeDataObject[type][resource], value);\n }\n\n if (update) this._updateToArray(storeDataObject[type], resource, attribute, value);\n } else {\n storeDataObject[type][resource][attribute] = value;\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : storeDataObject;\n storage.set(db, 1, data, table, updateRuntimeStatus).then(function () {\n return storeDataObject[type][resource];\n });\n }\n }\n\n /**\n * @description should delete stored information from the dataObject\n *\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {DataObjectURL} resource - dataObjectURL to be saved or updated;\n * @param {String} attribute - attribute inside the data which will be saved\n * @param {any} data - value will be saved inside the attribute;\n */\n\n }, {\n key: 'delete',\n value: function _delete(isReporter, resource, attribute, value) {\n\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - delete] - not saved');\n return;\n }\n\n if (storeDataObject[type] && storeDataObject[type][resource] && resource && attribute && value) {\n\n if (attribute === 'subscriptions' || attribute === 'subscriberUsers') {\n this._removeFromArray(storeDataObject[type], resource, attribute, value);\n } else {\n delete storeDataObject[type][resource][attribute];\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : storeDataObject;\n storage.set(db, 1, data, table);\n\n return storeDataObject[type][resource];\n }\n }\n\n /**\n * Delete Data Object from the storage\n */\n\n }, {\n key: 'deleteResource',\n value: function deleteResource(resource) {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (resource) {\n // return this.getAll().then((storedDataObjects) => {\n log.info('[DataObjectStorage.deleteResource] deleting: ', resource);\n\n // let this._storeDataObject = Object.assign(this._storeDataObject || {});\n\n var backup = void 0;\n var db = void 0;\n var storage = void 0;\n\n if (_this4._storeDataObject.hasOwnProperty('observers') && _this4._storeDataObject.observers.hasOwnProperty(resource)) {\n backup = _this4._storeDataObject.observers[resource].backup ? true : false;\n\n db = backup ? _this4._storeDataObject.observers[resource].url : 'syncherManager:ObjectURLs';\n storage = backup ? _this4._remotes[db] : _this4._storageManager;\n delete _this4._storeDataObject.observers[resource];\n }\n\n if (_this4._storeDataObject.hasOwnProperty('reporters') && _this4._storeDataObject.reporters.hasOwnProperty(resource)) {\n backup = _this4._storeDataObject.reporters[resource].backup ? true : false;\n\n db = backup ? _this4._storeDataObject.reporters[resource].url : 'syncherManager:ObjectURLs';\n storage = backup ? _this4._remotes[db] : _this4._storageManager;\n delete _this4._storeDataObject.reporters[resource];\n }\n\n // this._storeDataObject = this._storeDataObject;\n\n if (backup && storage) {\n storage.delete().then(function () {\n delete _this4._remotes[db];\n _this4._storageManager.delete(resource, null, 'remotes');\n });\n } else {\n storage.set(db, 1, _this4._storeDataObject);\n }\n\n return resolve();\n\n // });\n } else {\n reject(new Error('[StoreDataObjects] - Can\\'t delete this ' + resource));\n }\n });\n }\n }, {\n key: 'getAll',\n value: function getAll() {\n var _this5 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._storeDataObject = _this5._storageManager.get('syncherManager:ObjectURLs').then(function (objects) {\n _this._storeDataObject = objects;\n _this.loadRemote(true).then(function (storedObjects) {\n resolve(_this._storeDataObject);\n });\n });\n });\n // return this._storageManager.get('syncherManager:ObjectURLs');\n }\n\n // To sync local storage with remote storage server\n\n }, {\n key: 'sync',\n value: function sync(resource, backupRevision) {\n var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _this = this;\n\n if (_this._remotes[resource]) {\n\n var table = resource.split('/')[3];\n\n if (backupRevision) return _this._sync(resource, backupRevision, once, table);else _this._remotes[resource].getBackupRevision(resource).then(function (backupRevision) {\n return _this._sync(resource, backupRevision, once, table);\n });\n } else {\n var info = '[DataObjectStorage.sync] Info: ' + resource + ' is not synched with remote storage.';\n log.info(info);\n // reject(info);\n }\n }\n }, {\n key: '_sync',\n value: function _sync(resource, backupRevision, once, table) {\n var _this = this;\n\n console.log('[DataObjectStorage._sync] backupRevision: ', backupRevision);\n\n return new _promise2.default(function (resolve, reject) {\n\n var options = { table: table, observer: false, syncedRevision: backupRevision + 3 };\n\n _this._remotes[resource].connect(options).then(function () {\n\n _this._remotes[resource].get(null, null, table).then(function (dataObject) {\n // this._remotes[resource].get().then((dataObject)=>{\n log.info('[DataObjectStorage.sync] returning synched DO: ', dataObject);\n\n if (once) {\n setTimeout(function () {\n _this._remotes[resource].disconnect().then(function () {\n log.info('[DataObjectStorage.sync] disconnected ');\n // resolve(dataObject[resource]);\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error synching with remote storage');\n reject(error);\n });\n }, 2000);\n }\n resolve(dataObject[resource]);\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error retrieving stored data object');\n reject(error);\n });\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error connecting to remote storage ', error);\n _this._remotes[resource].get(null, null, table).then(function (dataObject) {\n log.info('[DataObjectStorage.sync] returning synched DO: ', dataObject);\n resolve(dataObject[resource]);\n });\n });\n });\n }\n }, {\n key: 'stopSync',\n value: function stopSync(resource) {\n\n if (this._remotes[resource]) this._remotes[resource].disconnect();\n }\n\n /**\n * @description should look for a specific dataObjectURL\n *\n * @param {DataObjectURL} resource - the dataObjectURL will be searched\n *\n * @returns Promise object with the dataObject information;\n */\n\n }, {\n key: 'getDataObject',\n value: function getDataObject(resource) {\n var _this6 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n /* this._remotes[resource].get().then((dataObject)=> {\n return resolve(dataObject);\n } , () => {\n this._storageManager.get('syncherManager:ObjectURLs').then((storedDataObject) => {*/\n\n var storedDataObject = _this6._storeDataObject;\n\n var observers = storedDataObject.hasOwnProperty('observers') ? storedDataObject.observers : {};\n var reporters = storedDataObject.hasOwnProperty('reporters') ? storedDataObject.reporters : {};\n\n var currentReporter = (0, _keys2.default)(reporters).find(function (value) {\n return value === resource;\n });\n var currentObserver = (0, _keys2.default)(observers).find(function (value) {\n return value === resource;\n });\n var dataObject = void 0;\n\n if (currentObserver) {\n dataObject = storedDataObject.observers[currentObserver];\n }\n if (currentReporter) {\n dataObject = storedDataObject.reporters[currentReporter];\n }\n\n log.info('[StoreDataObjects - getDataObject] - for observer: ', currentObserver);\n log.info('[StoreDataObjects - getDataObject] - for reporters: ', currentReporter);\n\n log.info('[StoreDataObjects - getDataObject] - resolve: ', dataObject);\n return dataObject ? resolve(dataObject) : reject('No dataObject was found');\n\n // });\n\n // });\n });\n }\n\n /**\n * @description should get the dataObject information by the message\n *\n * @param {Object} msg - message would be analised to get the current dataObject information\n * @param {Boolean} isReporter - the object to be saved is a reporter\n *\n * @returns Promise should retun an object with the dataObject or null\n */\n\n }, {\n key: 'getResourcesByCriteria',\n value: function getResourcesByCriteria(msg, isReporter) {\n var _this7 = this;\n\n return new _promise2.default(function (resolve) {\n\n var type = _this7._getTypeOfObject(isReporter);\n\n _this7.getAll(isReporter).then(function (storedDataObjects) {\n // let storedDataObjects = this._storeDataObject;\n\n if (!storedDataObjects) {\n log.log('[DataObjectsStorage.getResourcesByCriteria] don\\'t have stored data objects');\n return resolve(null);\n }\n\n if (msg.body && msg.body.hasOwnProperty('resume') && !msg.body.resume) {\n return resolve(null);\n }\n\n // check if the message have other criteria\n // if not search for on the 'from' of the message.\n var result = [];\n var hasSubscription = _this7._hasSubscription(storedDataObjects[type], msg.from);\n var isOwner = _this7._searchOwner(storedDataObjects[type], msg.from);\n var isToProtoStubResume = _this7._checkProtostubResume(storedDataObjects, msg);\n log.log('[StoredDataObjects - getResourcesByCriteria]:', storedDataObjects, msg, hasSubscription, isOwner);\n if (msg.hasOwnProperty('from') && hasSubscription || isOwner || isToProtoStubResume) {\n var resource = void 0;\n\n if (isOwner) {\n resource = _this7._getResourcesByOwner(storedDataObjects[type], msg.from);\n } else {\n resource = _this7._getResourcesBySubscription(storedDataObjects[type], msg.from);\n }\n\n var identityFoundData = [];\n if (msg.body && msg.body.identity) identityFoundData = _this7._getResourcesByIdentity(storedDataObjects[type], msg.body.identity);\n\n //TODO: remove schema since metadata already includes the schema?\n\n var schemaFoundData = [];\n if (msg.body && msg.body.schema) schemaFoundData = _this7._getResourcesBySchema(storedDataObjects[type], msg.body.schema);\n\n var metadataFound = [];\n if (msg.body && msg.body.value) {\n var metadata = msg.body.value;\n delete metadata.data;\n metadataFound = _this7._getResourcesByMetadata(storedDataObjects[type], metadata);\n }\n\n var dataFound = [];\n if (msg.body && msg.body.value && msg.body.value.data) dataFound = _this7._getResourcesByData(storedDataObjects[type], msg.body.value.data);\n\n // you can pass as arrays as you want.. it will be merged in on place\n // removed duplicates;\n result = _this7._intersection(resource, identityFoundData, schemaFoundData, dataFound, metadataFound);\n\n if (result.length == 0 && isToProtoStubResume && type == 'observers' && msg.from.split('protostub').length > 0) {\n var storedObservers = storedDataObjects[type];\n var fromDomain = (0, _utils.divideURL)(msg.from).domain;\n (0, _keys2.default)(storedObservers).filter(function (objectURL) {\n var subscriptions = storedObservers[objectURL].subscriptions;\n var hasSubscription = false;\n subscriptions.forEach(function (subscription) {\n var subscriptionDomain = (0, _utils.divideURL)(subscription).domain;\n if (subscriptionDomain == fromDomain) {\n result.push(objectURL);\n }\n });\n });\n }\n } else {\n return resolve(null);\n }\n\n var init = {};\n result.forEach(function (key) {\n var currentIsReporter = storedDataObjects[type][key];\n init[key] = currentIsReporter;\n return init;\n });\n\n log.log('[Store Data Objects] - ', init);\n\n resolve(init);\n });\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByIdentity',\n value: function _getResourcesByIdentity(storedData, userURL) {\n if (!storedData) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].subscriberUsers.filter(function (current) {\n return current === userURL;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByOwner',\n value: function _getResourcesByOwner(storedData, owner) {\n if (!storedData) return [];\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].reporter === owner;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesBySubscription',\n value: function _getResourcesBySubscription(storedData, subscription) {\n if (!storedData) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].subscriptions.filter(function (current) {\n return current === subscription;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesBySchema',\n value: function _getResourcesBySchema(storedData, schema) {\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n var currentObject = storedData[objectURL];\n return (0, _keys2.default)(currentObject).filter(function (key) {\n return key === 'schema' && currentObject[key] === schema;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByMetadata',\n value: function _getResourcesByMetadata(storedData, metadata) {\n if (!metadata) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n var currentObject = storedData[objectURL];\n return (0, _keys2.default)(currentObject).filter(function (key) {\n // search on storeDataObjects for specific key provided from data;\n return (0, _keys2.default)(metadata).filter(function (searchFor) {\n return key === searchFor && currentObject[key] === metadata[searchFor];\n }).length;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByData',\n value: function _getResourcesByData(storedData, data) {\n if (!data) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n var currentObject = storedData[objectURL].hasOwnProperty('data') ? storedData[objectURL].data : {};\n return (0, _keys2.default)(currentObject).filter(function (key) {\n // search on storeDataObjects for specific key provided from data;\n return (0, _keys2.default)(data).filter(function (searchFor) {\n return key === searchFor && currentObject[key] === data[searchFor];\n }).length;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_hasSubscription',\n value: function _hasSubscription(storedData, subscription) {\n if (!storedData) return false;\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].subscriptions.filter(function (current) {\n return current === subscription;\n }).length;\n }).length > 0 ? true : false;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_searchOwner',\n value: function _searchOwner(storedData, from) {\n if (!storedData) return false;\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].reporter === from;\n }).length > 0 ? true : false;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_checkProtostubResume',\n value: function _checkProtostubResume(storedDataObjects, msg) {\n\n if (!storedDataObjects) return false;\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('value') && msg.body.value.hasOwnProperty('reporter')) {\n var reporter = msg.body.value.reporter;\n if (storedDataObjects.hasOwnProperty('reporters')) {\n var reportersStored = storedDataObjects.reporters;\n return (0, _keys2.default)(reportersStored).filter(function (objectURL) {\n return reportersStored[objectURL].reporter === reporter;\n }).length > 0 ? true : false;\n } else {\n return false;\n }\n } else if (storedDataObjects.hasOwnProperty('observers')) {\n var storedObservers = storedDataObjects.observers;\n var fromDomain = (0, _utils.divideURL)(msg.from).domain;\n\n return (0, _keys2.default)(storedObservers).filter(function (objectURL) {\n var subscriptions = storedObservers[objectURL].subscriptions;\n var hasSubscription = false;\n subscriptions.forEach(function (subscription) {\n var subscriptionDomain = (0, _utils.divideURL)(subscription).domain;\n if (subscriptionDomain == fromDomain) {\n hasSubscription = true;\n }\n });\n if (hasSubscription) {\n return true;\n }\n }).length > 0 ? true : false;\n }\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_isOwner',\n value: function _isOwner(value, url) {\n if (!value) return false;\n return value.reporter === url ? true : false;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_intersection',\n value: function _intersection() {\n var args = (0, _from2.default)(arguments);\n\n var result = args.reduce(function (first, second) {\n return first.concat(second);\n }).filter(function (value, index, self) {\n return self.indexOf(value) === index;\n });\n log.log('DataObjectsStorage._intersection] Result an unique array of strings: ', result);\n return result;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_updateToArray',\n value: function _updateToArray(storeDataObject, resource, key, value) {\n log.log('[DataObjectsStorage] - _updateToArray: ', storeDataObject, resource, key, value);\n if (storeDataObject[resource][key].indexOf(value) === -1) storeDataObject[resource][key].push(value);\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_removeFromArray',\n value: function _removeFromArray(storeDataObject, resource, key, value) {\n var indexOfValue = storeDataObject[resource][key].indexOf(value);\n if (indexOfValue === -1) storeDataObject[resource][key].splice(indexOfValue, 1);\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_hasValue',\n value: function _hasValue(obj, key, value) {\n return obj.hasOwnProperty(key) && obj[key] === value;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getTypeOfObject',\n value: function _getTypeOfObject(isReporter) {\n return isReporter ? 'reporters' : 'observers';\n }\n }]);\n return DataObjectsStorage;\n}();\n\nexports.default = DataObjectsStorage;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zdG9yZS1vYmplY3RzL0RhdGFPYmplY3RzU3RvcmFnZS5qcz9lOTU2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignRGF0YU9iamVjdHNTdG9yYWdlJyk7XG5cbmltcG9ydCB7IGFzc2lnbiwgZGVlcENsb25lLCBkaXZpZGVVUkwgfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmltcG9ydCB7IGNyZWF0ZVN5bmNEQiB9IGZyb20gJy4uL3J1bnRpbWUvU3RvcmFnZSc7XG5cbmNsYXNzIERhdGFPYmplY3RzU3RvcmFnZSB7XG5cbiAgY29uc3RydWN0b3Ioc3RvcmFnZU1hbmFnZXIsIHN0b3JlZERhdGFPYmplY3RzID0ge30sIGZhY3RvcnksIHJ1bnRpbWVTdGF0dXNVcGRhdGUpIHtcbiAgICBpZiAoIXN0b3JhZ2VNYW5hZ2VyKSB0aHJvdyBuZXcgRXJyb3IoJ1tTdG9yZSBEYXRhIE9iamVjdHNdIC0gTmVlZHMgdGhlIHN0b3JhZ2VNYW5hZ2VyIGNvbXBvbmVudCcpO1xuXG4gICAgdGhpcy5fc3RvcmFnZU1hbmFnZXIgPSBzdG9yYWdlTWFuYWdlcjtcblxuICAgIHRoaXMuX3N0b3JlRGF0YU9iamVjdCA9IHN0b3JlZERhdGFPYmplY3RzO1xuXG4gICAgdGhpcy5fY2FjaGUgPSB7fTtcblxuICAgIHRoaXMuX2NyZWF0ZVN5bmNEQiA9IGNyZWF0ZV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50aGVuKCgpID0+IHtcbiAgICAgICAgICAgIGxvZy5sb2coJ1tTdG9yZURhdGFPYmplY3RzLmxvYWRSZW1vdGVdIGxvYWRlZC4gU3RhcnRpbmcgaW5pdCcpO1xuICAgICAgICAgICAgLy9UT0RPOiBpbml0IHRoaXMuX3N0b3JlRGF0YU9iamVjdCB3aXRoIGxvYWRlZCBkYXRhIG9iamVjdHNcbiAgICAgICAgICAgIE9iamVjdC5rZXlzKF90aGlzLl9yZW1vdGVzKS5mb3JFYWNoKChyZW1vdGUpID0+IHtcbiAgICAgICAgICAgICAgbGV0IHRhYmxlID0gcmVtb3RlLnNwbGl0KCcvJylbM107XG4gICAgICAgICAgICAgIGxvYWRpbmdEQnMucHVzaChfdGhpcy5fcmVtb3Rlc1tyZW1vdGVdLmdldChudWxsLG51bGwsdGFibGUpKTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgUHJvbWlzZS5hbGwobG9hZGluZ0RCcykudGhlbigoZGF0YU9ianMpID0+IHtcblxuICAgICAgICAgICAgICBkYXRhT2Jqcy5mb3JFYWNoKChkTyk9PiB7XG4gICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoZE8pLmZvckVhY2goKHVybCk9PiB7XG4gICAgICAgICAgICAgICAgICBsb2cubG9nKCdbU3RvcmVEYXRhT2JqZWN0cy5sb2FkUmVtb3RlXSBsb2FkZWQgcmVtb3RlICcsIGRPKTtcblxuICAgICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgIGlmIChkT1tyZW1vdGVdLmlzUmVwb3J0ZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHR5cGUgPSB0aGlzLl9nZXRUeXBlT2ZPYmplY3QoZE9bdXJsXS5pc1JlcG9ydGVyKTtcbiAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgIGlmICghX3RoaXMuX3N0b3JlRGF0YU9iamVjdCkgX3RoaXMuX3N0b3JlRGF0YU9iamVjdCA9IHt9O1xuICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICAgaWYgKCFfdGhpcy5fc3RvcmVEYXRhT2JqZWN0Lmhhc093blByb3BlcnR5KHR5cGUpKSBfdGhpcy5fc3RvcmVEYXRhT2JqZWN0W3R5cGVdID0ge307XG5cbi8vICAgICAgICAgICAgICAgICAgICAgIGxldCBiYWNrdXBSZXZpc2lvbiBcblxuICAgICAgICAgICAgICAgICAgICAgIGxldCBzeW5jaGluZyA9IFtdO1xuXG4gICAgICAgICAgICAgICAgICAgICAgc3luY2hpbmcucHVzaChcbiAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLl9zeW5jKHVybCwgZE9bdXJsXS5kYXRhLmJhY2t1cFJldmlzaW9uLCB0cnVlLCB1cmwuc3BsaXQoJy8nKVszXSApLnRoZW4oKHN5bmNoZWRPYmopPT57XG4gICAgICAgICAgICAgICAgICAgICAgICAgIF90aGlzLl9zdG9yZURhdGFPYmplY3RbdHlwZV1bdXJsXSA9IHN5bmNoZWRPYmo7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIGxvZy5sb2coJ1tTdG9yZURhdGFPYmplY3RzLmxvYWRSZW1vdGVdIHN0b3JlRGF0YU9iamVjdCB1cGRhdGVkOiAnLCBfdGhpcy5fc3RvcmVEYXRhT2JqZWN0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgICAgICBQcm9taXNlLmFsbChzeW5jaGluZykudGhlbigoKT0+e1xuICAgICAgICAgICAgICAgICAgICAgIHJlc29sdmUoX3RoaXMuX3N0b3JlRGF0YU9iamVjdCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgX3RoaXMuX3JlbW90ZXNbdXJsXS5kaXNjb25uZWN0KCkudGhlbigoKT0+e1xuICAgICAgICAgICAgICAgICAgICAgICAgbG9nLmxvZygnW0RhdGFPYmplY3RTdG9yYWdlLmxvYWRSZW1vdGVdIGRpc2Nvbm5lY3RlZCAnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgfSwoZXJyb3IpPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgIGxvZy5lcnJvcignW0RhdGFPYmplY3RTdG9yYWdlLnN5bmNdIEVycm9yIHN5bmNoaW5nIHdpdGggcmVtb3RlIHN0b3JhZ2UnKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgICB9LCAxMDAwKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgXG4gICAgICAgICAgICAgfSk7XG4gICAgIFxuICAgICAgICB9ICwgKGVycm9yKSA9PiB7cmVqZWN0KGVycm9yKX0pO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICB9KTtcblxuLy8gICAgICAgIHJlc29sdmUoKTtcblxuICAgIH0pO1xuICB9XG5cbiAgLyoqXG4gICAqIEBkZXNjcmlwdGlvbiBzaG91bGQgc2V0IHRoZSBpbml0aWFsIHN0YXRlIG9mIHRoZSBkYXRhT2JqZWN0VVJMIHRvIGJlIHJlc3VtZWQgaWYgbmVjZXNzYXJ5O1xuICAgKlxuICAgKiBAcGFyYW0ge0RhdGFPYmplY3RVUkx9IHVybCAtIGRhdGFPYmplY3RVUkwgdG8gYmUgc2F2ZWQ7XG4gICAqIEBwYXJhbSB7Qm9vbGVhbn0gaXNSZXBvcnRlciAtIHRoZSBvYmplY3QgdG8gYmUgc2F2ZWQgaXMgYSByZXBvcnRlclxuICAgKiBA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3QoKS50aGVuKCgpPT57XG4gICAgICAgICAgICAgICAgICAgICAgbG9nLmluZm8oJ1tEYXRhT2JqZWN0U3RvcmFnZS5zeW5jXSBkaXNjb25uZWN0ZWQgJyk7XG4vLyAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRhdGFPYmplY3RbcmVzb3VyY2VdKTtcbiAgICAgICAgICAgICAgICAgIH0sKGVycm9yKT0+IHtcbiAgICAgICAgICAgICAgICAgICAgbG9nLmVycm9yKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gRXJyb3Igc3luY2hpbmcgd2l0aCByZW1vdGUgc3RvcmFnZScpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICB9LCAyMDAwKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICByZXNvbHZlKGRhdGFPYmplY3RbcmVzb3VyY2VdKTtcbiAgICAgICAgICAgICAgfSAsIChlcnJvcikgPT4ge1xuICAgICAgICAgICAgbG9nLmVycm9yKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gRXJyb3IgcmV0cmlldmluZyBzdG9yZWQgZGF0YSBvYmplY3QnKTtcbiAgICAgICAgICAgIHJlamVjdChlcnJvcilcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSwgKGVycm9yKSA9PiB7XG4gICAgICAgICAgbG9nLmVycm9yKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gRXJyb3IgY29ubmVjdGluZyB0byByZW1vdGUgc3RvcmFnZSAnLCBlcnJvcik7XG4gICAgICAgICAgX3RoaXMuX3JlbW90ZXNbcmVzb3VyY2VdLmdldChudWxsLG51bGwsdGFibGUpLnRoZW4oKGRhdGFPYmplY3QpPT57XG4gICAgICAgICAgICAgIGxvZy5pbmZvKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gcmV0dXJuaW5nIHN5bmNoZWQgRE86IC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XJzID0gc3RvcmVkRGF0YU9iamVjdHNbdHlwZV07XG4gICAgICAgICAgICBsZXQgZnJvbURvbWFpbiA9IGRpdmlkZVVSTChtc2cuZnJvbSkuZG9tYWluO1xuICAgICAgICAgICAgT2JqZWN0LmtleXMoc3RvcmVkT2JzZXJ2ZXJzKS5maWx0ZXIoKG9iamVjdFVSTCkgPT4ge1xuICAgICAgICAgICAgICBsZXQgc3Vic2NyaXB0aW9ucyA9IHN0b3JlZE9ic2VydmVyc1tvYmplY3RVUkxdLnN1YnNjcmlwdGlvbnM7XG4gICAgICAgICAgICAgIGxldCBoYXNTdWJzY3JpcHRpb24gPSBmYWxzZTtcbiAgICAgICAgICAgICAgc3Vic2NyaXB0aW9ucy5mb3JFYWNoKGZ1bmN0aW9uKHN1YnNjcmlwdGlvbikge1xuICAgICAgICAgICAgICAgIGxldCBzdWJzY3JpcHRpb25Eb21haW4gPSBkaXZpZGVVUkwoc3Vic2NyaXB0aW9uKS5kb21haW47XG4gICAgICAgICAgICAgICAgaWYgKHN1YnNjcmlwdGlvbkRvbWFpbiA9PSBmcm9tRG9tYWluKSB7XG4gICAgICAgICAgICAgICAgICByZXN1bHQucHVzaChvYmplY3RVUkwpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KVxuICAgICAgICAgIH1cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXR1cm4gcmVzb2x2ZShudWxsKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGxldCBpbml0ID0ge307XG4gICAgICAgIHJlc3VsdC5mb3JFYWNoKChrZXkpID0+IHtcbiAgICAgICAgICBsZXQgY3VycmVudElzUmVwb3J0ZXIgPSBzdG9yZWREYXRhT2JqZWN0c1t0eXBlXVtrZXldO1xuICAgICAgICAgIGluaXRba2V5XSA9IGN1cnJlbnRJc1JlcG9ydGVyO1xuICAgICAgICAgIHJldHVybiBpbml0O1xuICAgICAgICB9KTtcblxuICAgICAgICBs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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///531\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(80);\n__webpack_require__(533);\nmodule.exports = __webpack_require__(11).Array.from;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9hcnJheS9mcm9tLmpzP2U3MzciXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5hcnJheS5mcm9tJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5BcnJheS5mcm9tO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2FycmF5L2Zyb20uanNcbi8vIG1vZHVsZSBpZCA9IDUzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///532\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar ctx = __webpack_require__(69);\nvar $export = __webpack_require__(26);\nvar toObject = __webpack_require__(76);\nvar call = __webpack_require__(197);\nvar isArrayIter = __webpack_require__(198);\nvar toLength = __webpack_require__(133);\nvar createProperty = __webpack_require__(534);\nvar getIterFn = __webpack_require__(143);\n\n$export($export.S + $export.F * !__webpack_require__(203)(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5mcm9tLmpzP2FiMjIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhci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0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5mcm9tLmpzXG4vLyBtb2R1bGUgaWQgPSA1MzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///533\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $defineProperty = __webpack_require__(44);\nvar createDesc = __webpack_require__(79);\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jcmVhdGUtcHJvcGVydHkuanM/N2MxNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGRlZmluZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBpbmRleCwgdmFsdWUpIHtcbiAgaWYgKGluZGV4IGluIG9iamVjdCkgJGRlZmluZVByb3BlcnR5LmYob2JqZWN0LCBpbmRleCwgY3JlYXRlRGVzYygwLCB2YWx1ZSkpO1xuICBlbHNlIG9iamVjdFtpbmRleF0gPSB2YWx1ZTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY3JlYXRlLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA1MzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///534\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _PromiseQueue = __webpack_require__(536);\n\nvar _PromiseQueue2 = _interopRequireDefault(_PromiseQueue);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('HypertyResourcesStorage'); // Log System\n\nvar HypertyResourcesStorage = function () {\n function HypertyResourcesStorage(runtimeURL, bus, storageManager, hypertyResources) {\n (0, _classCallCheck3.default)(this, HypertyResourcesStorage);\n\n\n if (!storageManager) throw new Error('[HypertyResourcesStorage constructor] mandatory storageManager parameter missing');\n if (!runtimeURL) throw new Error('[HypertyResourcesStorage constructor] mandatory runtimeURL parameter missing');\n if (!bus) throw new Error('[HypertyResourcesStorage constructor] mandatory bus parameter missing');\n\n var _this = this;\n\n _this._bus = bus;\n\n _this._storageLimit = 0.9; // the save storageLimit;\n\n _this._url = runtimeURL + '/storage';\n\n _this._storageManager = storageManager;\n\n _this.promiseQueue = new _PromiseQueue2.default();\n\n _this._hypertyResources = hypertyResources;\n\n bus.addListener(_this._url, function (msg) {\n log.info('[HypertyResourcesStorage] Message RCV: ', msg);\n switch (msg.type) {\n case 'create':\n _this._onCreate(msg);break;\n case 'read':\n _this._onRead(msg);break;\n case 'delete':\n _this._onDelete(msg);break;\n }\n });\n }\n\n /**\n * check the available storage quota\n *\n * @memberof HypertyResourcesStorage\n */\n\n\n (0, _createClass3.default)(HypertyResourcesStorage, [{\n key: 'checkStorageQuota',\n value: function checkStorageQuota() {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this2._availableQuota && _this2._usage) {\n return resolve((0, _utils.availableSpace)(_this2._usage, _this2._availableQuota));\n }\n\n if (navigator) {\n\n navigator.storage.estimate().then(function (estimate) {\n _this2._availableQuota = estimate.quota;\n _this2._usage = estimate.usage;\n resolve((0, _utils.availableSpace)(_this2._usage, _this2._availableQuota));\n }).catch(function (reason) {\n log.error('[HypertyResourcesStorage] CheckStorageQuota error: ', reason);\n reject(reason);\n });\n }\n });\n }\n\n /**\n * @description should save an HypertyResource contained in the body of a create message request;\n *\n * @param {string} message - message containing the hyperty resource to be stored\n */\n\n }, {\n key: '_onCreate',\n value: function _onCreate(message) {\n\n var _this = this;\n\n if (!message.body || !message.body.value) throw new Error('[HypertyResourcesStorage._onCreate] mandatory message body value missing: ', message);\n\n var content = message.body.value;\n var contentURL = content.contentURL;\n var resourceURL = '';\n\n if (!contentURL) {\n\n contentURL = [];\n resourceURL = _this._url + '/' + (0, _utils.generateGUID)();\n } else {\n var currentURL = contentURL[0];\n var resource = currentURL.substr(currentURL.lastIndexOf('/') + 1);\n resourceURL = _this._url + '/' + resource;\n }\n\n if (!_this._hypertyResources.hasOwnProperty(resourceURL)) {\n\n contentURL.push(resourceURL);\n content.contentURL = contentURL;\n }\n\n this._hypertyResources[resourceURL] = content;\n\n this.promiseQueue.add(this._toSave(resourceURL, message, content));\n }\n }, {\n key: '_toSave',\n value: function _toSave(resourceURL, message, content) {\n var _this3 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var error = function error(reason) {\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { value: resourceURL, code: 500, description: reason }\n };\n\n _this3._bus.postMessage(response);\n\n return reject(reason);\n };\n\n _this3.checkStorageQuota().then(function (result) {\n\n if (content.size > result.quota) {\n var msg = 'The storage do not have space to store that resource';\n error(msg);\n throw Error(msg);\n }\n\n var spaceAvailable = result.quota;\n var allocated = result.usage + content.size;\n\n if (result.percent >= _this3._storageLimit || allocated > spaceAvailable) {\n return _this3._getOlderResources(content.size);\n } else {\n return true;\n }\n }).then(function () {\n return _this3._storageManager.set(resourceURL, 1, content);\n }).then(function () {\n\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { value: resourceURL, code: 200 }\n };\n\n _this3._bus.postMessage(response);\n\n log.log('Success');\n\n return resolve();\n }).catch(error);\n });\n }\n }, {\n key: '_getOlderResources',\n value: function _getOlderResources(size) {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this4._storageManager.get().then(function (result) {\n\n var resources = (0, _keys2.default)(result);\n\n var total = 0;\n var reduced = resources.sort(function (a, b) {\n return result[a].created < result[b].created;\n }).reduce(function (previousResource, currentResource) {\n var current = _this4._hypertyResources[currentResource];\n\n log.log('[HypertyResourcesStorage] _getOlderResources: ', total, size, currentResource, _this4._availableQuota);\n\n if (total <= size) {\n total += current.size;\n previousResource.push(currentResource);\n }\n\n return previousResource;\n }, []);\n\n var deleting = reduced.map(function (key) {\n return _this4._storageManager.delete(key);\n });\n\n _promise2.default.all(deleting).then(function () {\n resolve(true);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n });\n }\n\n /**\n * @description should return an HypertyResource stored in the Storage Manager identified by the content url contained in the body of a read message request;\n *\n * @param {string} message - message containing the hyperty resource to be stored\n */\n\n }, {\n key: '_onRead',\n value: function _onRead(message) {\n\n var _this = this;\n\n if (!message.body || !message.body.resource) throw new Error('[HypertyResourcesStorage._onRead] mandatory message body resource missing: ', message);\n\n var contentUrl = message.body.resource;\n\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: {}\n };\n\n // let content = _this._hypertyResources[contentUrl];\n\n log.info('[HypertyResourcesStorage._onRead] get resourceURL:', contentUrl);\n\n this._storageManager.get('resourceURL', contentUrl).then(function (content) {\n\n log.info('[HypertyResourcesStorage._onRead] found content:', content);\n\n if (content) {\n\n if (content.resourceType === 'file') {\n _this._onReadFile(response, content);\n } else {\n response.body.code = 200;\n response.body.p2p = true;\n response.body.value = content;\n _this._bus.postMessage(response);\n }\n } else {\n response.body.code = 404;\n response.body.desc = 'Content Not Found for ' + contentUrl;\n _this._bus.postMessage(response);\n }\n });\n\n //response.body.code = 404;\n\n //_this._hypertyResources[contentUrl] = message.body.value;\n\n }\n }, {\n key: '_onReadFile',\n value: function _onReadFile(response, resource) {\n var _this = this;\n\n var reader = new FileReader();\n\n reader.onload = function (theFile) {\n\n log.info('[FileHypertyResource.init] file loaded ', theFile);\n\n response.body.code = 200;\n response.body.p2p = true;\n response.body.value = (0, _utils.deepClone)(resource);\n response.body.value.content = theFile.target.result;\n _this._bus.postMessage(response);\n };\n\n if (resource.mimetype.includes('text/')) {\n reader.readAsText(resource.content);\n } else {\n var current = resource.content;\n\n var blob = void 0;\n if (Array.isArray(current)) {\n blob = new Blob(current, { type: resource.mimetype });\n } else {\n blob = new Blob([current], { type: resource.mimetype });\n }\n\n reader.readAsArrayBuffer(blob);\n }\n }\n\n /**\n * @description should delete an HypertyResource from the storage;\n *\n * @param {string} message - message containing the content URL of the hyperty resource to be deleted\n */\n\n }, {\n key: '_onDelete',\n value: function _onDelete(message) {\n\n var _this = this;\n\n if (!message.body) throw new Error('[HypertyResourcesStorage._onDelete] mandatory message body missing: ', message);\n\n if (message.body.resource) {\n delete _this._hypertyResources[message.body.resource];\n } else if (message.body.resources) {\n message.body.resources.forEach(function (resource) {\n delete _this._hypertyResources[resource];\n });\n } else {\n throw new Error('[HypertyResourcesStorage._onDelete] mandatory resource missing: ', message);\n }\n\n _this._storageManager.delete('resourceURL', message.body.resource).then(function () {\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { code: 200 }\n };\n\n _this._bus.postMessage(response);\n }).catch(function (reason) {\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { code: 400, description: reason }\n };\n\n _this._bus.postMessage(response);\n });\n }\n }]);\n return HypertyResourcesStorage;\n}();\n\nexports.default = HypertyResourcesStorage;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0h5cGVydHlSZXNvdXJjZXNTdG9yYWdlLmpzP2I5YzkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdIeXBlcnR5UmVzb3VyY2VzU3RvcmFnZScpO1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RlbnQuY29udGVudFVSTDtcbiAgICBsZXQgcmVzb3VyY2VVUkwgPSAnJztcblxuICAgIGlmICghY29udGVudFVSTCkge1xuXG4gICAgICBjb250ZW50VVJMID0gW107XG4gICAgICByZXNvdXJjZVVSTCA9IF90aGlzLl91cmwgKyAnLycgKyBnZW5lcmF0ZUdVSUQoKTtcblxuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBjdXJyZW50VVJMID0gY29udGVudFVSTFswXTtcbiAgICAgIGNvbnN0IHJlc291cmNlID0gY3VycmVudFVSTC5zdWJzdHIoY3VycmVudFVSTC5sYXN0SW5kZXhPZignLycpICsgMSk7XG4gICAgICByZXNvdXJjZVVSTCA9IF90aGlzLl91cmwgKyAnLycgKyByZXNvdXJjZTtcbiAgICB9XG5cbiAgICBpZiAoIV90aGlzLl9oeXBlcnR5UmVzb3VyY2VzLmhhc093blByb3BlcnR5KHJlc291cmNlVVJMKSkge1xuXG4gICAgICBjb250ZW50VVJMLnB1c2gocmVzb3VyY2VVUkwpO1xuICAgICAgY29udGVudC5jb250ZW50VVJMID0gY29udGVudFVSTDtcblxuICAgIH1cblxuICAgIHRoaXMuX2h5cGVydHlSZXNvdXJjZXNbcmVzb3VyY2VVUkxdID0gY29udGVudDtcblxuICAgIHRoaXMucHJvbWlzZVF1ZXVlLmFkZCh0aGlzLl90b1NhdmUocmVzb3VyY2VVUkwsIG1lc3NhZ2UsIGNvbnRlbnQpKTtcblxuICB9XG5cbiAgX3RvU2F2ZShyZXNvdXJjZVVSTCwgbWVzc2FnZSwgY29udGVudCkge1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgY29uc3QgZXJyb3IgPSAocmVhc29uKSA9PiB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHtcbiAgICAgICAgICBmcm9tOiBtZXNzYWdlLnRvLFxuICAgICAgICAgIHRvOiBtZXNzYWdlLmZyb20sXG4gICAgICAgICAgaWQ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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTEE7QUFDQTtBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFMQTtBQUNBO0FBT0E7QUFDQTtBQUVBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///535\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _toConsumableArray2 = __webpack_require__(537);\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PromiseQueue = function () {\n\n // TODO: Improve this Queuing\n function PromiseQueue(concurrency) {\n (0, _classCallCheck3.default)(this, PromiseQueue);\n\n this.flushing = false;\n this.Promise = _promise2.default;\n this.concurrency = typeof concurrency !== 'number' ? 1 : concurrency;\n this.promises = [];\n this.queue = [];\n this.isProcessing = false;\n }\n\n (0, _createClass3.default)(PromiseQueue, [{\n key: 'done',\n value: function done(cb) {\n this.callback = cb;\n }\n }, {\n key: 'add',\n value: function add(promise) {\n var _this = this;\n\n this.queue.push(promise);\n\n if (!this.isProcessing) {\n return this.queue.reduce(function (promiseChain, currentTask) {\n return promiseChain.then(function (chainResults) {\n return currentTask.then(function (currentResult) {\n return [].concat((0, _toConsumableArray3.default)(chainResults), [currentResult]);\n });\n });\n }, _promise2.default.resolve([])).then(function (arrayOfResults) {\n // Do something with all results\n _this.isProcessing = false;\n });\n }\n }\n }]);\n return PromiseQueue;\n}();\n\nexports.default = PromiseQueue;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9Qcm9taXNlUXVldWUuanM/MDViZCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBQcm9taXNlUXVldWUge1xuXG4gIC8vIFRPRE86IEltcHJvdmUgdGhpcyBRdWV1aW5nXG4gIGNvbnN0cnVjdG9yKGNvbmN1cnJlbmN5KSB7XG4gICAgdGhpcy5mbHVzaGluZyA9IGZhbHNlO1xuICAgIHRoaXMuUHJvbWlzZSA9IFByb21pc2U7XG4gICAgdGhpcy5jb25jdXJyZW5jeSA9ICh0eXBlb2YgY29uY3VycmVuY3kgIT09ICdudW1iZXInKSA/IDEgOiBjb25jdXJyZW5jeTtcbiAgICB0aGlzLnByb21pc2VzID0gW107XG4gICAgdGhpcy5xdWV1ZSA9IFtdO1xuICAgIHRoaXMuaXNQcm9jZXNzaW5nID0gZm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QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///536\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _from = __webpack_require__(219);\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90b0NvbnN1bWFibGVBcnJheS5qcz8xYWVlIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2Zyb20gPSByZXF1aXJlKFwiLi4vY29yZS1qcy9hcnJheS9mcm9tXCIpO1xuXG52YXIgX2Zyb20yID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfZnJvbSk7XG5cbmZ1bmN0aW9uIF9pbnRlcm9wUmVxdWlyZURlZmF1bHQob2JqKSB7IHJldHVybiBvYmogJiYgb2JqLl9fZXNNb2R1bGUgPyBvYmogOiB7IGRlZmF1bHQ6IG9iaiB9OyB9XG5cbmV4cG9ydHMuZGVmYXVsdCA9IGZ1bmN0aW9uIChhcnIpIHtcbiAgaWYgKEFycmF5LmlzQXJyYXkoYXJyKSkge1xuICAgIGZvciAodmFyIGkgPSAwLCBhcnIyID0gQXJyYXkoYXJyLmxlbmd0aCk7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcbiAgICAgIGFycjJbaV0gPSBhcnJbaV07XG4gICAgfVxuXG4gICAgcmV0dXJuIGFycjI7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuICgwLCBfZnJvbTIuZGVmYXVsdCkoYXJyKTtcbiAgfVxufTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvdG9Db25zdW1hYmxlQXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDUzN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///537\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _values = __webpack_require__(220);\n\nvar _values2 = _interopRequireDefault(_values);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nvar _ReporterObject = __webpack_require__(542);\n\nvar _ReporterObject2 = _interopRequireDefault(_ReporterObject);\n\nvar _ObserverObject = __webpack_require__(543);\n\nvar _ObserverObject2 = _interopRequireDefault(_ObserverObject);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar cryptoManager = _interopRequireWildcard(_CryptoManager);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('SyncherManager'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n//import { schemaValidation } from '../utils/schemaValidation';\n\n/**\n * @author micaelpedrosa@gmail.com\n * Core Syncronization system.\n */\nvar SyncherManager = function () {\n /* private\n _url: URL\n _bus: MiniBus\n _registry: Registry\n _allocator: AddressAllocation\n _reporters: { ObjectURL: ReporterObject }\n _observers: { ObjectURL: ObserverObject }\n */\n\n function SyncherManager(runtimeURL, bus, registry, catalog, storageManager, allocator, storeDataObjects, identityModule) {\n (0, _classCallCheck3.default)(this, SyncherManager);\n\n if (!runtimeURL) throw new Error('[Syncher Manager] - needs the runtimeURL parameter');\n if (!bus) throw new Error('[Syncher Manager] - needs the MessageBus instance');\n if (!registry) throw new Error('[Syncher Manager] - needs the Registry instance');\n if (!catalog) throw new Error('[Syncher Manager] - needs the RuntimeCatalogue instance');\n if (!storageManager) throw new Error('[Syncher Manager] - need the storageManager instance');\n\n var _this = this;\n\n _this._bus = bus;\n _this._registry = registry;\n _this._catalog = catalog;\n _this._storageManager = storageManager;\n _this._identityModule = identityModule;\n\n //TODO: these should be saved in persistence engine?\n _this.runtimeURL = runtimeURL;\n _this._url = runtimeURL + '/sm';\n _this._objectURL = runtimeURL + '/object-allocation';\n\n _this._reporters = {};\n _this._observers = {};\n\n _this._dataObjectsStorage = storeDataObjects;\n console.log('[NOTSAVING] storeDataObjects', storeDataObjects);\n //TODO: this should not be hardcoded!\n _this._domain = (0, _utils.divideURL)(runtimeURL).domain;\n\n if (allocator) {\n _this._allocator = allocator;\n } else {\n _this._allocator = _AddressAllocation2.default.instance;\n }\n\n log.log('[SyncherManager - AddressAllocation] - ', _this._allocator);\n\n bus.addListener(_this._url, function (msg) {\n log.info('[SyncherManager] RCV: ', msg);\n switch (msg.type) {\n case 'create':\n _this._onCreate(msg);break;\n case 'delete':\n _this._onDelete(msg);break;\n case 'subscribe':\n _this._onLocalSubscribe(msg);break;\n case 'unsubscribe':\n _this._onLocalUnSubscribe(msg);break;\n case 'read':\n _this._onRead(msg);break;\n case 'execute':\n _this._onExecute(msg);break;\n }\n });\n }\n\n (0, _createClass3.default)(SyncherManager, [{\n key: '_onExecute',\n\n\n //FLOW-IN: message received from Syncher -> read\n value: function _onExecute(msg) {\n\n var _this = this;\n\n var reply = {\n type: 'response',\n from: msg.to,\n to: msg.from,\n id: msg.id\n };\n\n log.info('[SyncherManager.onExecute] new message', msg);\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('method') && msg.body.hasOwnProperty('params')) {\n\n switch (msg.body.method) {\n case 'sync':\n _this._dataObjectsStorage.sync(msg.body.params[0], msg.body.params[1], false);\n break;\n case 'stopSync':\n _this._dataObjectsStorage.stopSync(msg.body.params[0]);\n break;\n }\n\n reply.body = {\n code: 200\n };\n\n _this._bus.postMessage(reply);\n } else {\n reply.body = {\n code: 400,\n desc: 'missing body or body method / params mandatory fields'\n };\n\n log.error('[SyncherManager.onExecute] error. Missing body or body method / params mandatory fields', msg);\n\n _this._bus.postMessage(reply);\n }\n }\n\n //FLOW-IN: message received from Syncher -> read\n\n }, {\n key: '_onRead',\n value: function _onRead(msg) {\n\n var _this = this;\n\n var reply = {\n type: 'response',\n from: msg.to,\n to: msg.from,\n id: msg.id\n };\n log.info('[SyncherManager.onRead] new message', msg);\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('resource')) {\n _this._dataObjectsStorage.sync(msg.body.resource, criteria.backupRevision, true).then(function (dataObject) {\n reply.body = {\n code: 200,\n value: dataObject\n };\n\n log.info('[SyncherManager.onRead] found object: ', dataObject);\n\n _this._bus.postMessage(reply);\n }, function (error) {\n reply.body = {\n code: 400,\n desc: error\n };\n\n log.error('[SyncherManager.onRead] error: ', error);\n\n _this._bus.postMessage(reply);\n });\n } else {\n reply.body = {\n code: 400,\n desc: 'missing body or body resource mandatory fields'\n };\n\n log.error('[SyncherManager.onRead] error. Missing body or body resource mandatory fields', msg);\n\n _this._bus.postMessage(reply);\n }\n }\n\n //FLOW-IN: message received from Syncher -> create\n\n }, {\n key: '_onCreate',\n value: function _onCreate(msg) {\n var _this2 = this;\n\n var from = msg.from;\n var to = msg.to;\n var _this = this;\n\n // check if message is to save new childrenObjects in the local storage\n // TODO: check if message is to store new child in the local storage and call storeChild. How to distinguish from others?\n\n //debugger;\n if (msg.body.attribute) {\n this._storeChildrens(msg);\n } else {\n\n if (!msg.body.hasOwnProperty('resume') || msg.body.hasOwnProperty('resume') && !msg.body.resume) {\n\n // check if this is an invitation message\n if (msg.body.authorise) {\n this._authorise(msg);\n log.info('[SyncherManager.onCreate - invite observers]', msg);\n } else {\n // this is to create a new data object\n log.info('[SyncherManager.onCreate - Create New Object]', msg);\n this._newCreate(msg);\n }\n } else {\n\n // If from the hyperty side, call the resumeReporter we will have resume = true'\n // so we will create an resumed object and will try to resume the object previously saved;\n this._dataObjectsStorage.getResourcesByCriteria(msg, true).then(function (result) {\n\n log.info('[SyncherManager - Create Resumed] - ResourcesByCriteria | Message: ', msg, ' result: ', result);\n\n if (result && (0, _keys2.default)(result).length > 0) {\n\n var listOfReporters = [];\n\n (0, _keys2.default)(result).forEach(function (objURL) {\n\n listOfReporters.push(_this._resumeCreate(msg, result[objURL]));\n });\n\n _promise2.default.all(listOfReporters).then(function (resumedReporters) {\n log.log('[SyncherManager - Create Resumed]', resumedReporters);\n\n // TODO: shoud send the information if some object was failing;\n var successfullyResumed = (0, _values2.default)(resumedReporters).filter(function (reporter) {\n return reporter !== false;\n });\n\n log.info('[SyncherManager.onCreate] returning resumed objects : ', successfullyResumed);\n\n //FLOW-OUT: message response to Syncher -> create resume\n _this2._bus.postMessage({\n id: msg.id, type: 'response', from: to, to: from,\n body: { code: 200, value: (0, _utils.deepClone)(successfullyResumed) }\n });\n\n /*successfullyResumed.forEach((reporter) => {\n if (reporter.backup) {\n this._dataObjectsStorage.sync(reporter.url);\n }\n });*/\n });\n } else {\n //forward to hyperty:\n var reply = {};\n reply.id = msg.id;\n reply.from = msg.to;\n reply.to = msg.from;\n reply.type = 'response';\n reply.body = {\n code: 404,\n desc: 'No data objects reporters to be resumed'\n };\n _this2._bus.postMessage(reply);\n }\n });\n }\n }\n }\n }, {\n key: '_storeChildrens',\n value: function _storeChildrens(msg) {\n var _this = this;\n\n var resource = msg.body.resource;\n var attribute = msg.body.attribute;\n\n if (attribute === 'childrenObjects') {\n _this._dataObjectsStorage.saveChildrens(false, resource, undefined, msg.body.value);\n } else {\n _this._dataObjectsStorage.saveChildrens(true, resource, attribute, msg.body.value);\n }\n }\n }, {\n key: '_newCreate',\n value: function _newCreate(msg) {\n var _this3 = this;\n\n var _this = this;\n\n var owner = msg.from;\n var domain = (0, _utils.divideURL)(msg.from).domain;\n\n // if reporter is in a Interworking Protostub the runtime domain backend services will be used\n if (_this._registry.isInterworkingProtoStub(msg.from)) {\n domain = (0, _utils.divideURL)(_this.runtimeURL).domain;\n }\n\n var domainRegistration = msg.body.value.hasOwnProperty('domain_registration') ? msg.body.value.domain_registration : true;\n\n // Process invitation message to observers\n\n /*if (msg.body.authorise) {\n _this._authorise(msg);\n return;\n }*/\n\n //get schema from catalogue and parse -> (scheme, children)\n _this._catalog.getDataSchemaDescriptor(msg.body.schema).then(function (descriptor) {\n\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var scheme = properties.scheme ? properties.scheme.constant : 'resource';\n var childrens = properties.children ? properties.children.constant : [];\n\n // Do schema validation\n // TODO: check if is need to handle with the result of validation\n // schemaValidation(scheme, descriptor, msg.body.value);\n\n var objectInfo = {\n name: msg.body.value.name,\n schema: msg.body.value.schema,\n reporter: msg.body.value.reporter,\n resources: msg.body.value.resources\n };\n\n // should resuse data object url if it passed\n var reuseDataObject = msg.body.value.resource;\n var numOfAddress = 1;\n\n //debugger;\n //request address allocation of a new object from the msg-node\n //_this._allocator.create(domain, numOfAddress, objectInfo, scheme, reuseDataObject).then((allocated) => {\n _this._allocator.create(domain, numOfAddress, objectInfo, scheme, reuseDataObject).then(function (allocated) {\n\n var objectRegistration = (0, _utils.deepClone)(msg.body.value);\n objectRegistration.url = allocated.address[0];\n objectRegistration.authorise = msg.body.authorise;\n objectRegistration.childrens = childrens;\n\n //objectRegistration.expires = 30;//TODO: get it from data object configuration description when present\n\n delete objectRegistration.data;\n\n log.log('[SyncherManager._newCreate] ALLOCATOR CREATE:', allocated);\n\n var subscriptionURL = objectRegistration.url + '/subscription';\n\n log.log('[SyncherManager._newCreate] Subscription URL', subscriptionURL);\n\n //To register the dataObject in the runtimeRegistry\n log.info('[SyncherManager._newCreate] Register Object: ', objectRegistration);\n\n //_this._registry.registerDataObject(msg.body.value.name, msg.body.value.schema, objURL, msg.body.value.reporter, msg.body.value.resources, allocated, msg.body.authorise).then((resolve) => {\n _this._registry.registerDataObject(objectRegistration).then(function (registeredObject) {\n log.log('[SyncherManager._newCreate] DataObject successfully registered', registeredObject);\n\n //all OK -> create reporter and register listeners\n var reporter = void 0;\n\n if (!_this3._reporters[objectRegistration.url]) {\n reporter = new _ReporterObject2.default(_this, owner, objectRegistration.url);\n } else {\n reporter = _this3._reporters[objectRegistration.url];\n }\n\n log.log('[SyncherManager - new Create] - ', msg);\n\n // Store for each reporter hyperty the dataObject\n var userURL = void 0;\n // let interworking = false;\n\n if (msg.body.hasOwnProperty('identity') && msg.body.identity.userProfile && msg.body.identity.userProfile.userURL) {\n userURL = msg.body.identity.userProfile.userURL;\n\n // if (!userURL.includes('user://')) {\n // interworking = true;\n // }\n } else {\n userURL = _this._registry.getHypertyOwner(msg.from);\n\n // if (!userURL) {\n // interworking = true;\n // }\n }\n\n // should we use the msg.body.value instead?\n\n var metadata = (0, _utils.deepClone)(objectRegistration);\n metadata.subscriberUser = userURL;\n metadata.isReporter = true;\n\n // Store the dataObject information\n\n //if (!interworking) {\n\n if (msg.body.hasOwnProperty('store') && msg.body.store) {\n reporter.isToSaveData = true;\n metadata.isToSaveData = true;\n if (msg.body.value.data) {\n metadata.data = (0, _utils.deepClone)(msg.body.value.data);\n // _this._dataObjectsStorage.saveData(true, objectRegistration.url, null, msg.body.value.data); }\n // _this._dataObjectsStorage.update(true, objectRegistration.url, 'isToSaveData', true);\n\n // if (msg.body.value.data) { _this._dataObjectsStorage.saveData(true, objectRegistration.url, null, msg.body.value.data); }\n }\n }\n _this._dataObjectsStorage.set(metadata).then(function (storeObject) {\n //}\n var responseMsg = {\n id: msg.id, type: 'response', from: msg.to, to: owner,\n body: { code: 200, resource: objectRegistration.url, childrenResources: childrens }\n };\n\n // adding listeners to forward to reporter\n\n if (domainRegistration) {\n\n reporter.forwardSubscribe([objectRegistration.url, subscriptionURL]).then(function () {\n reporter.addChildrens().then(function () {\n _this._reporters[objectRegistration.url] = reporter;\n\n //FLOW-OUT: message response to Syncher -> create\n _this._bus.postMessage(responseMsg);\n });\n });\n } else {\n reporter.addChildrens().then(function () {\n _this._reporters[objectRegistration.url] = reporter;\n\n //FLOW-OUT: message response to Syncher -> create\n _this._bus.postMessage(responseMsg);\n });\n }\n }, function (error) {\n log.error(error);\n });\n }, function (error) {\n log.error(error);\n });\n });\n }).catch(function (reason) {\n //FLOW-OUT: error message response to Syncher -> create\n var responseMsg = {\n id: msg.id, type: 'response', from: msg.to, to: owner,\n body: { code: 500, desc: reason }\n };\n\n _this._bus.postMessage(responseMsg);\n });\n }\n }, {\n key: '_resumeCreate',\n value: function _resumeCreate(msg, storedObject) {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var owner = msg.from;\n var schema = storedObject.schema;\n var resource = storedObject.url;\n var domainRegistration = storedObject.hasOwnProperty('domain_registration') ? storedObject.domain_registration : true;\n var initialData = storedObject.data;\n\n log.log('[SyncherManager] - resume create', msg, storedObject);\n\n //get schema from catalogue and parse -> (scheme, children)\n _this._catalog.getDataSchemaDescriptor(schema).then(function (descriptor) {\n\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var scheme = properties.scheme ? properties.scheme.constant : 'resource';\n var childrens = properties.children ? properties.children.constant : [];\n\n log.log('[SyncherManager] - getDataSchemaDescriptor: ', descriptor, childrens);\n\n // Do schema validation\n // TODO: check if is need to handle with the result of validation\n // schemaValidation(scheme, descriptor, initialData);\n\n\n //all OK -> create reporter and register listeners\n var reporter = void 0;\n\n if (!_this4._reporters[resource]) {\n reporter = new _ReporterObject2.default(_this, owner, resource);\n } else {\n reporter = _this4._reporters[resource];\n }\n\n reporter.isToSaveData = storedObject.isToSaveData;\n\n if (domainRegistration) {\n reporter.forwardSubscribe([storedObject.url]).then(function () {\n log.log('[SyncherManager._resumeCreate] resumingReporterSubscription ', storedObject);\n _this._resumeReporterSubscriptions(msg, storedObject, reporter, childrens, domainRegistration).then(function (resumeObject) {\n log.log('[SyncherManager._resumeCreate] resolved resumed object ', resumeObject);\n resolve(resumeObject);\n });\n });\n } else resolve(_this._resumeReporterSubscriptions(msg, storedObject, reporter, childrens, domainRegistration));\n\n // resolve();\n }).catch(function (reason) {\n log.error('[SyncherManager - resume create] - fail on getDataSchemaDescriptor: ', reason);\n resolve(false);\n });\n });\n }\n }, {\n key: '_resumeReporterSubscriptions',\n value: function _resumeReporterSubscriptions(msg, storedObject, reporter, childrens, domainRegistration) {\n var _this = this;\n var resource = storedObject.url;\n var objectRegistration = (0, _utils.deepClone)(msg.body.value);\n objectRegistration.url = storedObject.url;\n objectRegistration.expires = storedObject.expires;\n objectRegistration.domain_registration = domainRegistration;\n\n delete objectRegistration.data;\n\n return new _promise2.default(function (resolve) {\n\n reporter.addChildrens().then(function () {\n\n reporter.resumeSubscriptions(storedObject.subscriptions);\n\n _this._reporters[resource] = reporter;\n\n log.info('[SyncherManager - resume create] - resolved resumed: ', storedObject);\n\n return _this._decryptChildrens(storedObject, childrens);\n }).then(function (decryptedObject) {\n\n log.info('[SyncherManager._resumeReporterSubscriptions] Register Object: ', objectRegistration);\n _this._registry.registerDataObject(objectRegistration).then(function (registered) {\n log.log('[SyncherManager._resumeReporterSubscriptions] DataObject registration successfully updated', registered);\n log.log('[SyncherManager._resumeReporterSubscriptions] resolving object', decryptedObject);\n resolve(decryptedObject);\n });\n\n // log.log('result of previous promise');\n }).catch(function (reason) {\n log.error('[SyncherManager - resume create] - fail on addChildrens: ', reason);\n resolve(false);\n });\n });\n }\n\n // to decrypt DataChildObjects if they are encrypted\n\n }, {\n key: '_decryptChildrens',\n value: function _decryptChildrens(encryptedObject, childrens) {\n var _this = this;\n\n var storedObject = (0, _utils.deepClone)(encryptedObject);\n return new _promise2.default(function (resolve) {\n\n if (!childrens) {\n resolve(storedObject);\n } else {\n var childrensObj = (0, _keys2.default)(storedObject.childrenObjects);\n\n if (childrensObj.length === 0) {\n resolve(storedObject);\n }\n\n childrens.forEach(function (children) {\n\n // let childObjects = storedObject.childrenObjects[children];\n var childObjects = storedObject.childrenObjects;\n\n log.log('[SyncherManager._decryptChildrens] dataObjectChilds to decrypt ', childObjects);\n\n var listOfDecryptedObjects = [];\n\n (0, _keys2.default)(childObjects).forEach(function (childId) {\n var child = childObjects[childId];\n var owner = childId.split('#')[0];\n\n if (typeof child.value === 'string') {\n\n log.log('[SyncherManager._decryptChildrens] createdBy ', owner, ' object: ', child.value);\n\n var decrypted = cryptoManager.default.decryptDataObject(JSON.parse(child.value), storedObject.url);\n\n listOfDecryptedObjects.push(decrypted);\n }\n });\n\n _promise2.default.all(listOfDecryptedObjects).then(function (decryptedObjects) {\n\n log.log('[SyncherManager._decryptChildrens] returning decrypted ', decryptedObjects);\n\n decryptedObjects.forEach(function (decryptedObject) {\n var childId = decryptedObject.value.url;\n storedObject.childrenObjects[childId].value = decryptedObject.value;\n });\n\n log.log('[SyncherManager._decryptChildrens] storedObject ', storedObject);\n\n resolve(storedObject);\n }).catch(function (reason) {\n log.warn('[SyncherManager._decryptChildrens] failed : ', reason);\n });\n });\n }\n });\n }\n\n // Process invitations to observers\n\n }, {\n key: '_authorise',\n value: function _authorise(msg) {\n var _this = this;\n\n if (!msg.body.resource) {\n throw new Error('[SyncherManager._authorise] invitation request without data object url:', msg);\n }\n\n var objSubscriptorURL = msg.body.resource + '/subscription';\n var p2p = msg.body.p2p ? msg.body.p2p : false;\n\n log.log('[SyncherManager - authorise] - ', msg);\n\n if (msg.body.authorise) {\n msg.body.authorise.forEach(function (hypertyURL) {\n //FLOW-OUT: send invites to list of remote Syncher -> _onRemoteCreate -> onNotification\n\n _this._bus.postMessage({\n type: 'create', from: objSubscriptorURL, to: hypertyURL,\n body: { p2p: p2p, identity: msg.body.identity, source: msg.from, value: msg.body.value, schema: msg.body.schema }\n }, function (reply) {\n // lets forward the invitation response\n var response = {\n from: msg.to,\n to: msg.from,\n id: msg.id,\n type: reply.type,\n body: reply.body\n };\n\n _this._bus.postMessage(response);\n });\n });\n }\n }\n\n //FLOW-IN: message received from DataObjectReporter -> delete\n\n }, {\n key: '_onDelete',\n value: function _onDelete(msg) {\n var _this = this;\n\n var objURL = msg.body.resource;\n\n var object = _this._reporters[objURL];\n if (object) {\n //TODO: is there any policy verification before delete?\n\n object.delete();\n\n this._dataObjectsStorage.deleteResource(objURL).then(function (result) {\n\n log.log('[SyncherManager - onDelete] - deleteResource: ', result);\n\n _this._registry.unregisterDataObject(objURL);\n\n //TODO: unregister object?\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n });\n });\n }\n }\n\n //FLOW-IN: message received from local Syncher -> subscribe\n\n }, {\n key: '_onLocalSubscribe',\n value: function _onLocalSubscribe(msg) {\n var _this5 = this;\n\n //debugger;\n this._dataObjectsStorage.getResourcesByCriteria(msg, false).then(function (result) {\n\n log.info('[SyncherManager - Subscribe] - ResourcesByCriteria | Message: ', msg, ' result: ', result);\n\n if (result && (0, _keys2.default)(result).length > 0) {\n\n var listOfObservers = [];\n\n // TODO: should reuse the stored information\n (0, _keys2.default)(result).forEach(function (objURL) {\n log.log('[SyncherManager - resume Subscribe] - reuse current object url: ', result[objURL]);\n listOfObservers.push(_this5._resumeSubscription(msg, result[objURL]));\n });\n\n _promise2.default.all(listOfObservers).then(function (resumedObservers) {\n log.log('[SyncherManager - Observers Resumed]', resumedObservers);\n\n // TODO: shoud send the information if some object is failing;\n var successfullyResumed = (0, _values2.default)(resumedObservers).filter(function (observer) {\n return observer !== false;\n });\n\n //FLOW-OUT: message response to Syncher -> create\n _this5._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, value: successfullyResumed }\n });\n });\n } else if (msg.body.schema && msg.body.resource) {\n log.log('[SyncherManager.onLocalSubscribe - new Subscribe] - ', msg.body.schema, msg.body.resource);\n _this5._newSubscription(msg);\n } else {\n //forward to hyperty:\n var reply = {};\n reply.id = msg.id;\n reply.from = msg.to;\n reply.to = msg.from;\n reply.type = 'response';\n reply.body = {\n code: 404,\n desc: 'No data objects observers to be resumed'\n };\n _this5._bus.postMessage(reply);\n }\n });\n }\n }, {\n key: '_newSubscription',\n value: function _newSubscription(msg) {\n var _this = this;\n\n var objURL = msg.body.resource;\n\n var hypertyURL = msg.from;\n var domain = (0, _utils.divideURL)(objURL).domain;\n var domainSubscription = msg.body.hasOwnProperty('domain_subscription') ? msg.body.domain_subscription : true;\n\n var childBaseURL = objURL + '/children/';\n\n //get schema from catalogue and parse -> (children)\n _this._catalog.getDataSchemaDescriptor(msg.body.schema).then(function (descriptor) {\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var childrens = properties.children ? properties.children.constant : [];\n\n var subscriptions = [];\n subscriptions.push(objURL + '/changes');\n\n // childrens.forEach((child) => subscriptions.push(childBaseURL + child));\n subscriptions.push(childBaseURL);\n\n //children addresses\n\n if (domainSubscription) {\n //FLOW-OUT: subscribe message to the msg-node, registering listeners on the broker\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { identity: msg.body.identity, resources: subscriptions, source: hypertyURL }\n };\n\n //subscribe in msg-node\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('node-subscribe-response(observer): ', reply);\n console.log('REUSETEST SyncherManager - node-subscribe-response(observer): ', reply);\n if (reply.body.code === 200) {\n _this._newReporterSubscribe(msg, hypertyURL, objURL, childrens);\n } else {\n //listener rejected\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n body: reply.body\n });\n }\n });\n } else _this._newReporterSubscribe(msg, hypertyURL, objURL, childrens);\n });\n }\n }, {\n key: '_newReporterSubscribe',\n value: function _newReporterSubscribe(msg, hypertyURL, objURL, childrens) {\n var _this6 = this;\n\n var _this = this;\n\n var objURLSubscription = objURL + '/subscription';\n\n //FLOW-OUT: reply with provisional response\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n body: { code: 100, childrenResources: childrens, schema: msg.body.schema, resource: msg.body.resource }\n });\n\n //FLOW-OUT: subscribe message to remote ReporterObject -> _onRemoteSubscribe\n var objSubscribeMsg = {\n type: 'subscribe', from: _this._url, to: objURLSubscription,\n body: { identity: msg.body.identity, subscriber: hypertyURL }\n };\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual')) objSubscribeMsg.body.mutual = msg.body.mutual;\n log.log('[SyncherManager._newSubscription]', objSubscribeMsg, msg);\n console.log('REUSETEST SyncherManager - [SyncherManager._newSubscription]', objSubscribeMsg, msg);\n //subscribe to reporter SM\n _this._bus.postMessage(objSubscribeMsg, function (reply) {\n log.log('reporter-subscribe-response-new: ', reply);\n console.log('REUSETEST SyncherManager - reporter-subscribe-response-new: ', reply);\n if (reply.body.code === 200) {\n\n log.log('[SyncherManager._newSubscription] - observers: ', _this._observers, objURL, _this._observers[objURL]);\n console.log('REUSETEST SyncherManager - 200 code[SyncherManager._newSubscription] - observers: ', _this._observers, objURL, _this._observers[objURL]);\n var observer = _this._observers[objURL];\n if (!observer) {\n observer = new _ObserverObject2.default(_this, objURL);\n log.log('[SyncherManager._newSubscription] - observers: create new ObserverObject: ', observer);\n _this._observers[objURL] = observer;\n\n // register new hyperty subscription\n observer.addSubscription(hypertyURL);\n\n // add childrens and listeners to save data if necessary\n observer.addChildrens();\n }\n\n var interworking = false;\n\n //debugger;\n\n // Store for each reporter hyperty the dataObject\n var userURL = void 0;\n if (msg.body.hasOwnProperty('identity') && msg.body.identity.userProfile && msg.body.identity.userProfile.userURL) {\n userURL = msg.body.identity.userProfile.userURL;\n if (!userURL.includes('user://')) {\n interworking = true;\n }\n } else {\n userURL = _this._registry.getHypertyOwner(msg.from);\n if (!userURL) interworking = true;\n }\n\n var metadata = (0, _utils.deepClone)(reply.body.value);\n\n // let childrenObjects = metadata.childrenObjects || {};\n\n delete metadata.data;\n delete metadata.childrenObjects;\n\n metadata.childrens = childrens;\n metadata.subscriberUser = userURL;\n metadata.isReporter = false;\n metadata.subscriberHyperty = hypertyURL;\n\n if (!interworking) {\n //_this._dataObjectsStorage.set(objURL, false, msg.body.schema, 'on', reply.body.owner, hypertyURL, childrens, userURL);\n _this._dataObjectsStorage.set(metadata);\n if (metadata.hasOwnProperty('store') && metadata.store || metadata.hasOwnProperty('isToSaveData') && metadata.isToSaveData) {\n observer.isToSaveData = true;\n _this._dataObjectsStorage.update(false, objURL, 'isToSaveData', true);\n _this._dataObjectsStorage.saveData(false, objURL, null, reply.body.value.data);\n // if (childrens) _this._dataObjectsStorage.initialObserverSync(objURL, reply.body.value.data.backupRevision);\n }\n }\n\n //forward to hyperty:\n reply.id = msg.id;\n reply.from = _this._url;\n reply.to = hypertyURL;\n reply.body.schema = msg.body.schema;\n reply.body.resource = msg.body.resource;\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual')) reply.body.mutual = msg.body.mutual;\n log.log('[subscribe] - new subscription: ', msg, reply, observer);\n\n _this6._bus.postMessage(reply);\n }\n });\n }\n }, {\n key: '_resumeSubscription',\n value: function _resumeSubscription(msg, storedObject) {\n var _this7 = this;\n\n return new _promise2.default(function (resolve) {\n\n var objURL = storedObject.url;\n var schema = storedObject.schema;\n\n var hypertyURL = msg.from;\n\n // let objURLSubscription = objURL + '/subscription';\n\n var childBaseURL = objURL + '/children/';\n\n log.log('[SyncherManager - ReuseSubscription] - objURL: ', objURL, ' - schema:', schema);\n\n //get schema from catalogue and parse -> (children)\n // TODO: remove this since children resources should be available in the DataObjectsStorage\n _this7._catalog.getDataSchemaDescriptor(schema).then(function (descriptor) {\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var childrens = properties.children ? properties.children.constant : [];\n\n //children addresses\n var subscriptions = [];\n subscriptions.push(objURL + '/changes');\n // childrens.forEach((child) => subscriptions.push(childBaseURL + child));\n subscriptions.push(childBaseURL);\n\n //FLOW-OUT: reply with provisional response\n _this7._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n body: { code: 100, childrenResources: childrens, schema: schema, resource: objURL }\n });\n\n //FLOW-OUT: subscribe message to remote ReporterObject -> _onRemoteSubscribe\n /*let objSubscribeMsg = {\n type: 'subscribe', from: this._url, to: objURLSubscription,\n body: { subscriber: hypertyURL, identity: msg.body.identity }\n };\n //subscribe to reporter SM\n this._bus.postMessage(objSubscribeMsg, (reply) => {*/\n\n var observer = _this7._observers[objURL];\n if (!observer) {\n observer = new _ObserverObject2.default(_this7, objURL);\n observer.isToSaveData = storedObject.isToSaveData;\n _this7._observers[objURL] = observer;\n }\n\n //register new hyperty subscription\n observer.addSubscription(hypertyURL);\n observer.addChildrens();\n\n // Object.assign(storedObject.data, reply.body.value.data);\n // Object.assign(storedObject.childrens, reply.body.value.childrens);\n\n //log.log('[subscribe] - resume subscription: ', msg, reply, storedObject, observer);\n\n return _this7._decryptChildrens(storedObject, childrens);\n }).then(function (decryptedObject) {\n // log.log('result of previous promise');\n resolve(decryptedObject);\n }).catch(function (reason) {\n log.error('[SyncherManager - resume subscription] - fail on getDataSchemaDescriptor: ', reason);\n resolve(false);\n });\n });\n }\n\n //FLOW-IN: message received from local DataObjectObserver -> unsubscribe\n\n }, {\n key: '_onLocalUnSubscribe',\n value: function _onLocalUnSubscribe(msg) {\n var _this = this;\n\n var hypertyURL = msg.from;\n var objURL = msg.body.resource;\n\n var observer = _this._observers[objURL];\n if (observer) {\n //TODO: is there any policy verification before delete?\n observer.removeSubscription(msg);\n\n //TODO: destroy object in the registry?\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n });\n\n this._dataObjectsStorage.deleteResource(objURL);\n\n //TODO: remove Object if no more subscription?\n delete _this._observers[objURL];\n }\n }\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n }]);\n return SyncherManager;\n}();\n\nexports.default = SyncherManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1N5bmNoZXJNYW5hZ2VyLmpzPzMzMzciXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4qIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS5cbiogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0XG4qXG4qICAgaHR0cDovL3d3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gICAgICBsZXQgcmVwbHkgPSB7XG4gICAgICAgICAgdHlwZTogJ3Jlc3BvbnNlJyxcbiAgICAgICAgICBmcm9tOiBtc2cudG8sXG4gICAgICAgICAgdG86IG1zZy5mcm9tLFxuICAgICAgICAgIGlkOiBtc2cuaWRcbiAgICAgICAgfVxuXG4gICAgICAgIGxvZy5pbmZvKCdbU3luY2hlck1hbmFnZXIub25FeGVjdXRlXSBuZXcgbWVzc2FnZScsIG1zZyk7XG4gIFxuICAgICAgICBpZiAobXNnLmhhc093blByb3BlcnR5KCdib2R5JykgJiYgbXNnLmJvZHkuaGFzT3duUHJvcGVydHkoJ21ldGhvZCcpICYmIG1zZy5ib2R5Lmhhc093blByb3BlcnR5KCdwYXJhbXMnKSkge1xuXG4gICAgICAgIHN3aXRjaCAobXNnLmJvZHkubWV0aG9kKSB7XG4gICAgICAgICAgY2FzZSAnc3luYyc6IF90aGlzLl9kYXRhT2JqZWN0c1N0b3JhZ2Uuc3luYyhtc2cuYm9keS5wYXJhbXNbMF0sIG1zZy5ib2R5LnBhcmFtc1sxXSwgZmFsc2UpO1xuICAgICAgICAgICBicmVhaztcbiAgICAgICAgICBjYXNlICdzdG9wU3luYyc6IF90aGlzLl9kYXRhT2JqZWN0c1N0b3JhZ2Uuc3RvcFN5bmMobXNnLmJvZHkucGFyYW1zWzBdKTtcbiAgICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICAgICAgcmVwbHkuYm9keSA9IHtcbiAgICAgICAgICAgICAgY29kZTogMjAwXG4gICAgICAgICAgICB9O1xuICAgIFxuICAgICAgICAgICAgX3RoaXMuX2J1cy5wb3N0TWVzc2FnZShyZXBseSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXBseS5ib2R5ID0ge1xuICAgICAgICAgICAgY29kZTogNDAwLFxuICAgICAgICAgICAgZGVzYzogJ21pc3NpbmcgYm9keSBvciBib2R5IG1ldGhvZCAvIHBhcmFtcyBtYW5kYXRvcnk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F90aGlzLl9kYXRhT2JqZWN0c1N0b3JhZ2Uuc2V0KG1ldGFkYXRhKS50aGVuKChzdG9yZU9iamVjdCkgPT4ge1xuICAgICAgICAgIC8vfVxuICAgICAgICAgIGxldCByZXNwb25zZU1zZyA9IHtcbiAgICAgICAgICAgIGlkOiBtc2cuaWQsIHR5cGU6ICdyZXNwb25zZScsIGZyb206IG1zZy50bywgdG86IG93bmVyLFxuICAgICAgICAgICAgYm9keTogeyBjb2RlOiAyMDAsIHJlc291cmNlOiBvYmplY3RSZWdpc3RyYXRpb24udXJsLCBjaGlsZHJlblJlc291cmNlczogY2hpbGRyZW5zIH1cbiAgICAgICAgICB9O1xuXG4gICAgICAgICAgLy8gYWRkaW5nIGxpc3RlbmVycyB0byBmb3J3YXJkIHRvIHJlcG9ydGVyXG5cbiAgICAgICAgICBpZiAoZG9tYWluUmVnaXN0cmF0aW9uKSB7XG5cbiAgICAgICAgICAgIHJlcG9ydGVyLmZvcndhcmRTdWJzY3JpYmUoW29iamVjdFJlZ2lzdHJhdGlvbi51cmwsIHN1YnNjcmlwdGlvblVSTF0pLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICByZXBvcnRlci5hZGRDaGlsZHJlbnMoKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICBfdGhpcy5fcmVwb3J0ZXJzW29iamVjdFJlZ2lzdHJhdGlvbi51cmxdID0gcmVwb3J0ZXI7XG5cblxuICAgICAgICAgICAgICAgIC8vRkxPVy1PVVQ6IG1lc3NhZ2UgcmVzcG9uc2UgdG8gU3luY2hlciAtPiBjcmVhdGVcbiAgICAgICAgICAgICAgICBfdGhpcy5fYnVzLnBvc3RNZXNzYWdlKHJlc3BvbnNlTXNnKTtcblxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICByZXBvcnRlci5hZGRDaGlsZHJlbnMoKS50aGVuKCgpID0+IHtcbiAgICAgICAgICA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gLSBvYnNlcnZlcnM6IGNyZWF0ZSBuZXcgT2JzZXJ2ZXJPYmplY3Q6ICcsIG9ic2VydmVyKTtcbiAgICAgICAgICAgICAgICBfdGhpcy5fb2JzZXJ2ZXJzW29ialVSTF0gPSBvYnNlcnZlcjtcblxuICAgICAgICAgICAgICAgIC8vIHJlZ2lzdGVyIG5ldyBoeXBlcnR5IHN1YnNjcmlwdGlvblxuICAgICAgICAgICAgICAgIG9ic2VydmVyLmFkZFN1YnNjcmlwdGlvbihoeXBlcnR5VVJMKTtcblxuICAgICAgICAgICAgICAgIC8vIGFkZCBjaGlsZHJlbnMgYW5kIGxpc3RlbmVycyB0byBzYXZlIGRhdGEgaWYgbmVjZXNzYXJ5XG4gICAgICAgICAgICAgICAgb2JzZXJ2ZXIuYWRkQ2hpbGRyZW5zKCk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICBsZXQgaW50ZXJ3b3JraW5nID0gZmFsc2U7XG5cbiAgICAgICAgICAgICAgLy9kZWJ1Z2dlcjtcblxuICAgICAgICAgICAgICAvLyBTdG9yZSBmb3IgZWFjaCByZXBvcnRlciBoeXBlcnR5IHRoZSBkYXRhT2JqZWN0XG4gICAgICAgICAgICAgIGxldCB1c2VyVVJMO1xuICAgICAgICAgICAgICBpZiAobXNnLmJvZHkuaGFzT3duUHJvcGVydHkoJ2lkZW50aXR5JykgJiYgbXNnLmJvZHkuaWRlbnRpdHkudXNlclByb2ZpbGUgJiYgbXNnLmJvZHkuaWRlbnRpdHkudXNlclByb2ZpbGUudXNlclVSTCkge1xuICAgICAgICAgICAgICAgIHVzZXJVUkwgPSBtc2cuYm9keS5pZGVudGl0eS51c2VyUHJvZmlsZS51c2VyVVJMO1xuICAgICAgICAgICAgICAgIGlmICghdXNlclVSTC5pbmNsdWRlcygndXNlcjovLycpKSB7XG4gICAgICAgICAgICAgICAgICBpbnRlcndvcmtpbmcgPSB0cnVlO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICB1c2VyVVJMID0gX3RoaXMuX3JlZ2lzdHJ5LmdldEh5cGVydHlPd25lcihtc2cuZnJvbSk7XG4gICAgICAgICAgICAgICAgaWYgKCF1c2VyVVJMKSBpbnRlcndvcmtpbmcgPSB0cnVlO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgbGV0IG1ldGFkYXRhID0gZGVlcENsb25lKHJlcGx5LmJvZHkudmFsdWUpO1xuXG4gICAgICAgICAgICAgIC8vIGxldCBjaGlsZHJlbk9iamVjdHMgPSBtZXRhZGF0YS5jaGlsZHJlbk9iamVjdHMgfHwge307XG5cbiAgICAgICAgICAgICAgZGVsZXRlIG1ldGFkYXRhLmRhdGE7XG4gICAgICAgICAgICAgIGRlbGV0ZSBtZXRhZGF0YS5jaGlsZHJlbk9iamVjdHM7XG5cbiAgICAgICAgICAgICAgbWV0YWRhdGEuY2hpbGRyZW5zID0gY2hpbGRyZW5zO1xuICAgICAgICAgICAgICBtZXRhZGF0YS5zdWJzY3JpYmVyVXNlciA9IHVzZXJVUkw7XG4gICAgICAgICAgICAgIG1ldGFkYXRhLmlzUmVwb3J0ZXIgPSBmYWxzZTtcbiAgICAgICAgICAgICAgbWV0YWRhdGEuc3Vic2NyaWJlckh5cGVydHkgPSBoeXBlcnR5VVJMO1xuXG4gICAgICAgICAgICAgIGlmICghaW50ZXJ3b3JraW5nKSB7XG4gICAgICAgICAgICAgICAgLy9fdGhpcy5fZGF0YU9iamVjdHNTdG9yYWdlLnNldChvYmpVUkwsIGZhbHNlLCBtc2cuYm9keS5zY2hlbWEsICdvbicsIHJlcGx5LmJvZHkub3duZXIsIGh5cGVydHlVUkwsIGNoaWxkcmVucywgdXNlclVSTCk7XG4gICAgICAgICAgICAgICAgX3RoaXMuX2RhdGFPYmplY3RzU3RvcmFnZS5zZXQobWV0YWRhdGEpO1xuICAgICAgICAgICAgICAgIGlmICgobWV0YWRhdGEuaGFzT3duUHJvcG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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXgzQkE7QUFBQTtBQUFBOzs7OztBQTQzQkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///538\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(540);\nmodule.exports = __webpack_require__(11).Object.values;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvdmFsdWVzLmpzPzRlNjUiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcub2JqZWN0LnZhbHVlcycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0LnZhbHVlcztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvdmFsdWVzLmpzXG4vLyBtb2R1bGUgaWQgPSA1Mzlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///539\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(26);\nvar $values = __webpack_require__(541)(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5vYmplY3QudmFsdWVzLmpzPzdkOTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtb2JqZWN0LXZhbHVlcy1lbnRyaWVzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICR2YWx1ZXMgPSByZXF1aXJlKCcuL19vYmplY3QtdG8tYXJyYXknKShmYWxzZSk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnT2JqZWN0Jywge1xuICB2YWx1ZXM6IGZ1bmN0aW9uIHZhbHVlcyhpdCkge1xuICAgIHJldHVybiAkdmFsdWVzKGl0KTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczcub2JqZWN0LnZhbHVlcy5qc1xuLy8gbW9kdWxlIGlkID0gNTQwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///540\n")},function(module,exports,__webpack_require__){eval("var getKeys = __webpack_require__(68);\nvar toIObject = __webpack_require__(50);\nvar isEnum = __webpack_require__(81).f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n//# sourceURL=[module]\n//# sour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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///541\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Subscription = __webpack_require__(221);\n\nvar _Subscription2 = _interopRequireDefault(_Subscription);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar cryptoManager = _interopRequireWildcard(_CryptoManager);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('ReporterObject'); // Log System\n\nvar ReporterObject = function () {\n function ReporterObject(parent, owner, url) {\n (0, _classCallCheck3.default)(this, ReporterObject);\n\n var _this = this;\n\n _this._parent = parent;\n _this._owner = owner;\n _this._url = url;\n\n _this._bus = parent._bus;\n\n _this._domain = (0, _utils.divideURL)(url).domain;\n _this._objSubscriptorURL = _this._url + '/subscription';\n\n _this._subscriptions = {};\n _this._childrens = [];\n _this._childrenListeners = [];\n\n _this._forwards = {};\n\n _this._isToSaveData = false;\n\n _this._allocateListeners();\n }\n\n (0, _createClass3.default)(ReporterObject, [{\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this2 = this;\n\n var _this = this;\n\n //add subscription listener...\n _this._subscriptionListener = _this._bus.addListener(_this._objSubscriptorURL, function (msg) {\n log.info('[SyncherManager.ReporterObject received ]', msg);\n switch (msg.type) {\n case 'subscribe':\n _this._onRemoteSubscribe(msg);break;\n case 'unsubscribe':\n _this._onRemoteUnSubscribe(msg);break;\n case 'response':\n _this._onRemoteResponse(msg);break;\n }\n });\n\n var changeURL = _this._url + '/changes';\n _this._changeListener = _this._bus.addListener(changeURL, function (msg) {\n\n log.info('[SyncherManager.ReporterObject ] SyncherManager-' + changeURL + '-RCV: ', msg);\n\n //do not save changes to backupRevision to avoid infinite loops\n if (_this2._isToSaveData && msg.body.attribute) {\n var updateRuntimeStatus = msg.body.attribute !== 'backupRevision' ? true : false;\n log.log('[SyncherManager.ReporterObject ] SyncherManager - save data: ', msg);\n _this._parent._dataObjectsStorage.update(true, _this._url, 'version', msg.body.version, updateRuntimeStatus);\n _this._parent._dataObjectsStorage.update(true, _this._url, 'lastModified', msg.body.lastModified, updateRuntimeStatus);\n _this._parent._dataObjectsStorage.saveData(true, _this._url, msg.body.attribute, msg.body.value, updateRuntimeStatus);\n }\n });\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._subscriptionListener.remove();\n\n _this._changeListener.remove();\n\n _this._childrenListeners.forEach(function (cl) {\n cl.remove();\n });\n\n (0, _keys2.default)(_this._forwards).forEach(function (key) {\n _this.forwardUnSubscribe(key);\n });\n\n //remove all subscriptions\n (0, _keys2.default)(_this._subscriptions).forEach(function (key) {\n _this._subscriptions[key]._releaseListeners();\n });\n }\n }, {\n key: 'resumeSubscriptions',\n value: function resumeSubscriptions(subscriptions) {\n var _this = this;\n\n if (!subscriptions) return;\n\n (0, _keys2.default)(subscriptions).forEach(function (key) {\n var hypertyURL = subscriptions[key];\n\n log.log('[SyncherManager.ReporterObject] - resume subscriptions', _this, hypertyURL, _this._childrens);\n\n if (!_this._subscriptions[hypertyURL]) {\n _this._subscriptions[hypertyURL] = new _Subscription2.default(_this._bus, _this._owner, _this._url, true);\n }\n });\n }\n\n /**\n * Register a listener in the msg-node and in the local MessageBus, so that messages on this address are forwarded to the reporter object\n * @param {string} address - URL to register the listeners\n * @return {Promise} Return Promise OK or error\n */\n\n }, {\n key: 'forwardSubscribe',\n value: function forwardSubscribe(addresses) {\n var _this = this;\n\n //FLOW-OUT: message sent to the msg-node SubscriptionManager component\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._parent._url, to: 'domain://msg-node.' + _this._domain + '/sm',\n body: { resources: addresses, source: _this._owner }\n };\n\n return new _promise2.default(function (resolve, reject) {\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('[SyncherManager.ReporterObject ]forward-subscribe-response(reporter): ', reply);\n if (reply.body.code === 200) {\n var newForward = _this._bus.addForward(_this._url, _this._owner);\n _this._forwards[addresses[0]] = newForward;\n resolve();\n } else {\n reject('Error on msg-node subscription: ' + reply.body.desc);\n }\n });\n });\n }\n\n /**\n * UnRegister a listener in the msg-node and in the local MessageBus, so that messages on this address are removed from forward\n * @param {string} address - URL to un-register the listeners\n */\n\n }, {\n key: 'forwardUnSubscribe',\n value: function forwardUnSubscribe(address) {\n var _this = this;\n\n _this._forwards[address].remove();\n delete _this._forwards[address];\n\n //FLOW-OUT: message sent to the msg-node SubscriptionManager component\n var nodeUnSubscribeMsg = {\n type: 'unsubscribe', from: _this._parent._url, to: 'domain://msg-node.' + _this._domain + '/sm',\n body: { resources: [address], source: _this._owner }\n };\n\n _this._bus.postMessage(nodeUnSubscribeMsg);\n }\n\n /**\n * Register listeners for a list of childrens. Public channels used to transmit messages.\n * @param {string[]} childrens - channels to register\n * @return {Promise} Return Promise OK or error\n */\n\n }, {\n key: 'addChildrens',\n value: function addChildrens() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n /* if (childrens.length === 0) {\n resolve();\n return;\n }*/\n\n var childBaseURL = _this._url + '/children/';\n log.log('[SyncherManager.ReporterObject - addChildrens] - childrens: ', childBaseURL);\n\n /* childrens.forEach((child) => {\n _this._childrens.push(child);\n });*/\n\n /*\n _this._childrens.forEach((child) => {\n let childId = childBaseURL + child;\n let selfForward = _this._bus.addForward(childId, owner);\n _this._childrenListeners.push(selfForward);\n });*/\n\n var subscriptions = [];\n // childrens.forEach((child) => subscriptions.push(childBaseURL + child));\n subscriptions.push(childBaseURL);\n\n //_this._storageSubscriptions[_this._objSubscriptorURL] = {url: _this._url, owner: _this._owner, childrens: _this._childrens};\n\n //FLOW-OUT: message sent to the msg-node SubscriptionManager component\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._parent._url, to: 'domain://msg-node.' + _this._domain + '/sm',\n body: { resources: subscriptions, source: _this._owner }\n };\n\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('[SyncherManager.ReporterObject ]node-subscribe-response(reporter):', reply);\n if (reply.body.code === 200) {\n\n //add children listeners on local ...\n subscriptions.forEach(function (childURL) {\n var childListener = _this._bus.addListener(childURL, function (msg) {\n //TODO: what todo here? Save childrens?\n log.log('[SyncherManager.ReporterObject received]', msg);\n\n if (msg.type === 'create' && msg.to.includes('children') && _this3._isToSaveData) {\n\n // if the value is not encrypted lets encrypt it\n // todo: should be subject to some policy\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n if (!msg.body.hasOwnProperty('mutual')) msg.body.mutual = true;\n\n //remove false when mutualAuthentication is enabled\n if (!(typeof msg.body.value === 'string') && msg.body.mutual) {\n\n log.log('[SyncherManager.ReporterObject] encrypting received data ', msg.body.value);\n\n cryptoManager.default.encryptDataObject(msg.body.value, url).then(function (encryptedValue) {\n log.log('[SyncherManager.ReporterObject] encrypted data ', encryptedValue);\n\n _this._storeChildObject(msg, (0, _stringify2.default)(encryptedValue));\n }).catch(function (reason) {\n log.warn('[SyncherManager._decryptChildrens] failed : ', reason, ' Storing unencrypted');\n _this._storeChildObject(msg, msg.body.value);\n });\n } else {\n _this._storeChildObject(msg, msg.body.value);\n }\n }\n });\n _this._childrenListeners.push(childListener);\n\n var selfForward = _this._bus.addForward(childURL, _this._owner);\n _this._childrenListeners.push(selfForward);\n });\n\n resolve();\n } else {\n reject('Error on msg-node subscription: ' + reply.body.desc);\n }\n });\n });\n }\n\n // store childObject\n\n }, {\n key: '_storeChildObject',\n value: function _storeChildObject(msg, data) {\n var _this = this;\n\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n var resource = splitedReporterURL.resource;\n var value = void 0;\n\n /* if (msg.body.identity) {\n value.identity = msg.body.identity;\n delete value.identity.assertion;\n delete value.identity.expires;\n }*/\n\n var objectURLResource = msg.body.resource;\n var attribute = resource;\n\n if (objectURLResource === 'heartbeat') value = data;else value = {\n identity: msg.body.identity,\n value: data\n };\n\n // if (objectURLResource) attribute += '.' + objectURLResource;\n if (objectURLResource) attribute = objectURLResource;\n\n // this identity data is not needed to be stored\n\n\n console.log('[SyncherManager.ReporterObject._storeChildObject] : ', url, attribute, value);\n\n _this._parent._dataObjectsStorage.saveChildrens(true, url, attribute, value);\n }\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n var domain = (0, _utils.divideURL)(_this._owner).domain;\n\n //FLOW-OUT: message sent directly to all subscribers of the reporter\n _this._bus.postMessage({\n type: 'delete', from: _this._objSubscriptorURL, to: _this._url + '/changes'\n });\n\n //FLOW-OUT: message sent to the msg-node ObjectAllocationManager component\n _this._bus.postMessage({\n type: 'delete', from: _this._parent._url, to: 'domain://msg-node.' + domain + '/object-address-allocation',\n body: { resource: _this._url, childrenResources: _this._childrens }\n });\n\n _this._releaseListeners();\n delete _this._parent._reporters[_this._url];\n }\n }, {\n key: '_onRemoteResponse',\n value: function _onRemoteResponse(msg) {\n var _this = this;\n\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: _this._url,\n body: { code: msg.body.code, identity: msg.body.identity, source: msg.from }\n });\n }\n\n //FLOW-IN: message received from Syncher -> subscribe\n\n }, {\n key: '_onRemoteSubscribe',\n value: function _onRemoteSubscribe(msg) {\n var _this = this;\n var hypertyURL = msg.body.subscriber;\n\n //validate if subscription already exists?\n if (_this._subscriptions[hypertyURL]) {\n // let errorMsg = {\n // id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n // body: { code: 500, desc: 'Subscription for (' + _this._url + ' : ' + hypertyURL + ') already exists!' }\n // };\n //\n // _this._bus.postMessage(errorMsg);\n // return;\n\n // new version because of reusage\n _this._subscriptions[hypertyURL]._releaseListeners();\n }\n\n //ask to subscribe to Syncher? (depends on the operation mode)\n //TODO: get mode from object!\n var mode = 'sub/pub';\n\n if (mode === 'sub/pub') {\n //FLOW-OUT: message sent to local hyperty address Syncher -> _onForward\n var forwardMsg = {\n type: 'forward', from: _this._url, to: _this._owner,\n body: { type: msg.type, from: hypertyURL, to: _this._url, identity: msg.body.identity }\n };\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual')) forwardMsg.body.mutual = msg.body.mutual;\n\n _this._bus.postMessage(forwardMsg, function (reply) {\n log.log('[SyncherManager.ReporterObject ]forward-reply: ', reply);\n if (reply.body.code === 200) {\n if (!_this._subscriptions[hypertyURL]) {\n log.log('[SyncherManager.ReporterObject] - _onRemoteSubscribe:', _this._childrens);\n _this._subscriptions[hypertyURL] = new _Subscription2.default(_this._bus, _this._owner, _this._url, true);\n }\n }\n\n // Store for each reporter hyperty the dataObject\n var userURL = void 0;\n if (msg.body.identity && msg.body.identity.userProfile.userURL) {\n userURL = msg.body.identity.userProfile.userURL;\n _this._parent._dataObjectsStorage.update(true, _this._url, 'subscriberUsers', userURL);\n }\n\n //TODO: mutual and sessionkeys updates were removed. FFS\n\n /* if (msg.body.hasOwnProperty('mutual')) {\n // _this._parent._identityModule.updateIsToEncryptForDataObjectSessionKey(_this._url, msg.body.mutual).then(()=>{\n _this._parent._dataObjectsStorage.update(true, _this._url, 'mutual', msg.body.mutual);\n // });\n }*/\n\n _this._parent._dataObjectsStorage.update(true, _this._url, 'subscriptions', hypertyURL);\n\n reply.body.owner = _this._owner;\n\n //FLOW-OUT: subscription response sent (forward from internal Hyperty)\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: reply.body\n });\n });\n }\n }\n\n //FLOW-IN: message received from remote ObserverObject -> removeSubscription\n\n }, {\n key: '_onRemoteUnSubscribe',\n value: function _onRemoteUnSubscribe(msg) {\n var _this = this;\n var unsubscriber = msg.body.source;\n\n var subscription = _this._subscriptions[unsubscriber];\n if (subscription) {\n subscription._releaseListeners();\n delete _this._subscriptions[unsubscriber];\n\n var forwardMsg = {\n type: 'forward', from: _this._url, to: _this._owner,\n body: { type: msg.type, from: unsubscriber, to: _this._url, identity: msg.body.identity }\n };\n\n _this._bus.postMessage(forwardMsg);\n }\n }\n }, {\n key: 'isToSaveData',\n set: function set(value) {\n this._isToSaveData = value;\n }\n }]);\n return ReporterObject;\n}();\n\nexports.default = ReporterObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1JlcG9ydGVyT2JqZWN0LmpzP2M3Y2IiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdSZXBvcnRlck9iamVjdCcpO1xuXG5pbXBvcnQgeyBkaXZpZGVVUkwsIHNwbGl0T2JqZWN0VVJMIH0gZnJvbSAn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UFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFDQTtBQUlBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFDQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFLQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFLQTtBQUNBO0FBRUE7OztBQXhWQTtBQUNBO0FBQ0E7Ozs7O0FBMFZBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///542\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Subscription = __webpack_require__(221);\n\nvar _Subscription2 = _interopRequireDefault(_Subscription);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar cryptoManager = _interopRequireWildcard(_CryptoManager);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('ObserverObject'); // Log System\n\nvar ObserverObject = function () {\n function ObserverObject(parent, url) {\n var _this2 = this;\n\n (0, _classCallCheck3.default)(this, ObserverObject);\n\n var _this = this;\n\n _this._parent = parent;\n _this._url = url;\n // _this._childrens = childrens;\n\n _this._bus = parent._bus;\n\n _this._subscriptions = {};\n _this._storageSubscriptions = {};\n _this._childrenListeners = [];\n\n this._isToSaveData = false;\n\n var changeURL = _this._url + '/changes';\n _this._changeListener = _this._bus.addListener(changeURL, function (msg) {\n\n log.log('[SyncherManager.ObserverObject ] SyncherManager-' + changeURL + '-RCV: ', msg);\n\n //TODO: what todo here? Save changes?\n if (_this2._isToSaveData && msg.body.attribute) {\n log.log('[SyncherManager.ObserverObject ] SyncherManager - save data: ', msg);\n _this._parent._dataObjectsStorage.update(false, _this._url, 'version', msg.body.version);\n _this._parent._dataObjectsStorage.update(false, _this._url, 'lastModified', msg.body.lastModified);\n _this._parent._dataObjectsStorage.saveData(false, _this._url, msg.body.attribute, msg.body.value);\n }\n });\n }\n\n (0, _createClass3.default)(ObserverObject, [{\n key: '_newSubscription',\n value: function _newSubscription(hyperty) {\n var _this = this;\n\n var subscription = _this._subscriptions[hyperty];\n log.log('[Observer Object - new subscription] - ', _this._subscriptions, hyperty, _this._subscriptions.hasOwnProperty(hyperty));\n if (!subscription) {\n _this._subscriptions[hyperty] = new _Subscription2.default(_this._bus, hyperty, _this._url, false);\n }\n }\n }, {\n key: 'addSubscription',\n value: function addSubscription(hyperty) {\n var _this = this;\n\n _this._newSubscription(hyperty);\n }\n }, {\n key: 'addChildrens',\n value: function addChildrens() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var childBaseURL = _this._url + '/children/';\n log.log('[SyncherManager.ObserverObject - addChildrens] - childrens: ', childBaseURL);\n\n // childrens.forEach((child) => {\n\n var childListener = _this._bus.addListener(childBaseURL, function (msg) {\n //TODO: what todo here? Save childrens?\n log.log('[SyncherManager.ObserverObject received]', msg);\n\n if (msg.type === 'create' && msg.to.includes('children') && _this3._isToSaveData) {\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n if (!msg.body.hasOwnProperty('mutual')) msg.body.mutual = true;\n\n //remove false when mutualAuthentication is enabled\n if (!(typeof msg.body.value === 'string') && msg.body.mutual) {\n\n log.log('[SyncherManager.ObserverObject] encrypting received data ', msg.body.value);\n\n cryptoManager.default.encryptDataObject(msg.body.value, url).then(function (encryptedValue) {\n log.log('[SyncherManager.ObserverObject] encrypted data ', encryptedValue);\n\n _this._storeChildObject(msg, (0, _stringify2.default)(encryptedValue));\n }).catch(function (reason) {\n log.warn('[SyncherManager.ObserverObject._encryptChild] failed, storing unencrypted ', reason);\n _this._storeChildObject(msg, msg.body.value);\n });\n } else {\n _this._storeChildObject(msg, msg.body.value);\n }\n }\n\n log.log('[SyncherManager.ObserverObject children Listeners]', _this._childrenListeners, childListener);\n if (_this._childrenListeners.indexOf(childListener) === -1) {\n _this._childrenListeners.push(childListener);\n }\n });\n });\n\n // });\n }\n\n // store childObject\n\n }, {\n key: '_storeChildObject',\n value: function _storeChildObject(msg, data) {\n var _this = this;\n\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n var resource = splitedReporterURL.resource;\n var value = {};\n\n /* let value = {\n identity: msg.body.identity,\n value: data\n };*/\n\n // this identity data is not needed to be stored\n /* delete value.identity.assertion;\n delete value.identity.expires;*/\n\n var objectURLResource = msg.body.resource;\n var attribute = resource;\n\n if (objectURLResource === 'heartbeat') {\n value = data;\n } else {\n value.identity = msg.body.identity;\n value.value = data;\n }\n\n // if (objectURLResource) attribute += '.' + objectURLResource;\n if (objectURLResource) attribute = objectURLResource;\n\n log.log('[SyncherManager.ObserverObject._storeChildObject] : ', url, attribute, value);\n\n _this._parent._dataObjectsStorage.saveChildrens(false, url, attribute, value);\n }\n }, {\n key: 'removeSubscription',\n value: function removeSubscription(msg) {\n var _this = this;\n\n var hyperty = msg.from;\n\n var domain = (0, _utils.divideURL)(hyperty).domain;\n var objURLSubscription = _this._url + '/subscription';\n\n var subscription = _this._subscriptions[hyperty];\n if (subscription) {\n //FLOW-OUT: message sent to remote ReporterObject -> _onRemoteUnSubscribe\n _this._bus.postMessage({\n type: 'unsubscribe', from: _this._parent._url, to: objURLSubscription,\n body: { source: hyperty, identity: msg.body.identity }\n });\n\n //TODO: should I wait for response before unsubscribe on msg-node\n //FLOW-OUT: message sent to msg-node SubscriptionManager component\n _this._bus.postMessage({\n type: 'unsubscribe', from: _this._parent._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { resource: _this._url, resources: [_this._url + '/children/'] }\n });\n\n subscription._releaseListeners();\n delete _this._subscriptions[hyperty];\n }\n }\n }, {\n key: 'isToSaveData',\n set: function set(value) {\n this._isToSaveData = value;\n }\n }]);\n return ObserverObject;\n}();\n\nexports.default = ObserverObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,e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7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7OztBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTs7O0FBeElBO0FBQ0E7QUFDQTs7Ozs7QUEwSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///543\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _values = __webpack_require__(220);\n\nvar _values2 = _interopRequireDefault(_values);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Subscription = __webpack_require__(545);\n\nvar _Subscription2 = _interopRequireDefault(_Subscription);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('SubscriptionManager'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n * @author paulo-g-chainho@alticelabs.com\n * Subscription Manager used to manage routing paths at the runtime.\n */\n\nvar SubscriptionManager = function () {\n function SubscriptionManager(runtimeURL, bus, storage) {\n (0, _classCallCheck3.default)(this, SubscriptionManager);\n\n if (!runtimeURL) throw new Error('[SubscriptionManager] - needs the runtimeURL parameter');\n if (!bus) throw new Error('[SubscriptionManager] - needs the MessageBus instance');\n\n var _this = this;\n\n _this._bus = bus;\n _this._storage = storage;\n\n _this._subscriptions = {};\n\n _this._subscriptionsStorage = {};\n\n //TODO: these should be saved in persistence engine?\n _this.runtimeURL = runtimeURL;\n _this._url = runtimeURL + '/subscriptions';\n\n //TODO: this should not be hardcoded!\n _this._domain = (0, _utils.divideURL)(runtimeURL).domain;\n\n bus.addListener(_this._url, function (msg) {\n log.info('[SubscriptionManager] RCV: ', msg);\n switch (msg.type) {\n case 'subscribe':\n _this._onSubscribe(msg);break;\n case 'unsubscribe':\n _this._onUnSubscribe(msg);break;\n case 'read':\n _this._onRead(msg);break;\n }\n });\n }\n\n (0, _createClass3.default)(SubscriptionManager, [{\n key: 'init',\n value: function init() {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n _this._storage.get('subscriptions').then(function (subscriptions) {\n log.log('[SubscriptionManager.init] resume subscriptions: ', subscriptions);\n if (subscriptions) {\n\n _this._subscriptionsStorage = subscriptions;\n\n (0, _values2.default)(subscriptions).forEach(function (subscription) {\n _this.createSubscription(subscription.domain, subscription.resources, subscription.subscriber, subscription.identity);\n });\n }\n resolve();\n });\n });\n }\n }, {\n key: '_onSubscribe',\n\n\n //message received to set a routing path\n value: function _onSubscribe(msg) {\n\n var _this = this;\n\n var resources = msg.body.resources;\n\n var subscriber = msg.from;\n var domain = (0, _utils.divideURL)(resources[0]).domain; //we are assuming resources are all from the same domain\n\n var identity = msg.body.identity;\n\n _this.createSubscription(domain, resources, subscriber, identity).then(function (reply) {\n //forward to hyperty:\n reply.id = msg.id;\n reply.from = _this._url;\n reply.to = subscriber;\n reply.body = msg.body;\n reply.body.code = 200;\n\n log.log('[SubscriptionManager] - craeteSubscription: ', msg, reply, subscriber);\n\n _this._bus.postMessage(reply);\n\n if (!_this._subscriptionsStorage[subscriber]) {\n\n _this._subscriptionsStorage[subscriber] = {\n domain: domain,\n resources: resources,\n subscriber: subscriber,\n identity: identity\n };\n } else {\n resources.forEach(function (resource) {\n if (!_this._subscriptionsStorage[subscriber].resources.includes(resource)) {\n _this._subscriptionsStorage[subscriber].resources.push(resource);\n }\n });\n }\n\n _this._storage.set('subscriptions', 1, _this._subscriptionsStorage);\n });\n }\n }, {\n key: 'createSubscription',\n value: function createSubscription(domain, resources, subscriber, identity) {\n\n var _this = this;\n //debugger;\n return new _promise2.default(function (resolve) {\n //FLOW-OUT: subscribe message to the msg-node, registering listeners on the broker\n\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { identity: identity, resources: resources, source: subscriber }\n };\n\n //subscribe in msg-node\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('[SubscriptionManager] node-subscribe-response: ', reply);\n\n //if (reply.body.code === 200) {//TODO: uncomment when MN replies with correct response body code\n\n //TODO: support multiple routes for multiple resources\n\n var subscription = _this._subscriptions[subscriber];\n log.log('[SubscriptionManager] - ', _this._subscriptions, resources, _this._subscriptions.hasOwnProperty(subscriber));\n if (!subscription) {\n _this._subscriptions[subscriber] = {};\n }\n\n resources.forEach(function (resource) {\n _this._subscriptions[subscriber][resource] = new _Subscription2.default(_this._bus, subscriber, resource);\n });\n\n resolve(reply);\n });\n });\n }\n\n // message received to remove routing path\n\n }, {\n key: '_onUnSubscribe',\n value: function _onUnSubscribe(msg) {\n var _this = this;\n\n var unsubscriber = msg.from;\n var resource = msg.body.resource;\n\n if (_this._subscriptions[unsubscriber] && _this._subscriptions[unsubscriber][resource]) {\n var domain = (0, _utils.divideURL)(resource).domain;\n var subscription = _this._subscriptions[unsubscriber][resource];\n\n //FLOW-OUT: message sent to msg-node SubscriptionManager component\n _this._bus.postMessage({\n type: 'unsubscribe', from: _this._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { resources: [resource], source: unsubscriber }\n });\n\n subscription._releaseListeners();\n delete _this._subscriptions[unsubscriber][resource];\n\n if (_this._subscriptionsStorage[unsubscriber]) {\n var i = _this._subscriptionsStorage[unsubscriber].resources.indexOf(resource);\n if (i != -1) {\n _this._subscriptionsStorage[unsubscriber].resources.splice(i, 1);\n }\n _this._storage.set('subscriptions', 1, _this._subscriptionsStorage);\n }\n }\n\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n });\n }\n\n //message received to read existing routing paths. At this point limited to read all existing routing paths set for one listener\n\n }, {\n key: '_onRead',\n value: function _onRead(msg) {\n\n var _this = this;\n\n var listenerAddress = msg.body.resource;\n var reply = void 0;\n\n log.log('[SubscriptionManager] - request to read Subscriptions: ', msg);\n\n _this._storage.get('subscriptions').then(function (subscriptions) {\n if (subscriptions && subscriptions[listenerAddress]) {\n var resources = subscriptions[listenerAddress].resources;\n\n reply = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, value: resources }\n };\n } else {\n reply = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 404, description: 'Not Found' }\n };\n }\n _this._bus.postMessage(reply);\n });\n }\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n }]);\n return SubscriptionManager;\n}();\n\nexports.default = SubscriptionManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zdWJzY3JpcHRpb25NYW5hZ2VyL1N1YnNjcmlwdGlvbk1hbmFnZXIuanM/ZGE4MiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBD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value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Subscription'); // Log System\n\nvar Subscription = function () {\n function Subscription(bus, subscriber, resource) {\n (0, _classCallCheck3.default)(this, Subscription);\n\n var _this = this;\n _this._subscriber = subscriber;\n _this.resource = resource;\n\n log.log('[SubscriptionManager.Subscription] new: ', subscriber, resource);\n\n //add forward\n _this._listener = bus.addForward(resource, subscriber);\n }\n\n (0, _createClass3.default)(Subscription, [{\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._listener.remove();\n }\n }]);\n return Subscription;\n}();\n\nexports.default = Subscription;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zdWJzY3JpcHRpb25NYW5hZ2VyL1N1YnNjcmlwdGlvbi5qcz85NDk1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignU3Vic2NyaXB0aW9uJyk7XG5cbmNsYXNzIFN1YnNjcmlwdGlvbiB7XG5cbiAgY29uc3RydWN0b3IoYnVzLCBzdWJzY3JpYmVyLCByZXNvdXJjZSkge1xuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgX3RoaXMuX3N1YnNjcmliZXIgPSBzdWJzY3JpYmVyO1xuICAgIF90aGlzLnJlc291cmNlID0gcmVzb3VyY2U7XG5cbiAgICBsb2cubG9nKCdbU3Vic2NyaXB0aW9uTWFuYWdlci5TdWJzY3JpcHRpb25dIG5ldzogJywgc3Vic2NyaWJlciwgcmVzb3VyY2UpXG5cbiAgICAvL2FkZCBmb3J3YXJkXG4gICAgX3RoaXMuX2xpc3RlbmVyID0gYnVzLmFkZEZvcndhcmQocmVzb3VyY2UsIHN1YnNjcmliZXIpO1xuXG4gIH1cblxuICBfcmVsZWFzZUxpc3RlbmVycygpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgX3RoaXMuX2xpc3RlbmVyLnJlbW92ZSgpO1xuXG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBTdWJzY3JpcHRpb247XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3N1YnNjcmlwdGlvbk1hbmFnZXIvU3Vic2NyaXB0aW9uLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUNBO0FBQ0E7QUFEQTtBQUNBOzs7OztBQUFBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///545\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _AllowOverrides = __webpack_require__(215);\n\nvar _AllowOverrides2 = _interopRequireDefault(_AllowOverrides);\n\nvar _BlockOverrides = __webpack_require__(216);\n\nvar _BlockOverrides2 = _interopRequireDefault(_BlockOverrides);\n\nvar _utils = __webpack_require__(6);\n\nvar _FirstApplicable = __webpack_require__(217);\n\nvar _FirstApplicable2 = _interopRequireDefault(_FirstApplicable);\n\nvar _ReThinkCtx2 = __webpack_require__(547);\n\nvar _ReThinkCtx3 = _interopRequireDefault(_ReThinkCtx2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('PEP');\n\nvar RuntimeCoreCtx = function (_ReThinkCtx) {\n (0, _inherits3.default)(RuntimeCoreCtx, _ReThinkCtx);\n\n function RuntimeCoreCtx(runtimeURL, idModule, runtimeRegistry, storageManager, runtimeCapabilities) {\n (0, _classCallCheck3.default)(this, RuntimeCoreCtx);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (RuntimeCoreCtx.__proto__ || (0, _getPrototypeOf2.default)(RuntimeCoreCtx)).call(this));\n\n _this2._runtimeURL = runtimeURL;\n _this2._pepURL = _this2._runtimeURL + '/pep';\n _this2._guiURL = _this2._runtimeURL + '/policy-gui';\n _this2.idModule = idModule;\n _this2.runtimeRegistry = runtimeRegistry;\n _this2.activeUserPolicy = undefined;\n _this2.serviceProviderPolicy = {};\n _this2.userPolicies = {};\n _this2.storageManager = storageManager;\n _this2.runtimeCapabilities = runtimeCapabilities;\n return _this2;\n }\n\n (0, _createClass3.default)(RuntimeCoreCtx, [{\n key: 'loadConfigurations',\n value: function loadConfigurations() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n console.log(_this.storageManager);\n\n _this.storageManager.get('rethink:activePolicy').then(function (value) {\n _this.activeUserPolicy = value;\n\n return _this.storageManager.get('rethink:groups');\n }).then(function (groupInfo) {\n var groups = groupInfo;\n _this.groups = groups === undefined ? {} : groups;\n\n return _this.storageManager.get('rethink:spPolicies');\n }).then(function (policiesInfo) {\n var spPolicies = policiesInfo;\n _this.serviceProviderPolicy = spPolicies === undefined ? {} : spPolicies;\n\n _this._loadUserPolicies().then(function () {\n resolve();\n });\n });\n });\n }\n }, {\n key: 'getPolicies',\n value: function getPolicies(message, isIncomingMessage) {\n var policies = {};\n\n if (this.activeUserPolicy !== undefined) {\n policies.userPolicy = this.userPolicies[this.activeUserPolicy];\n }\n\n policies.serviceProviderPolicy = this.getServiceProviderPolicy(message, isIncomingMessage);\n\n return policies;\n }\n }, {\n key: '_isValidUpdate',\n value: function _isValidUpdate(message) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n if (message.from.split('://').length > 1) {\n _this.idModule._getHypertyFromDataObject(message.from).then(function (hypertyURL) {\n if (hypertyURL === message.body.source) {\n resolve(message);\n } else {\n reject('The source of the message is not valid.');\n }\n }, function (error) {\n reject(error);\n });\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'getMyEmails',\n value: function getMyEmails() {\n var identities = this.idModule.getIdentities();\n var emails = [];\n\n for (var i in identities) {\n emails.push((0, _utils.getUserEmailFromURL)(identities[i].identity));\n }\n\n return emails;\n }\n }, {\n key: 'getMyHyperties',\n value: function getMyHyperties() {\n var hyperties = this.runtimeRegistry.hypertiesList;\n var hypertiesNames = [];\n\n for (var i in hyperties) {\n var hypertyName = hyperties[i].objectName;\n if (hypertiesNames.indexOf(hypertyName) === -1) {\n hypertiesNames.push(hypertyName);\n }\n }\n\n return hypertiesNames;\n }\n }, {\n key: 'getServiceProviderPolicy',\n value: function getServiceProviderPolicy(message, isIncoming) {\n var policy = void 0;\n\n if (isIncoming) {\n var toHyperty = this.runtimeRegistry.getHypertyName(message.to);\n policy = this.serviceProviderPolicy[toHyperty];\n } else {\n var fromHyperty = this.runtimeRegistry.getHypertyName(message.from);\n policy = this.serviceProviderPolicy[fromHyperty];\n }\n return policy;\n }\n }, {\n key: 'getURL',\n value: function getURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n }\n\n /**\n * Creates a group with the given name.\n * @param {String} groupName\n */\n\n }, {\n key: '_loadUserPolicies',\n value: function _loadUserPolicies() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.storageManager.get('rethink:userPolicies').then(function (value) {\n var policies = value;\n if (policies !== undefined) {\n for (var i in policies) {\n _this3.pep.addPolicy('USER', i, policies[i]);\n }\n }\n resolve();\n });\n });\n }\n }, {\n key: '_getLastComponentOfURL',\n value: function _getLastComponentOfURL(url) {\n var split = url.split('/');\n return split[split.length - 1];\n }\n }, {\n key: '_getPoliciesJSON',\n value: function _getPoliciesJSON(policies) {\n for (var i in policies) {\n var combiningAlgorithm = policies[i].combiningAlgorithm;\n if (combiningAlgorithm instanceof _BlockOverrides2.default) {\n policies[i].combiningAlgorithm = 'blockOverrides';\n } else {\n if (combiningAlgorithm instanceof _AllowOverrides2.default) {\n policies[i].combiningAlgorithm = 'allowOverrides';\n } else {\n if (combiningAlgorithm instanceof _FirstApplicable2.default) {\n policies[i].combiningAlgorithm = 'firstApplicable';\n } else {\n policies[i].combiningAlgorithm = undefined;\n }\n }\n }\n }\n\n return policies;\n }\n }, {\n key: 'saveActivePolicy',\n value: function saveActivePolicy() {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.set('rethink:activePolicy', 0, _this4.activeUserPolicy).then(function () {\n resolve();\n });\n });\n }\n }, {\n key: 'saveGroups',\n value: function saveGroups() {\n var _this5 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.set('rethink:groups', 0, _this5.groups).then(function () {\n resolve();\n });\n });\n }\n }, {\n key: 'savePolicies',\n value: function savePolicies(source, policy, key) {\n var policiesJson = void 0;\n\n switch (source) {\n case 'USER':\n policiesJson = (0, _stringify2.default)(this.userPolicies);\n policiesJson = this._getPoliciesJSON(JSON.parse(policiesJson));\n this.storageManager.set('rethink:userPolicies', 0, policiesJson);\n break;\n case 'SERVICE_PROVIDER':\n if (policy !== undefined & key !== undefined) {\n this.serviceProviderPolicy[key] = policy;\n }\n policiesJson = (0, _stringify2.default)(this.serviceProviderPolicy);\n policiesJson = this._getPoliciesJSON(JSON.parse(policiesJson));\n this.storageManager.set('rethink:spPolicies', 0, policiesJson);\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'getGroupsNames',\n value: function getGroupsNames() {\n var myGroups = this.groups;\n var groupsNames = [];\n if (myGroups !== undefined) {\n for (var groupName in myGroups) {\n groupsNames.push(groupName);\n }\n }\n return groupsNames;\n }\n }, {\n key: 'getGroup',\n value: function getGroup(groupName, destination) {\n var members = [];\n\n if (groupName === 'preauthorised') {\n var dataObjectURL = destination.split('/');\n dataObjectURL.pop();\n dataObjectURL = dataObjectURL[0] + '//' + dataObjectURL[2];\n members = this.runtimeRegistry.getPreAuthSubscribers(dataObjectURL);\n } else {\n if (this.groups[groupName] !== undefined) {\n members = this.groups[groupName];\n }\n }\n\n return members;\n }\n\n /**\n * Creates a group with the given name.\n * @param {String} groupName\n */\n\n }, {\n key: 'createGroup',\n value: function createGroup(groupName) {\n this.groups[groupName] = [];\n this.saveGroups();\n }\n }, {\n key: 'deleteGroup',\n value: function deleteGroup(groupName) {\n delete this.groups[groupName];\n this.saveGroups();\n }\n\n /**\n * Adds the given user email to the group with the given name.\n * @param {String} userEmail\n * @param {String} groupName\n */\n\n }, {\n key: 'addToGroup',\n value: function addToGroup(groupName, userEmail) {\n var myGroups = this.groups;\n if (myGroups[groupName] !== undefined) {\n if (myGroups[groupName].indexOf(userEmail) === -1) {\n myGroups[groupName].push(userEmail);\n this.saveGroups();\n }\n } else {\n throw Error('Group \"' + groupName + '\" does not exist!');\n }\n }\n }, {\n key: 'removeFromGroup',\n value: function removeFromGroup(groupName, userEmail) {\n var group = this.groups[groupName];\n\n group.splice(group.indexOf(userEmail), 1);\n this.saveGroups();\n }\n }, {\n key: 'pepURL',\n get: function get() {\n var _this = this;\n return _this._pepURL;\n }\n }, {\n key: 'guiURL',\n get: function get() {\n var _this = this;\n return _this._guiURL;\n }\n }, {\n key: 'runtimeURL',\n get: function get() {\n var _this = this;\n return _this._runtimeURL;\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n }\n }, {\n key: 'subscription',\n get: function get() {\n return this._subscription;\n },\n set: function set(params) {\n this._subscription = params.message.body.subscriber;\n }\n }]);\n return RuntimeCoreCtx;\n}(_ReThinkCtx3.default);\n\nexports.default = RuntimeCoreCtx;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ2LmpzIiw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QTs7O0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7QUF2REE7QUFDQTtBQWdVQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///546\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ReThinkCtx = function () {\n function ReThinkCtx() {\n (0, _classCallCheck3.default)(this, ReThinkCtx);\n\n this.defaultBehaviour = true;\n this.groups = {};\n }\n\n (0, _createClass3.default)(ReThinkCtx, [{\n key: 'scheme',\n get: function get() {\n return this._scheme;\n },\n set: function set(params) {\n var from = params.message.from;\n if ((0, _utils.isDataObjectURL)(from)) {\n this._scheme = (0, _utils.divideURL)(from).type;\n } else {\n this._scheme = undefined;\n }\n }\n }, {\n key: 'date',\n get: function get() {\n return this._date;\n },\n set: function set(now) {\n var date = new Date();\n var day = String(date.getDate());\n if (day.length === 1) {\n day = '0' + day;\n }\n var month = String(date.getMonth() + 1);\n if (month.length === 1) {\n month = '0' + month;\n }\n this._date = day + '/' + month + '/' + date.getFullYear();\n }\n }, {\n key: 'domain',\n get: function get() {\n return this._domain;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._domain = (0, _utils.divideEmail)(params.message.body.identity.userProfile.username).domain;\n }\n }\n }, {\n key: 'type',\n get: function get() {\n return this._type;\n },\n set: function set(params) {\n var message = params.message;\n if (message.body.value !== undefined) {\n this._type = message.body.value.resourceType;\n }\n }\n }, {\n key: 'source',\n get: function get() {\n return this._source;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._source = params.message.body.identity.userProfile.username;\n }\n }\n }, {\n key: 'time',\n get: function get() {\n return this._time;\n },\n set: function set(now) {\n now = new Date();\n var minutes = String(now.getMinutes());\n if (minutes.length === 1) {\n minutes = '0' + minutes;\n }\n this._time = parseInt(String(now.getHours()) + minutes);\n }\n }, {\n key: 'weekday',\n get: function get() {\n return this._weekday;\n },\n set: function set(now) {\n this._weekday = String(new Date().getDay());\n }\n }]);\n return ReThinkCtx;\n}();\n\nexports.default = ReThinkCtx;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUmVUaGlua0N0eC5qcz82ZmRhIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZGl2aWRlRW1haWwsIGRpdmlkZVVSTCwgaXNEYXRhT2JqZWN0VVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNsYXNzIFJlVGhpbmtDdHgge1xuXG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuZGVmYXVsdEJlaGF2aW91ciA9IHRydWU7XG4gICAgdGhpcy5ncm91cHMgPSB7fTtcbiAgfVxuXG4gIGdldCBzY2hlbWUoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3NjaGVtZTtcbiAgfVxuXG4gIGdldCBkYXRlKCkge1xuICAgIHJldHVybiB0aGlzLl9kYXRlO1xuICB9XG5cbiAgZ2V0IGRvbWFpbigpIHtcbiAgICByZXR1cm4gdGhpcy5fZG9tYWluO1xuICB9XG5cbiAgZ2V0IHR5cGUoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3R5cGU7XG4gIH1cblxuICBnZXQgc291cmNlKCkge1xuICAgIHJldHVybiB0aGlzLl9zb3VyY2U7XG4gIH1cblxuICBnZXQgdGltZSgpIHtcbiAgICByZXR1cm4gdGhpcy5fdGltZTtcbiAgfVxuXG4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7QUEvQkE7QUFDQTtBQUNBO0FBK0JBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBeENBO0FBQ0E7QUFDQTtBQXdDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQ0E7QUFDQTtBQUNBO0FBMENBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBN0NBO0FBQ0E7QUFDQTtBQTZDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUEvQ0E7QUFDQTtBQUNBO0FBK0NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXBEQTtBQUNBO0FBQ0E7QUFvREE7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///547\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray2 = __webpack_require__(549);\n\nvar _slicedToArray3 = _interopRequireDefault(_slicedToArray2);\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _CatalogueDataObjectFactory = __webpack_require__(556);\n\nvar _CatalogueDataObjectFactory2 = _interopRequireDefault(_CatalogueDataObjectFactory);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('RuntimeCatalogue'); // Log System\n\nvar RuntimeCatalogue = function () {\n function RuntimeCatalogue(runtimeFactory, name, schema) {\n (0, _classCallCheck3.default)(this, RuntimeCatalogue);\n\n if (!runtimeFactory) throw Error('The catalogue needs the runtimeFactory');\n\n this._factory = new _CatalogueDataObjectFactory2.default();\n this.httpRequest = runtimeFactory.createHttpRequest();\n this.atob = runtimeFactory.atob ? runtimeFactory.atob : atob;\n\n var storageName = name ? name : 'runtimeCatalogue';\n var storageSchema = schema ? schema : '&cguid, accessControlPolicy, constraints, dataObjects, hypertyType, objectName, sourcePackage, version';\n\n var schemas = {};\n schemas[storageName] = storageSchema;\n\n this.storageManager = runtimeFactory.storageManager(storageName, schemas);\n }\n\n /**\n * Get a Catalogue Data Object (Descriptor) from a URL, and construct it using the provided function\n * @param {String} descriptorURL - e.g. mydomain.com/.well-known/hyperty/MyHyperty\n * @param {function} createFunc - e.g. createHyperty\n * @param {boolean} [getFull] - whether or not to get descriptor with sourcePackage, or only the descriptor part\n * @param {JSON} constraints - constraints object\n * @returns {Promise} - Promise that fulfills with the requested descriptor in the appropriate type.\n * If constraints were provided, a descriptor is only returned if it meets the constraints, otherwise the promise will be rejected.\n */\n\n\n (0, _createClass3.default)(RuntimeCatalogue, [{\n key: 'getDescriptor',\n value: function getDescriptor(descriptorURL, createFunc) {\n var _this = this;\n\n var getFull = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var constraints = arguments[3];\n\n log.info('[RuntimeCatalogue] - getting descriptor from: ', descriptorURL, ' with constraints: ', constraints);\n\n // some flags for optimization\n // (later the descriptor will not be saved in case both of these booleans are true)\n var isSavedDescriptor = false;\n var isCompleteDescriptor = false;\n\n // get raw descriptor\n // first checks if descriptor is already in localStorage (based on cguid and version)\n var descriptorPromise = void 0;\n if (constraints != undefined) {\n descriptorPromise = _promise2.default.all([this.httpRequest.post(descriptorURL + '/version', { body: (0, _stringify2.default)(constraints) }), this.httpRequest.post(descriptorURL + '/cguid', { body: (0, _stringify2.default)(constraints) })]);\n } else {\n descriptorPromise = _promise2.default.all([this.httpRequest.get(descriptorURL + '/version'), this.httpRequest.get(descriptorURL + '/cguid')]);\n }\n descriptorPromise = descriptorPromise.then(function (_ref) {\n var _ref2 = (0, _slicedToArray3.default)(_ref, 2),\n version = _ref2[0],\n cguid = _ref2[1];\n\n log.info('[RuntimeCatalogue] - got version (' + version + ') and cguid (' + cguid + ') for descriptor ' + descriptorURL);\n\n // check if same version is contained in localStorage\n return _this.storageManager.getVersion('cguid', cguid).then(function (dbVersion) {\n if (dbVersion >= version) {\n log.warn('storageManager contains saved version that is the same or newer than requested');\n isSavedDescriptor = true;\n return _this.storageManager.get('cguid', cguid);\n } else {\n log.warn('storageManager does not contain saved version');\n\n // no saved copy, proceed with retrieving descriptor\n var retrievePromise = constraints != undefined ? _this.httpRequest.post(descriptorURL, { body: (0, _stringify2.default)(constraints) }) : _this.httpRequest.get(descriptorURL);\n return retrievePromise.then(function (descriptor) {\n descriptor = JSON.parse(descriptor);\n\n //log.log(\"got descriptor:\", JSON.stringify(descriptor, null, 2));\n if (descriptor['ERROR']) {\n // TODO handle error properly\n throw new Error(descriptor);\n } else {\n return descriptor;\n }\n });\n }\n });\n }).catch(function (error) {\n var errorString = 'Unable to get descriptor for ' + descriptorURL + (constraints != undefined ? ' with constraints ' + constraints : '') + ': ' + error;\n log.error(errorString);\n throw new Error(errorString);\n });\n\n var returnPromise = descriptorPromise;\n\n // if getFull, attach sourcePackage\n if (getFull) {\n log.log('adding promise to attach sourcePackage');\n returnPromise = descriptorPromise.then(function (descriptor) {\n if (descriptor.sourcePackage) {\n isCompleteDescriptor = true;\n return descriptor;\n } else {\n isCompleteDescriptor = false;\n return _this.attachRawSourcePackage(descriptor);\n }\n });\n }\n\n // finally create object\n returnPromise = returnPromise.then(function (descriptor) {\n // store if not saved before, or if full descriptor was requested and only partial descriptor was stored.\n if (!isSavedDescriptor || isSavedDescriptor && !isCompleteDescriptor && getFull) {\n _this.storageManager.set(descriptor.cguid, descriptor.version, descriptor);\n }\n return createFunc.apply(_this, [descriptor, constraints]);\n });\n\n return returnPromise;\n }\n\n /**\n * Uses the sourcePackageURL from the descriptor, requests the sourcePackage and attaches it to the descriptor.\n * @param {CatalogueDataObject} descriptor\n * @param {JSON} constraints - constraints object\n * @returns {Promise} - fulfills with complete descriptor\n */\n\n }, {\n key: 'attachRawSourcePackage',\n value: function attachRawSourcePackage(descriptor, constraints) {\n var _this2 = this;\n\n log.log('attaching raw sourcePackage from:', descriptor.sourcePackageURL);\n return new _promise2.default(function (resolve, reject) {\n var retrievePromise = constraints != undefined ? _this2.httpRequest.post(descriptor.sourcePackageURL, { body: (0, _stringify2.default)(constraints) }) : _this2.httpRequest.get(descriptor.sourcePackageURL);\n retrievePromise.then(function (sourcePackage) {\n sourcePackage = JSON.parse(sourcePackage);\n\n //delete descriptor.sourcePackageURL;\n //log.log(\"attaching sourcePackage:\", sourcePackage);\n descriptor.sourcePackage = sourcePackage;\n resolve(descriptor);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n\n /**\n * Get HypertyDescriptor\n * @param hypertyURL - e.g. mydomain.com/.well-known/hyperty/MyHyperty\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getHypertyDescriptor',\n value: function getHypertyDescriptor(hypertyURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(hypertyURL, this.createHyperty, getFull, constraints);\n }\n\n /**\n * Get StubDescriptor\n * @param stubURL - e.g. mydomain.com/.well-known/protostub/MyProtostub\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getStubDescriptor',\n value: function getStubDescriptor(stubURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(stubURL, this.createStub, getFull, constraints);\n }\n\n /**\n * Get RuntimeDescriptor\n * @param runtimeURL - e.g. mydomain.com/.well-known/runtime/MyRuntime\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getRuntimeDescriptor',\n value: function getRuntimeDescriptor(runtimeURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(runtimeURL, this.createRuntimeDescriptor, getFull, constraints);\n }\n\n /**\n * Get DataSchemaDescriptor\n * @param dataSchemaURL - e.g. mydomain.com/.well-known/dataschema/MyDataSchema\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getDataSchemaDescriptor',\n value: function getDataSchemaDescriptor(dataSchemaURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(dataSchemaURL, this.createDataSchema, getFull, constraints);\n }\n\n /**\n * Get IDPProxyDescriptor\n * @param idpProxyURL - e.g. mydomain.com/.well-known/idp-proxy/MyProxy\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getIdpProxyDescriptor',\n value: function getIdpProxyDescriptor(idpProxyURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(idpProxyURL, this.createIdpProxy, getFull, constraints);\n }\n\n /**\n * Create HypertyDescriptor based on raw object that contains its attributes\n * @param {JSON} rawHyperty\n * @returns {HypertyDescriptor}\n */\n\n }, {\n key: 'createHyperty',\n value: function createHyperty(rawHyperty) {\n //log.log(\"createHyperty:\", rawHyperty);\n // create the descriptor\n var hyperty = this._factory.createHypertyDescriptorObject(rawHyperty['cguid'], rawHyperty['version'], rawHyperty['objectName'], rawHyperty['description'], rawHyperty['language'], rawHyperty['sourcePackageURL'], rawHyperty['type'] || rawHyperty['hypertyType'], rawHyperty['dataObjects']);\n\n //log.log(\"factory returned:\", hyperty);\n\n // optional fields\n hyperty.configuration = rawHyperty['configuration'];\n hyperty.constraints = rawHyperty['constraints'];\n hyperty.messageSchema = rawHyperty['messageSchema'];\n hyperty.policies = rawHyperty['policies'];\n hyperty.signature = rawHyperty['signature'];\n\n // parse and attach sourcePackage\n var sourcePackage = rawHyperty['sourcePackage'];\n if (sourcePackage) {\n hyperty.sourcePackage = this.createSourcePackage(sourcePackage);\n }\n\n return hyperty;\n }\n\n /**\n * Create ProtocolStubDescriptor based on raw object that contains its attributes\n * @param rawStub\n * @returns {ProtocolStubDescriptor}\n */\n\n }, {\n key: 'createStub',\n value: function createStub(rawStub) {\n // log.log(\"creating stub descriptor based on: \", rawStub);\n\n // create the descriptor\n var stub = this._factory.createProtoStubDescriptorObject(rawStub['cguid'], rawStub['version'], rawStub['objectName'], rawStub['description'], rawStub['language'], rawStub['sourcePackageURL'], rawStub['messageSchemas'], rawStub['configuration'], rawStub['constraints'], rawStub['hypertyType'], rawStub['dataObjects'], rawStub['interworking'], rawStub['idpProxy'], rawStub['mutualAuthentication']);\n\n // optional fields\n stub.signature = rawStub['signature'];\n\n // parse and attach the sourcePackage\n var sourcePackage = rawStub['sourcePackage'];\n if (sourcePackage) {\n stub.sourcePackage = this.createSourcePackage(sourcePackage);\n }\n\n return stub;\n }\n\n /**\n * Create HypertyRuntimeDescriptor based on raw object that contains its attributes\n * @param rawRuntime\n * @returns {HypertyRuntimeDescriptor}\n */\n\n }, {\n key: 'createRuntimeDescriptor',\n value: function createRuntimeDescriptor(rawRuntime) {\n // parse capabilities first\n try {\n rawRuntime['hypertyCapabilities'] = JSON.parse(rawRuntime['hypertyCapabilities']);\n rawRuntime['protocolCapabilities'] = JSON.parse(rawRuntime['protocolCapabilities']);\n } catch (e) {}\n // already json object\n\n\n //log.log(\"creating runtime descriptor based on: \", rawRuntime);\n\n\n // create the descriptor\n var runtime = this._factory.createHypertyRuntimeDescriptorObject(rawRuntime['cguid'], rawRuntime['version'], rawRuntime['objectName'], rawRuntime['description'], rawRuntime['language'], rawRuntime['sourcePackageURL'], rawRuntime['type'] || rawRuntime['runtimeType'], rawRuntime['hypertyCapabilities'], rawRuntime['protocolCapabilities'], rawRuntime['p2pHandlerStub'], rawRuntime['p2pRequesterStub']);\n\n // optional fields\n runtime.signature = rawRuntime['signature'];\n\n // parse and attach sourcePackage\n var sourcePackage = rawRuntime['sourcePackage'];\n if (sourcePackage) {\n // log.log(\"runtime has sourcePackage:\", sourcePackage);\n runtime.sourcePackage = this.createSourcePackage(sourcePackage);\n }\n return runtime;\n }\n\n /**\n * Create DataObjectSchema based on raw object that contains its attributes\n * @param rawSchema\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: 'createDataSchema',\n value: function createDataSchema(rawSchema) {\n //log.log(\"creating dataSchema based on: \", rawSchema);\n\n var dataSchema = void 0;\n\n //log.log('1. createMessageDataObjectSchema: ', rawSchema[\"accessControlPolicy\"]);\n //log.log('2. createMessageDataObjectSchema: ', rawSchema[\"scheme\"]);\n if (rawSchema['accessControlPolicy'] && rawSchema['scheme']) {\n dataSchema = this._factory.createHypertyDataObjectSchema(rawSchema['cguid'], rawSchema['version'], rawSchema['objectName'], rawSchema['description'], rawSchema['language'], rawSchema['sourcePackageURL'], rawSchema['accessControlPolicy'], rawSchema['scheme']);\n } else {\n //log.log('3. createMessageDataObjectSchema: ', rawSchema);\n dataSchema = this._factory.createMessageDataObjectSchema(rawSchema['cguid'], rawSchema['version'], rawSchema['objectName'], rawSchema['description'], rawSchema['language'], rawSchema['sourcePackageURL']);\n }\n\n // optional fields\n dataSchema.signature = rawSchema['signature'];\n\n // parse and attach sourcePackage\n var sourcePackage = rawSchema['sourcePackage'];\n if (sourcePackage) {\n //log.log(\"dataSchema has sourcePackage:\", sourcePackage);\n dataSchema.sourcePackage = this.createSourcePackage(sourcePackage);\n\n try {\n dataSchema.sourcePackage.sourceCode = JSON.parse(dataSchema.sourcePackage.sourceCode);\n } catch (e) {\n log.log('DataSchema Source code is already parsed');\n }\n\n return dataSchema;\n }\n\n //log.log(\"created dataSchema descriptor object:\", dataSchema);\n return dataSchema;\n }\n\n /**\n * Create ProtocolStubDescriptor based on raw object that contains its attributes\n * @param rawProxy\n * @returns {ProtocolStubDescriptor}\n */\n\n }, {\n key: 'createIdpProxy',\n value: function createIdpProxy(rawProxy) {\n // log.log(\"creating idpproxy descriptor based on: \", rawProxy);\n\n // create the descriptor\n var idpproxy = this._factory.createProtoStubDescriptorObject(rawProxy['cguid'], rawProxy['version'], rawProxy['objectName'], rawProxy['description'], rawProxy['language'], rawProxy['sourcePackageURL'], rawProxy['messageSchemas'], rawProxy['configuration'], rawProxy['constraints'], rawProxy['hypertyType'], rawProxy['dataObjects'], rawProxy['interworking'], rawProxy['idpProxy'], rawProxy['mutualAuthentication']);\n\n // optional fields\n idpproxy.signature = rawProxy['signature'];\n\n // parse and attach the sourcePackage\n var sourcePackage = rawProxy['sourcePackage'];\n if (sourcePackage) {\n sourcePackage = this.createSourcePackage(sourcePackage);\n idpproxy.sourcePackage = sourcePackage;\n }\n\n return idpproxy;\n }\n }, {\n key: 'createSourcePackage',\n value: function createSourcePackage(sp) {\n //log.log(\"createSourcePackage:\", sp);\n\n // check encoding\n if (sp['encoding'] === 'base64') {\n sp['sourceCode'] = this.atob(sp['sourceCode']);\n sp['encoding'] = 'utf-8';\n }\n\n var sourcePackage = this._factory.createSourcePackage(sp['sourceCodeClassname'], sp['sourceCode']);\n if (sp['encoding']) sourcePackage.encoding = sp['encoding'];\n\n if (sp['signature']) sourcePackage.signature = sp['signature'];\n\n return sourcePackage;\n }\n\n /**\n * Get source Package from a URL\n * @param sourcePackageURL - e.g. mydomain.com/.well-known/hyperty/MyHyperty/sourcePackage\n * @returns {Promise}\n */\n\n }, {\n key: 'getSourcePackageFromURL',\n value: function getSourcePackageFromURL(sourcePackageURL) {\n var _this3 = this;\n\n log.log('getting sourcePackage from:', sourcePackageURL);\n\n return new _promise2.default(function (resolve, reject) {\n _this3.httpRequest.get(sourcePackageURL).then(function (result) {\n //log.log(\"got raw sourcePackage:\", result);\n if (result['ERROR']) {\n // TODO handle error properly\n reject(result);\n } else {\n result = JSON.parse(result);\n var sourcePackage = _this3.createSourcePackage(result);\n resolve(sourcePackage);\n }\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n\n /**\n * Returns the sourceCode of a given descriptor\n * @param {CatalogueDataObject} descriptor - Catalogue Object that was retrieved using e.g. getHypertyDescriptor()\n * @returns {Promise}\n */\n\n }, {\n key: 'getSourceCodeFromDescriptor',\n value: function getSourceCodeFromDescriptor(descriptor) {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (descriptor.sourcePackage) {\n //log.log(\"descriptor has sourcePackage\");\n //log.log(\"returning sourceCode:\", descriptor.sourcePackage.sourceCode);\n resolve(descriptor.sourcePackage.sourceCode);\n } else {\n _this4.storageManager.getVersion(descriptor.sourcePackageURL + '/sourceCode').then(function (dbVersion) {\n if (dbVersion >= descriptor.version) {\n log.log('returning cached version from storageManager');\n _this4.storageManager.get(descriptor.sourcePackageURL + '/sourceCode').then(function (sourceCode) {\n resolve(sourceCode);\n }).catch(function (reason) {\n reject(reason);\n });\n } else {\n _this4.httpRequest.get(descriptor.sourcePackageURL + '/sourceCode').then(function (sourceCode) {\n if (sourceCode['ERROR']) {\n // TODO handle error properly\n reject(sourceCode);\n } else {\n _this4.storageManager.set(descriptor.sourcePackageURL + '/sourceCode', descriptor.version, sourceCode);\n resolve(sourceCode);\n }\n }).catch(function (reason) {\n reject(reason);\n });\n }\n }).catch(function (reason) {\n reject(reason);\n });\n }\n });\n }\n\n /**\n * Returns the list of available catalogue objects for the given \"type URL\",\n * i.e. a catalogue URL that specifies a type, but no catalogue object name.\n * @param typeURL - URL pointing to the catalogue object type you want a list of available objects for,\n * e.g. hyperty-catalogue://catalogue.fokus.fraunhofer.de/.well-known/idp-proxy\n * @param {JSON} constraints - constraints object\n * @returns {Promise} typeListPromise - Promise that fulfills with the list of available catalogue object names for the requested type,\n * rejects on HTTP error or if the HTTP response is not in JSON.\n * If constraints were provided, then the list only contains those objects that meet the constraints\n */\n\n }, {\n key: 'getTypeList',\n value: function getTypeList(typeURL, constraints) {\n var _this5 = this;\n\n return new _promise2.default(function (resolve, reject) {\n var requestPromise = constraints != undefined ? _this5.httpRequest.post(typeURL, { body: (0, _stringify2.default)(constraints) }) : _this5.httpRequest.get(typeURL);\n requestPromise.then(function (typeList) {\n typeList = JSON.parse(typeList);\n resolve(typeList);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'deleteFromPM',\n value: function deleteFromPM(url) {\n return this.storageManager.delete(url);\n }\n }, {\n key: 'runtimeURL',\n set: function set(runtimeURL) {\n this._runtimeURL = runtimeURL;\n },\n get: function get() {\n return this._runtimeURL;\n }\n }]);\n return RuntimeCatalogue;\n}();\n\nexports.default = RuntimeCatalogue;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9SdW50aW1lQ2F0YWxvZ3VlLmpzPzU2NWUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7Ozs7QUFVQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBVUE7QUFDQTtBQUNBOzs7QUFWQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7Ozs7O0FBUUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///548\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _isIterable2 = __webpack_require__(550);\n\nvar _isIterable3 = _interopRequireDefault(_isIterable2);\n\nvar _getIterator2 = __webpack_require__(553);\n\nvar _getIterator3 = _interopRequireDefault(_getIterator2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if ((0, _isIterable3.default)(Object(arr))) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///549\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(551), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9pcy1pdGVyYWJsZS5qcz9iYWNmIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9pcy1pdGVyYWJsZVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9pcy1pdGVyYWJsZS5qc1xuLy8gbW9kdWxlIGlkID0gNTUwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///550\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(101);\n__webpack_require__(80);\nmodule.exports = __webpack_require__(552);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9pcy1pdGVyYWJsZS5qcz81ZGRkIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uL21vZHVsZXMvY29yZS5pcy1pdGVyYWJsZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2lzLWl0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA1NTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///551\n")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(142);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar Iterators = __webpack_require__(71);\nmodule.exports = __webpack_require__(11).isIterable = function (it) {\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n // eslint-disable-next-line no-prototype-builtins\n || Iterators.hasOwnProperty(classof(O));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuaXMtaXRlcmFibGUuanM/ZTRmOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY2xhc3NvZiA9IHJlcXVpcmUoJy4vX2NsYXNzb2YnKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19jb3JlJykuaXNJdGVyYWJsZSA9IGZ1bmN0aW9uIChpdCkge1xuICB2YXIgTyA9IE9iamVjdChpdCk7XG4gIHJldHVybiBPW0lURVJBVE9SXSAhPT0gdW5kZWZpbmVkXG4gICAgfHwgJ0BAaXRlcmF0b3InIGluIE9cbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tcHJvdG90eXBlLWJ1aWx0aW5zXG4gICAgfHwgSXRlcmF0b3JzLmhhc093blByb3BlcnR5KGNsYXNzb2YoTykpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuaXMtaXRlcmFibGUuanNcbi8vIG1vZHVsZSBpZCA9IDU1MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///552\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(554), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9nZXQtaXRlcmF0b3IuanM/MDRlZCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vZ2V0LWl0ZXJhdG9yXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2dldC1pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNTUzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///553\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(101);\n__webpack_require__(80);\nmodule.exports = __webpack_require__(555);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9nZXQtaXRlcmF0b3IuanM/N2YxNCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi9tb2R1bGVzL3dlYi5kb20uaXRlcmFibGUnKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvcicpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi9tb2R1bGVzL2NvcmUuZ2V0LWl0ZXJhdG9yJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vZ2V0LWl0ZXJhdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA1NTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///554\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(41);\nvar get = __webpack_require__(143);\nmodule.exports = __webpack_require__(11).getIterator = function (it) {\n var iterFn = get(it);\n if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');\n return anObject(iterFn.call(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuZ2V0LWl0ZXJhdG9yLmpzPzgzYzUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0ID0gcmVxdWlyZSgnLi9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fY29yZScpLmdldEl0ZXJhdG9yID0gZnVuY3Rpb24gKGl0KSB7XG4gIHZhciBpdGVyRm4gPSBnZXQoaXQpO1xuICBpZiAodHlwZW9mIGl0ZXJGbiAhPSAnZnVuY3Rpb24nKSB0aHJvdyBUeXBlRXJyb3IoaXQgKyAnIGlzIG5vdCBpdGVyYWJsZSEnKTtcbiAgcmV0dXJuIGFuT2JqZWN0KGl0ZXJGbi5jYWxsKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvY29yZS5nZXQtaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDU1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///555\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _CatalogueDataObject = __webpack_require__(72);\n\nvar _CatalogueDataObject2 = _interopRequireDefault(_CatalogueDataObject);\n\nvar _SourcePackage = __webpack_require__(559);\n\nvar _SourcePackage2 = _interopRequireDefault(_SourcePackage);\n\nvar _HypertyDescriptor = __webpack_require__(560);\n\nvar _HypertyDescriptor2 = _interopRequireDefault(_HypertyDescriptor);\n\nvar _ProtocolStubDescriptor = __webpack_require__(561);\n\nvar _ProtocolStubDescriptor2 = _interopRequireDefault(_ProtocolStubDescriptor);\n\nvar _HypertyRuntimeDescriptor = __webpack_require__(562);\n\nvar _HypertyRuntimeDescriptor2 = _interopRequireDefault(_HypertyRuntimeDescriptor);\n\nvar _HypertyInterceptorDescriptor = __webpack_require__(563);\n\nvar _HypertyInterceptorDescriptor2 = _interopRequireDefault(_HypertyInterceptorDescriptor);\n\nvar _DataObjectSchema = __webpack_require__(564);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar CatalogueDataObjectFactory = function () {\n function CatalogueDataObjectFactory() {\n (0, _classCallCheck3.default)(this, CatalogueDataObjectFactory);\n }\n\n (0, _createClass3.default)(CatalogueDataObjectFactory, [{\n key: "createCatalogueDataObject",\n\n\n /**\n * Create CatalogueDataObject\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {CatalogueObjectType} type - Indicates the type of Catalogue Data Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @returns {CatalogueDataObject}\n */\n value: function createCatalogueDataObject(guid, type, version, objectName, description, language, sourcePackageURL) {\n if (typeof guid === "undefined" || typeof type === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n return new _CatalogueDataObject2.default(guid, type, version, objectName, description, language, sourcePackageURL);\n }\n\n /**\n * Create HypertyDescriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object\n * can be downloaded.\n * @param {HypertyResourceType[]} hypertyType - An array of HypertyResourceType that identifies what type of hyperty\n * resources are handled by the object.\n * @param {URL.URLList} dataObjects - Defines the Data Object Schemas supported by the Hyperty through a list of Catalogue URLs from where these schemas can be reached.\n * @returns {HypertyDescriptor}\n */\n\n }, {\n key: "createHypertyDescriptorObject",\n value: function createHypertyDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, hypertyType, dataObjects) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof hypertyType === "undefined" || typeof dataObjects === "undefined") throw new Error("Invalid parameters!");\n return new _HypertyDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY, version, objectName, description, language, sourcePackageURL, hypertyType, dataObjects);\n }\n\n /**\n * Create ProtocolStubDescriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param {URL.URL} messageSchemas - Defines the Schema describing the Message Data Model used by the Hyperty through the Catalogue URL from where the Message schema can be reached. If not defined, by default it is assumed the standard Message Model is used.\n * @param configuration - Data required to configure the ProtocolStub\n * @param constraints - Describes capabilities required from the Hyperty Runtime in order to be able to execute the ProtocolStub\n * @param hypertyType\n * @param dataObjects\n * @param interworking\n * @param idpProxy\n * @param mutualAuthentication\n * @returns {ProtocolStubDescriptor}\n */\n\n }, {\n key: "createProtoStubDescriptorObject",\n value: function createProtoStubDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, messageSchemas, configuration, constraints, hypertyType, dataObjects, interworking, idpProxy, mutualAuthentication) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof messageSchemas === "undefined" || typeof configuration === "undefined" || typeof constraints === "undefined") throw new Error("Invalid parameters!");\n return new _ProtocolStubDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.PROTOSTUB, version, objectName, description, language, sourcePackageURL, messageSchemas, configuration, constraints, hypertyType, dataObjects, interworking, idpProxy, mutualAuthentication);\n }\n\n /**\n * Create HypertyRuntimeDescriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param {RuntimeType}runtimeType\n * @param {RuntimeHypertyCapabilities} hypertyCapabilities - Supported capabilities to execute Hyperties\n * @param {RuntimeProtocolCapabilities} protocolCapabilities - Supported capabilities to execute Protocol Stubs\n * @param p2pHandlerStub\n * @param p2pRequesterStub\n * @returns {HypertyRuntimeDescriptor} the data object of the Hyperty Runtime Descriptor\n */\n\n }, {\n key: "createHypertyRuntimeDescriptorObject",\n value: function createHypertyRuntimeDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, runtimeType, hypertyCapabilities, protocolCapabilities, p2pHandlerStub, p2pRequesterStub) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof runtimeType === "undefined") throw new Error("Invalid parameters!");\n\n return new _HypertyRuntimeDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_RUNTIME, version, objectName, description, language, sourcePackageURL, runtimeType, hypertyCapabilities, protocolCapabilities, p2pHandlerStub, p2pRequesterStub);\n }\n\n /**\n * Create Hyperty Interceptor Descriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param configuration\n * @param policies\n * @returns {PolicyEnforcerDescriptor}\n */\n\n }, {\n key: "createHypertyInterceptorDescriptorObject",\n value: function createHypertyInterceptorDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, configuration, policies) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n\n return new _HypertyInterceptorDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_INTERCEPTOR, version, objectName, description, language, sourcePackageURL, configuration, policies);\n }\n\n /**\n * Create DataObjectSchema which in effect is the MessageDataObjectSchema\n * @deprecated Use either createMessageDataObjectSchema or createHypertyDataObjectSchema instead\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: "createDataObjectSchema",\n value: function createDataObjectSchema(guid, version, objectName, description, language, sourcePackageURL) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n\n return new _DataObjectSchema.DataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL);\n }\n\n /**\n * Create DataObjectSchema which in effect is the MessageDataObjectSchema\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: "createMessageDataObjectSchema",\n value: function createMessageDataObjectSchema(guid, version, objectName, description, language, sourcePackageURL) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n\n return new _DataObjectSchema.DataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL);\n }\n\n /**\n * Create HypertyDataObjectSchema\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param {string} accessControlPolicy - policy rule to access object (see Reporter-Observer Comm pattern)\n * @param {DataUrlScheme} scheme - identifies the data scheme (COMM, CONNECTION, CTXT or IDENTITY)\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: "createHypertyDataObjectSchema",\n value: function createHypertyDataObjectSchema(guid, version, objectName, description, language, sourcePackageURL, accessControlPolicy, scheme) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof scheme === "undefined" || typeof accessControlPolicy === "undefined") throw new Error("Invalid parameters!");\n\n if (scheme === _DataObjectSchema.DataUrlScheme.COMM) return new _DataObjectSchema.CommunicationDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);else if (scheme === _DataObjectSchema.DataUrlScheme.CONNECTION) return new _DataObjectSchema.ConnectionDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);else if (scheme === _DataObjectSchema.DataUrlScheme.CTXT) return new _DataObjectSchema.ContextDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);else if (scheme === _DataObjectSchema.DataUrlScheme.IDENTITY) return new _DataObjectSchema.IdentityDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);\n }\n\n /**\n * Create SourcePackage\n * @param sourceCodeClassname - The Class-name of the SourceCode\n * @param sourceCode - The source code of the catalogue object\n * @returns {SourcePackage}\n */\n\n }, {\n key: "createSourcePackage",\n value: function createSourcePackage(sourceCodeClassname, sourceCode) {\n if (typeof sourceCode === "undefined" || typeof sourceCodeClassname === "undefined") throw new Error("Invalid parameters!");\n\n return new _SourcePackage2.default(sourceCodeClassname, sourceCode);\n }\n }]);\n return CatalogueDataObjectFactory;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = CatalogueDataObjectFactory;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9DYXRhbG9ndWVEYXRhT2JqZWN0RmFjdG9yeS5qcz8yZWQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4gKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuICogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4gKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gR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ports.RethinkObject = undefined;\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _tv = __webpack_require__(558);\n\nvar _tv2 = _interopRequireDefault(_tv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar RethinkObject = exports.RethinkObject = function () {\n function RethinkObject() {\n (0, _classCallCheck3.default)(this, RethinkObject);\n }\n\n (0, _createClass3.default)(RethinkObject, [{\n key: "validate",\n\n\n /**\n * Validates this RethinkObject against the provided schema.\n *\n * LIMITATIONS: The provided schema cannot contain references to other schemas, since they can\'t be resolved.\n * @param schema - schema to validate against\n * @returns {boolean} true if valid, false otherwise\n */\n value: function validate(schema) {\n // add schema itself so local references work\n _tv2.default.addSchema(schema.id, schema);\n\n // JSON stringify -> parse needed to have proper validation\n var result = _tv2.default.validateMultiple(JSON.parse((0, _stringify2.default)(this)), schema);\n\n // delete error stacks to improve logging\n result.errors.forEach(function (error) {\n delete error.stack;\n });\n\n // print more details about validation if it fails or schema contains $refs\n if (!result.valid || result.missing.length > 0) {\n console.warn("Object validation " + (result.valid ? "succeeded, but schema contained references:" : "failed:"), (0, _stringify2.default)(result, null, 2));\n console.log("Object:", (0, _stringify2.default)(this, null, 2));\n }\n return result.valid;\n }\n }]);\n return RethinkObject;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = RethinkObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9SZXRoaW5rT2JqZWN0LmpzP2YyOTIiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiAqIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4gKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiAqIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4gKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiAqIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiAqIENvcHlyaWdodCAyMDE2IEFwaXplZVxuICogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbiAqXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRo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AgICAgIH1cbiAgICAgICAgcmV0dXJuIHJlc3VsdC52YWxpZDtcbiAgICB9XG59XG5cblxuZXhwb3J0IGRlZmF1bHQgUmV0aGlua09iamVjdDtcblxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9ydW50aW1lLWNhdGFsb2d1ZS9SZXRoaW5rT2JqZWN0LmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBc0JBO0FBQ0E7Ozs7O0FBQ0E7Ozs7Ozs7OztBQUVBOzs7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQW5EQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBdURBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///557\n')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\r\nAuthor: Geraint Luff and others\r\nYear: 2013\r\n\r\nThis code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code.\r\n\r\nIf you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.\r\n*/\r\n(function (global, factory) {\r\n if (true) {\r\n // AMD. Register as an anonymous module.\r\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n } else if (typeof module !== \'undefined\' && module.exports){\r\n // CommonJS. Define export.\r\n module.exports = factory();\r\n } else {\r\n // Browser globals\r\n global.tv4 = factory();\r\n }\r\n}(this, function () {\r\n\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys\r\nif (!Object.keys) {\r\n\tObject.keys = (function () {\r\n\t\tvar hasOwnProperty = Object.prototype.hasOwnProperty,\r\n\t\t\thasDontEnumBug = !({toString: null}).propertyIsEnumerable(\'toString\'),\r\n\t\t\tdontEnums = [\r\n\t\t\t\t\'toString\',\r\n\t\t\t\t\'toLocaleString\',\r\n\t\t\t\t\'valueOf\',\r\n\t\t\t\t\'hasOwnProperty\',\r\n\t\t\t\t\'isPrototypeOf\',\r\n\t\t\t\t\'propertyIsEnumerable\',\r\n\t\t\t\t\'constructor\'\r\n\t\t\t],\r\n\t\t\tdontEnumsLength = dontEnums.length;\r\n\r\n\t\treturn function (obj) {\r\n\t\t\tif (typeof obj !== \'object\' && typeof obj !== \'function\' || obj === null) {\r\n\t\t\t\tthrow new TypeError(\'Object.keys called on non-object\');\r\n\t\t\t}\r\n\r\n\t\t\tvar result = [];\r\n\r\n\t\t\tfor (var prop in obj) {\r\n\t\t\t\tif (hasOwnProperty.call(obj, prop)) {\r\n\t\t\t\t\tresult.push(prop);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (hasDontEnumBug) {\r\n\t\t\t\tfor (var i=0; i < dontEnumsLength; i++) {\r\n\t\t\t\t\tif (hasOwnProperty.call(obj, dontEnums[i])) {\r\n\t\t\t\t\t\tresult.push(dontEnums[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t})();\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create\r\nif (!Object.create) {\r\n\tObject.create = (function(){\r\n\t\tfunction F(){}\r\n\r\n\t\treturn function(o){\r\n\t\t\tif (arguments.length !== 1) {\r\n\t\t\t\tthrow new Error(\'Object.create implementation only accepts one parameter.\');\r\n\t\t\t}\r\n\t\t\tF.prototype = o;\r\n\t\t\treturn new F();\r\n\t\t};\r\n\t})();\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray\r\nif(!Array.isArray) {\r\n\tArray.isArray = function (vArg) {\r\n\t\treturn Object.prototype.toString.call(vArg) === "[object Array]";\r\n\t};\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf\r\nif (!Array.prototype.indexOf) {\r\n\tArray.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\r\n\t\tif (this === null) {\r\n\t\t\tthrow new TypeError();\r\n\t\t}\r\n\t\tvar t = Object(this);\r\n\t\tvar len = t.length >>> 0;\r\n\r\n\t\tif (len === 0) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tvar n = 0;\r\n\t\tif (arguments.length > 1) {\r\n\t\t\tn = Number(arguments[1]);\r\n\t\t\tif (n !== n) { // shortcut for verifying if it\'s NaN\r\n\t\t\t\tn = 0;\r\n\t\t\t} else if (n !== 0 && n !== Infinity && n !== -Infinity) {\r\n\t\t\t\tn = (n > 0 || -1) * Math.floor(Math.abs(n));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (n >= len) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tvar k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\r\n\t\tfor (; k < len; k++) {\r\n\t\t\tif (k in t && t[k] === searchElement) {\r\n\t\t\t\treturn k;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t};\r\n}\r\n\r\n// Grungey Object.isFrozen hack\r\nif (!Object.isFrozen) {\r\n\tObject.isFrozen = function (obj) {\r\n\t\tvar key = "tv4_test_frozen_key";\r\n\t\twhile (obj.hasOwnProperty(key)) {\r\n\t\t\tkey += Math.random();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tobj[key] = true;\r\n\t\t\tdelete obj[key];\r\n\t\t\treturn false;\r\n\t\t} catch (e) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n}\r\n// Based on: https://github.com/geraintluff/uri-templates, but with all the de-substitution stuff removed\r\n\r\nvar uriTemplateGlobalModifiers = {\r\n\t"+": true,\r\n\t"#": true,\r\n\t".": true,\r\n\t"/": true,\r\n\t";": true,\r\n\t"?": true,\r\n\t"&": true\r\n};\r\nvar uriTemplateSuffices = {\r\n\t"*": true\r\n};\r\n\r\nfunction notReallyPercentEncode(string) {\r\n\treturn encodeURI(string).replace(/%25[0-9][0-9]/g, function (doubleEncoded) {\r\n\t\treturn "%" + doubleEncoded.substring(3);\r\n\t});\r\n}\r\n\r\nfunction uriTemplateSubstitution(spec) {\r\n\tvar modifier = "";\r\n\tif (uriTemplateGlobalModifiers[spec.charAt(0)]) {\r\n\t\tmodifier = spec.charAt(0);\r\n\t\tspec = spec.substring(1);\r\n\t}\r\n\tvar separator = "";\r\n\tvar prefix = "";\r\n\tvar shouldEscape = true;\r\n\tvar showVariables = false;\r\n\tvar trimEmptyString = false;\r\n\tif (modifier === \'+\') {\r\n\t\tshouldEscape = false;\r\n\t} else if (modifier === ".") {\r\n\t\tprefix = ".";\r\n\t\tseparator = ".";\r\n\t} else if (modifier === "/") {\r\n\t\tprefix = "/";\r\n\t\tseparator = "/";\r\n\t} else if (modifier === \'#\') {\r\n\t\tprefix = "#";\r\n\t\tshouldEscape = false;\r\n\t} else if (modifier === \';\') {\r\n\t\tprefix = ";";\r\n\t\tseparator = ";";\r\n\t\tshowVariables = true;\r\n\t\ttrimEmptyString = true;\r\n\t} else if (modifier === \'?\') {\r\n\t\tprefix = "?";\r\n\t\tseparator = "&";\r\n\t\tshowVariables = true;\r\n\t} else if (modifier === \'&\') {\r\n\t\tprefix = "&";\r\n\t\tseparator = "&";\r\n\t\tshowVariables = true;\r\n\t}\r\n\r\n\tvar varNames = [];\r\n\tvar varList = spec.split(",");\r\n\tvar varSpecs = [];\r\n\tvar varSpecMap = {};\r\n\tfor (var i = 0; i < varList.length; i++) {\r\n\t\tvar varName = varList[i];\r\n\t\tvar truncate = null;\r\n\t\tif (varName.indexOf(":") !== -1) {\r\n\t\t\tvar parts = varName.split(":");\r\n\t\t\tvarName = parts[0];\r\n\t\t\ttruncate = parseInt(parts[1], 10);\r\n\t\t}\r\n\t\tvar suffices = {};\r\n\t\twhile (uriTemplateSuffices[varName.charAt(varName.length - 1)]) {\r\n\t\t\tsuffices[varName.charAt(varName.length - 1)] = true;\r\n\t\t\tvarName = varName.substring(0, varName.length - 1);\r\n\t\t}\r\n\t\tvar varSpec = {\r\n\t\t\ttruncate: truncate,\r\n\t\t\tname: varName,\r\n\t\t\tsuffices: suffices\r\n\t\t};\r\n\t\tvarSpecs.push(varSpec);\r\n\t\tvarSpecMap[varName] = varSpec;\r\n\t\tvarNames.push(varName);\r\n\t}\r\n\tvar subFunction = function (valueFunction) {\r\n\t\tvar result = "";\r\n\t\tvar startIndex = 0;\r\n\t\tfor (var i = 0; i < varSpecs.length; i++) {\r\n\t\t\tvar varSpec = varSpecs[i];\r\n\t\t\tvar value = valueFunction(varSpec.name);\r\n\t\t\tif (value === null || value === undefined || (Array.isArray(value) && value.length === 0) || (typeof value === \'object\' && Object.keys(value).length === 0)) {\r\n\t\t\t\tstartIndex++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (i === startIndex) {\r\n\t\t\t\tresult += prefix;\r\n\t\t\t} else {\r\n\t\t\t\tresult += (separator || ",");\r\n\t\t\t}\r\n\t\t\tif (Array.isArray(value)) {\r\n\t\t\t\tif (showVariables) {\r\n\t\t\t\t\tresult += varSpec.name + "=";\r\n\t\t\t\t}\r\n\t\t\t\tfor (var j = 0; j < value.length; j++) {\r\n\t\t\t\t\tif (j > 0) {\r\n\t\t\t\t\t\tresult += varSpec.suffices[\'*\'] ? (separator || ",") : ",";\r\n\t\t\t\t\t\tif (varSpec.suffices[\'*\'] && showVariables) {\r\n\t\t\t\t\t\t\tresult += varSpec.name + "=";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(value[j]).replace(/!/g, "%21") : notReallyPercentEncode(value[j]);\r\n\t\t\t\t}\r\n\t\t\t} else if (typeof value === "object") {\r\n\t\t\t\tif (showVariables && !varSpec.suffices[\'*\']) {\r\n\t\t\t\t\tresult += varSpec.name + "=";\r\n\t\t\t\t}\r\n\t\t\t\tvar first = true;\r\n\t\t\t\tfor (var key in value) {\r\n\t\t\t\t\tif (!first) {\r\n\t\t\t\t\t\tresult += varSpec.suffices[\'*\'] ? (separator || ",") : ",";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfirst = false;\r\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(key).replace(/!/g, "%21") : notReallyPercentEncode(key);\r\n\t\t\t\t\tresult += varSpec.suffices[\'*\'] ? \'=\' : ",";\r\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(value[key]).replace(/!/g, "%21") : notReallyPercentEncode(value[key]);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (showVariables) {\r\n\t\t\t\t\tresult += varSpec.name;\r\n\t\t\t\t\tif (!trimEmptyString || value !== "") {\r\n\t\t\t\t\t\tresult += "=";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (varSpec.truncate != null) {\r\n\t\t\t\t\tvalue = value.substring(0, varSpec.truncate);\r\n\t\t\t\t}\r\n\t\t\t\tresult += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\tsubFunction.varNames = varNames;\r\n\treturn {\r\n\t\tprefix: prefix,\r\n\t\tsubstitution: subFunction\r\n\t};\r\n}\r\n\r\nfunction UriTemplate(template) {\r\n\tif (!(this instanceof UriTemplate)) {\r\n\t\treturn new UriTemplate(template);\r\n\t}\r\n\tvar parts = template.split("{");\r\n\tvar textParts = [parts.shift()];\r\n\tvar prefixes = [];\r\n\tvar substitutions = [];\r\n\tvar varNames = [];\r\n\twhile (parts.length > 0) {\r\n\t\tvar part = parts.shift();\r\n\t\tvar spec = part.split("}")[0];\r\n\t\tvar remainder = part.substring(spec.length + 1);\r\n\t\tvar funcs = uriTemplateSubstitution(spec);\r\n\t\tsubstitutions.push(funcs.substitution);\r\n\t\tprefixes.push(funcs.prefix);\r\n\t\ttextParts.push(remainder);\r\n\t\tvarNames = varNames.concat(funcs.substitution.varNames);\r\n\t}\r\n\tthis.fill = function (valueFunction) {\r\n\t\tvar result = textParts[0];\r\n\t\tfor (var i = 0; i < substitutions.length; i++) {\r\n\t\t\tvar substitution = substitutions[i];\r\n\t\t\tresult += substitution(valueFunction);\r\n\t\t\tresult += textParts[i + 1];\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\tthis.varNames = varNames;\r\n\tthis.template = template;\r\n}\r\nUriTemplate.prototype = {\r\n\ttoString: function () {\r\n\t\treturn this.template;\r\n\t},\r\n\tfillFromObject: function (obj) {\r\n\t\treturn this.fill(function (varName) {\r\n\t\t\treturn obj[varName];\r\n\t\t});\r\n\t}\r\n};\r\nvar ValidatorContext = function ValidatorContext(parent, collectMultiple, errorReporter, checkRecursive, trackUnknownProperties) {\r\n\tthis.missing = [];\r\n\tthis.missingMap = {};\r\n\tthis.formatValidators = parent ? Object.create(parent.formatValidators) : {};\r\n\tthis.schemas = parent ? Object.create(parent.schemas) : {};\r\n\tthis.collectMultiple = collectMultiple;\r\n\tthis.errors = [];\r\n\tthis.handleError = collectMultiple ? this.collectError : this.returnError;\r\n\tif (checkRecursive) {\r\n\t\tthis.checkRecursive = true;\r\n\t\tthis.scanned = [];\r\n\t\tthis.scannedFrozen = [];\r\n\t\tthis.scannedFrozenSchemas = [];\r\n\t\tthis.scannedFrozenValidationErrors = [];\r\n\t\tthis.validatedSchemasKey = \'tv4_validation_id\';\r\n\t\tthis.validationErrorsKey = \'tv4_validation_errors_id\';\r\n\t}\r\n\tif (trackUnknownProperties) {\r\n\t\tthis.trackUnknownProperties = true;\r\n\t\tthis.knownPropertyPaths = {};\r\n\t\tthis.unknownPropertyPaths = {};\r\n\t}\r\n\tthis.errorReporter = errorReporter || defaultErrorReporter(\'en\');\r\n\tif (typeof this.errorReporter === \'string\') {\r\n\t\tthrow new Error(\'debug\');\r\n\t}\r\n\tthis.definedKeywords = {};\r\n\tif (parent) {\r\n\t\tfor (var key in parent.definedKeywords) {\r\n\t\t\tthis.definedKeywords[key] = parent.definedKeywords[key].slice(0);\r\n\t\t}\r\n\t}\r\n};\r\nValidatorContext.prototype.defineKeyword = function (keyword, keywordFunction) {\r\n\tthis.definedKeywords[keyword] = this.definedKeywords[keyword] || [];\r\n\tthis.definedKeywords[keyword].push(keywordFunction);\r\n};\r\nValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors, data, schema) {\r\n\tvar error = new ValidationError(code, messageParams, dataPath, schemaPath, subErrors);\r\n\terror.message = this.errorReporter(error, data, schema);\r\n\treturn error;\r\n};\r\nValidatorContext.prototype.returnError = function (error) {\r\n\treturn error;\r\n};\r\nValidatorContext.prototype.collectError = function (error) {\r\n\tif (error) {\r\n\t\tthis.errors.push(error);\r\n\t}\r\n\treturn null;\r\n};\r\nValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) {\r\n\tfor (var i = startIndex; i < this.errors.length; i++) {\r\n\t\tthis.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath);\r\n\t}\r\n\treturn this;\r\n};\r\nValidatorContext.prototype.banUnknownProperties = function (data, schema) {\r\n\tfor (var unknownPath in this.unknownPropertyPaths) {\r\n\t\tvar error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, "", null, data, schema);\r\n\t\tvar result = this.handleError(error);\r\n\t\tif (result) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.addFormat = function (format, validator) {\r\n\tif (typeof format === \'object\') {\r\n\t\tfor (var key in format) {\r\n\t\t\tthis.addFormat(key, format[key]);\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\tthis.formatValidators[format] = validator;\r\n};\r\nValidatorContext.prototype.resolveRefs = function (schema, urlHistory) {\r\n\tif (schema[\'$ref\'] !== undefined) {\r\n\t\turlHistory = urlHistory || {};\r\n\t\tif (urlHistory[schema[\'$ref\']]) {\r\n\t\t\treturn this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(\', \')}, \'\', \'\', null, undefined, schema);\r\n\t\t}\r\n\t\turlHistory[schema[\'$ref\']] = true;\r\n\t\tschema = this.getSchema(schema[\'$ref\'], urlHistory);\r\n\t}\r\n\treturn schema;\r\n};\r\nValidatorContext.prototype.getSchema = function (url, urlHistory) {\r\n\tvar schema;\r\n\tif (this.schemas[url] !== undefined) {\r\n\t\tschema = this.schemas[url];\r\n\t\treturn this.resolveRefs(schema, urlHistory);\r\n\t}\r\n\tvar baseUrl = url;\r\n\tvar fragment = "";\r\n\tif (url.indexOf(\'#\') !== -1) {\r\n\t\tfragment = url.substring(url.indexOf("#") + 1);\r\n\t\tbaseUrl = url.substring(0, url.indexOf("#"));\r\n\t}\r\n\tif (typeof this.schemas[baseUrl] === \'object\') {\r\n\t\tschema = this.schemas[baseUrl];\r\n\t\tvar pointerPath = decodeURIComponent(fragment);\r\n\t\tif (pointerPath === "") {\r\n\t\t\treturn this.resolveRefs(schema, urlHistory);\r\n\t\t} else if (pointerPath.charAt(0) !== "/") {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tvar parts = pointerPath.split("/").slice(1);\r\n\t\tfor (var i = 0; i < parts.length; i++) {\r\n\t\t\tvar component = parts[i].replace(/~1/g, "/").replace(/~0/g, "~");\r\n\t\t\tif (schema[component] === undefined) {\r\n\t\t\t\tschema = undefined;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tschema = schema[component];\r\n\t\t}\r\n\t\tif (schema !== undefined) {\r\n\t\t\treturn this.resolveRefs(schema, urlHistory);\r\n\t\t}\r\n\t}\r\n\tif (this.missing[baseUrl] === undefined) {\r\n\t\tthis.missing.push(baseUrl);\r\n\t\tthis.missing[baseUrl] = baseUrl;\r\n\t\tthis.missingMap[baseUrl] = baseUrl;\r\n\t}\r\n};\r\nValidatorContext.prototype.searchSchemas = function (schema, url) {\r\n\tif (Array.isArray(schema)) {\r\n\t\tfor (var i = 0; i < schema.length; i++) {\r\n\t\t\tthis.searchSchemas(schema[i], url);\r\n\t\t}\r\n\t} else if (schema && typeof schema === "object") {\r\n\t\tif (typeof schema.id === "string") {\r\n\t\t\tif (isTrustedUrl(url, schema.id)) {\r\n\t\t\t\tif (this.schemas[schema.id] === undefined) {\r\n\t\t\t\t\tthis.schemas[schema.id] = schema;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (var key in schema) {\r\n\t\t\tif (key !== "enum") {\r\n\t\t\t\tif (typeof schema[key] === "object") {\r\n\t\t\t\t\tthis.searchSchemas(schema[key], url);\r\n\t\t\t\t} else if (key === "$ref") {\r\n\t\t\t\t\tvar uri = getDocumentUri(schema[key]);\r\n\t\t\t\t\tif (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) {\r\n\t\t\t\t\t\tthis.missingMap[uri] = uri;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nValidatorContext.prototype.addSchema = function (url, schema) {\r\n\t//overload\r\n\tif (typeof url !== \'string\' || typeof schema === \'undefined\') {\r\n\t\tif (typeof url === \'object\' && typeof url.id === \'string\') {\r\n\t\t\tschema = url;\r\n\t\t\turl = schema.id;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tif (url === getDocumentUri(url) + "#") {\r\n\t\t// Remove empty fragment\r\n\t\turl = getDocumentUri(url);\r\n\t}\r\n\tthis.schemas[url] = schema;\r\n\tdelete this.missingMap[url];\r\n\tnormSchema(schema, url);\r\n\tthis.searchSchemas(schema, url);\r\n};\r\n\r\nValidatorContext.prototype.getSchemaMap = function () {\r\n\tvar map = {};\r\n\tfor (var key in this.schemas) {\r\n\t\tmap[key] = this.schemas[key];\r\n\t}\r\n\treturn map;\r\n};\r\n\r\nValidatorContext.prototype.getSchemaUris = function (filterRegExp) {\r\n\tvar list = [];\r\n\tfor (var key in this.schemas) {\r\n\t\tif (!filterRegExp || filterRegExp.test(key)) {\r\n\t\t\tlist.push(key);\r\n\t\t}\r\n\t}\r\n\treturn list;\r\n};\r\n\r\nValidatorContext.prototype.getMissingUris = function (filterRegExp) {\r\n\tvar list = [];\r\n\tfor (var key in this.missingMap) {\r\n\t\tif (!filterRegExp || filterRegExp.test(key)) {\r\n\t\t\tlist.push(key);\r\n\t\t}\r\n\t}\r\n\treturn list;\r\n};\r\n\r\nValidatorContext.prototype.dropSchemas = function () {\r\n\tthis.schemas = {};\r\n\tthis.reset();\r\n};\r\nValidatorContext.prototype.reset = function () {\r\n\tthis.missing = [];\r\n\tthis.missingMap = {};\r\n\tthis.errors = [];\r\n};\r\n\r\nValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) {\r\n\tvar topLevel;\r\n\tschema = this.resolveRefs(schema);\r\n\tif (!schema) {\r\n\t\treturn null;\r\n\t} else if (schema instanceof ValidationError) {\r\n\t\tthis.errors.push(schema);\r\n\t\treturn schema;\r\n\t}\r\n\r\n\tvar startErrorCount = this.errors.length;\r\n\tvar frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null;\r\n\tif (this.checkRecursive && data && typeof data === \'object\') {\r\n\t\ttopLevel = !this.scanned.length;\r\n\t\tif (data[this.validatedSchemasKey]) {\r\n\t\t\tvar schemaIndex = data[this.validatedSchemasKey].indexOf(schema);\r\n\t\t\tif (schemaIndex !== -1) {\r\n\t\t\t\tthis.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Object.isFrozen(data)) {\r\n\t\t\tfrozenIndex = this.scannedFrozen.indexOf(data);\r\n\t\t\tif (frozenIndex !== -1) {\r\n\t\t\t\tvar frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema);\r\n\t\t\t\tif (frozenSchemaIndex !== -1) {\r\n\t\t\t\t\tthis.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]);\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.scanned.push(data);\r\n\t\tif (Object.isFrozen(data)) {\r\n\t\t\tif (frozenIndex === -1) {\r\n\t\t\t\tfrozenIndex = this.scannedFrozen.length;\r\n\t\t\t\tthis.scannedFrozen.push(data);\r\n\t\t\t\tthis.scannedFrozenSchemas.push([]);\r\n\t\t\t}\r\n\t\t\tscannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length;\r\n\t\t\tthis.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema;\r\n\t\t\tthis.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = [];\r\n\t\t} else {\r\n\t\t\tif (!data[this.validatedSchemasKey]) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tObject.defineProperty(data, this.validatedSchemasKey, {\r\n\t\t\t\t\t\tvalue: [],\r\n\t\t\t\t\t\tconfigurable: true\r\n\t\t\t\t\t});\r\n\t\t\t\t\tObject.defineProperty(data, this.validationErrorsKey, {\r\n\t\t\t\t\t\tvalue: [],\r\n\t\t\t\t\t\tconfigurable: true\r\n\t\t\t\t\t});\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//IE 7/8 workaround\r\n\t\t\t\t\tdata[this.validatedSchemasKey] = [];\r\n\t\t\t\t\tdata[this.validationErrorsKey] = [];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tscannedSchemasIndex = data[this.validatedSchemasKey].length;\r\n\t\t\tdata[this.validatedSchemasKey][scannedSchemasIndex] = schema;\r\n\t\t\tdata[this.validationErrorsKey][scannedSchemasIndex] = [];\r\n\t\t}\r\n\t}\r\n\r\n\tvar errorCount = this.errors.length;\r\n\tvar error = this.validateBasic(data, schema, dataPointerPath)\r\n\t\t|| this.validateNumeric(data, schema, dataPointerPath)\r\n\t\t|| this.validateString(data, schema, dataPointerPath)\r\n\t\t|| this.validateArray(data, schema, dataPointerPath)\r\n\t\t|| this.validateObject(data, schema, dataPointerPath)\r\n\t\t|| this.validateCombinations(data, schema, dataPointerPath)\r\n\t\t|| this.validateHypermedia(data, schema, dataPointerPath)\r\n\t\t|| this.validateFormat(data, schema, dataPointerPath)\r\n\t\t|| this.validateDefinedKeywords(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n\r\n\tif (topLevel) {\r\n\t\twhile (this.scanned.length) {\r\n\t\t\tvar item = this.scanned.pop();\r\n\t\t\tdelete item[this.validatedSchemasKey];\r\n\t\t}\r\n\t\tthis.scannedFrozen = [];\r\n\t\tthis.scannedFrozenSchemas = [];\r\n\t}\r\n\r\n\tif (error || errorCount !== this.errors.length) {\r\n\t\twhile ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) {\r\n\t\t\tvar dataPart = (dataPathParts && dataPathParts.length) ? "" + dataPathParts.pop() : null;\r\n\t\t\tvar schemaPart = (schemaPathParts && schemaPathParts.length) ? "" + schemaPathParts.pop() : null;\r\n\t\t\tif (error) {\r\n\t\t\t\terror = error.prefixWith(dataPart, schemaPart);\r\n\t\t\t}\r\n\t\t\tthis.prefixErrors(errorCount, dataPart, schemaPart);\r\n\t\t}\r\n\t}\r\n\r\n\tif (scannedFrozenSchemaIndex !== null) {\r\n\t\tthis.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount);\r\n\t} else if (scannedSchemasIndex !== null) {\r\n\t\tdata[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount);\r\n\t}\r\n\r\n\treturn this.handleError(error);\r\n};\r\nValidatorContext.prototype.validateFormat = function (data, schema) {\r\n\tif (typeof schema.format !== \'string\' || !this.formatValidators[schema.format]) {\r\n\t\treturn null;\r\n\t}\r\n\tvar errorMessage = this.formatValidators[schema.format].call(null, data, schema);\r\n\tif (typeof errorMessage === \'string\' || typeof errorMessage === \'number\') {\r\n\t\treturn this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}, \'\', \'/format\', null, data, schema);\r\n\t} else if (errorMessage && typeof errorMessage === \'object\') {\r\n\t\treturn this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || "?"}, errorMessage.dataPath || \'\', errorMessage.schemaPath || "/format", null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\nValidatorContext.prototype.validateDefinedKeywords = function (data, schema, dataPointerPath) {\r\n\tfor (var key in this.definedKeywords) {\r\n\t\tif (typeof schema[key] === \'undefined\') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar validationFunctions = this.definedKeywords[key];\r\n\t\tfor (var i = 0; i < validationFunctions.length; i++) {\r\n\t\t\tvar func = validationFunctions[i];\r\n\t\t\tvar result = func(data, schema[key], schema, dataPointerPath);\r\n\t\t\tif (typeof result === \'string\' || typeof result === \'number\') {\r\n\t\t\t\treturn this.createError(ErrorCodes.KEYWORD_CUSTOM, {key: key, message: result}, \'\', \'\', null, data, schema).prefixWith(null, key);\r\n\t\t\t} else if (result && typeof result === \'object\') {\r\n\t\t\t\tvar code = result.code;\r\n\t\t\t\tif (typeof code === \'string\') {\r\n\t\t\t\t\tif (!ErrorCodes[code]) {\r\n\t\t\t\t\t\tthrow new Error(\'Undefined error code (use defineError): \' + code);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcode = ErrorCodes[code];\r\n\t\t\t\t} else if (typeof code !== \'number\') {\r\n\t\t\t\t\tcode = ErrorCodes.KEYWORD_CUSTOM;\r\n\t\t\t\t}\r\n\t\t\t\tvar messageParams = (typeof result.message === \'object\') ? result.message : {key: key, message: result.message || "?"};\r\n\t\t\t\tvar schemaPath = result.schemaPath || ("/" + key.replace(/~/g, \'~0\').replace(/\\//g, \'~1\'));\r\n\t\t\t\treturn this.createError(code, messageParams, result.dataPath || null, schemaPath, null, data, schema);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nfunction recursiveCompare(A, B) {\r\n\tif (A === B) {\r\n\t\treturn true;\r\n\t}\r\n\tif (A && B && typeof A === "object" && typeof B === "object") {\r\n\t\tif (Array.isArray(A) !== Array.isArray(B)) {\r\n\t\t\treturn false;\r\n\t\t} else if (Array.isArray(A)) {\r\n\t\t\tif (A.length !== B.length) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0; i < A.length; i++) {\r\n\t\t\t\tif (!recursiveCompare(A[i], B[i])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar key;\r\n\t\t\tfor (key in A) {\r\n\t\t\t\tif (B[key] === undefined && A[key] !== undefined) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (key in B) {\r\n\t\t\t\tif (A[key] === undefined && B[key] !== undefined) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (key in A) {\r\n\t\t\t\tif (!recursiveCompare(A[key], B[key])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) {\r\n\tvar error;\r\n\tif (error = this.validateType(data, schema, dataPointerPath)) {\r\n\t\treturn error.prefixWith(null, "type");\r\n\t}\r\n\tif (error = this.validateEnum(data, schema, dataPointerPath)) {\r\n\t\treturn error.prefixWith(null, "type");\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateType = function validateType(data, schema) {\r\n\tif (schema.type === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar dataType = typeof data;\r\n\tif (data === null) {\r\n\t\tdataType = "null";\r\n\t} else if (Array.isArray(data)) {\r\n\t\tdataType = "array";\r\n\t}\r\n\tvar allowedTypes = schema.type;\r\n\tif (!Array.isArray(allowedTypes)) {\r\n\t\tallowedTypes = [allowedTypes];\r\n\t}\r\n\r\n\tfor (var i = 0; i < allowedTypes.length; i++) {\r\n\t\tvar type = allowedTypes[i];\r\n\t\tif (type === dataType || (type === "integer" && dataType === "number" && (data % 1 === 0))) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\treturn this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join("/")}, \'\', \'\', null, data, schema);\r\n};\r\n\r\nValidatorContext.prototype.validateEnum = function validateEnum(data, schema) {\r\n\tif (schema["enum"] === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tfor (var i = 0; i < schema["enum"].length; i++) {\r\n\t\tvar enumVal = schema["enum"][i];\r\n\t\tif (recursiveCompare(data, enumVal)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\treturn this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== \'undefined\') ? JSON.stringify(data) : data}, \'\', \'\', null, data, schema);\r\n};\r\n\r\nValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) {\r\n\treturn this.validateMultipleOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateMinMax(data, schema, dataPointerPath)\r\n\t\t|| this.validateNaN(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nvar CLOSE_ENOUGH_LOW = Math.pow(2, -51);\r\nvar CLOSE_ENOUGH_HIGH = 1 - CLOSE_ENOUGH_LOW;\r\nValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) {\r\n\tvar multipleOf = schema.multipleOf || schema.divisibleBy;\r\n\tif (multipleOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tif (typeof data === "number") {\r\n\t\tvar remainder = (data/multipleOf)%1;\r\n\t\tif (remainder >= CLOSE_ENOUGH_LOW && remainder < CLOSE_ENOUGH_HIGH) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf}, \'\', \'\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) {\r\n\tif (typeof data !== "number") {\r\n\t\treturn null;\r\n\t}\r\n\tif (schema.minimum !== undefined) {\r\n\t\tif (data < schema.minimum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}, \'\', \'/minimum\', null, data, schema);\r\n\t\t}\r\n\t\tif (schema.exclusiveMinimum && data === schema.minimum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}, \'\', \'/exclusiveMinimum\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\tif (schema.maximum !== undefined) {\r\n\t\tif (data > schema.maximum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}, \'\', \'/maximum\', null, data, schema);\r\n\t\t}\r\n\t\tif (schema.exclusiveMaximum && data === schema.maximum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}, \'\', \'/exclusiveMaximum\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateNaN = function validateNaN(data, schema) {\r\n\tif (typeof data !== "number") {\r\n\t\treturn null;\r\n\t}\r\n\tif (isNaN(data) === true || data === Infinity || data === -Infinity) {\r\n\t\treturn this.createError(ErrorCodes.NUMBER_NOT_A_NUMBER, {value: data}, \'\', \'/type\', null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) {\r\n\treturn this.validateStringLength(data, schema, dataPointerPath)\r\n\t\t|| this.validateStringPattern(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) {\r\n\tif (typeof data !== "string") {\r\n\t\treturn null;\r\n\t}\r\n\tif (schema.minLength !== undefined) {\r\n\t\tif (data.length < schema.minLength) {\r\n\t\t\treturn this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}, \'\', \'/minLength\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\tif (schema.maxLength !== undefined) {\r\n\t\tif (data.length > schema.maxLength) {\r\n\t\t\treturn this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}, \'\', \'/maxLength\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) {\r\n\tif (typeof data !== "string" || (typeof schema.pattern !== "string" && !(schema.pattern instanceof RegExp))) {\r\n\t\treturn null;\r\n\t}\r\n\tvar regexp;\r\n\tif (schema.pattern instanceof RegExp) {\r\n\t regexp = schema.pattern;\r\n\t}\r\n\telse {\r\n\t var body, flags = \'\';\r\n\t // Check for regular expression literals\r\n\t // @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5\r\n\t var literal = schema.pattern.match(/^\\/(.+)\\/([img]*)$/);\r\n\t if (literal) {\r\n\t body = literal[1];\r\n\t flags = literal[2];\r\n\t }\r\n\t else {\r\n\t body = schema.pattern;\r\n\t }\r\n\t regexp = new RegExp(body, flags);\r\n\t}\r\n\tif (!regexp.test(data)) {\r\n\t\treturn this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}, \'\', \'/pattern\', null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) {\r\n\tif (!Array.isArray(data)) {\r\n\t\treturn null;\r\n\t}\r\n\treturn this.validateArrayLength(data, schema, dataPointerPath)\r\n\t\t|| this.validateArrayUniqueItems(data, schema, dataPointerPath)\r\n\t\t|| this.validateArrayItems(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) {\r\n\tvar error;\r\n\tif (schema.minItems !== undefined) {\r\n\t\tif (data.length < schema.minItems) {\r\n\t\t\terror = this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems}, \'\', \'/minItems\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (schema.maxItems !== undefined) {\r\n\t\tif (data.length > schema.maxItems) {\r\n\t\t\terror = this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems}, \'\', \'/maxItems\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) {\r\n\tif (schema.uniqueItems) {\r\n\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\tfor (var j = i + 1; j < data.length; j++) {\r\n\t\t\t\tif (recursiveCompare(data[i], data[j])) {\r\n\t\t\t\t\tvar error = this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j}, \'\', \'/uniqueItems\', null, data, schema);\r\n\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) {\r\n\tif (schema.items === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar error, i;\r\n\tif (Array.isArray(schema.items)) {\r\n\t\tfor (i = 0; i < data.length; i++) {\r\n\t\t\tif (i < schema.items.length) {\r\n\t\t\t\tif (error = this.validateAll(data[i], schema.items[i], [i], ["items", i], dataPointerPath + "/" + i)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t} else if (schema.additionalItems !== undefined) {\r\n\t\t\t\tif (typeof schema.additionalItems === "boolean") {\r\n\t\t\t\t\tif (!schema.additionalItems) {\r\n\t\t\t\t\t\terror = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {}, \'/\' + i, \'/additionalItems\', null, data, schema));\r\n\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (error = this.validateAll(data[i], schema.additionalItems, [i], ["additionalItems"], dataPointerPath + "/" + i)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tfor (i = 0; i < data.length; i++) {\r\n\t\t\tif (error = this.validateAll(data[i], schema.items, [i], ["items"], dataPointerPath + "/" + i)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) {\r\n\tif (typeof data !== "object" || data === null || Array.isArray(data)) {\r\n\t\treturn null;\r\n\t}\r\n\treturn this.validateObjectMinMaxProperties(data, schema, dataPointerPath)\r\n\t\t|| this.validateObjectRequiredProperties(data, schema, dataPointerPath)\r\n\t\t|| this.validateObjectProperties(data, schema, dataPointerPath)\r\n\t\t|| this.validateObjectDependencies(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) {\r\n\tvar keys = Object.keys(data);\r\n\tvar error;\r\n\tif (schema.minProperties !== undefined) {\r\n\t\tif (keys.length < schema.minProperties) {\r\n\t\t\terror = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}, \'\', \'/minProperties\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (schema.maxProperties !== undefined) {\r\n\t\tif (keys.length > schema.maxProperties) {\r\n\t\t\terror = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}, \'\', \'/maxProperties\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) {\r\n\tif (schema.required !== undefined) {\r\n\t\tfor (var i = 0; i < schema.required.length; i++) {\r\n\t\t\tvar key = schema.required[i];\r\n\t\t\tif (data[key] === undefined) {\r\n\t\t\t\tvar error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}, \'\', \'/required/\' + i, null, data, schema);\r\n\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) {\r\n\tvar error;\r\n\tfor (var key in data) {\r\n\t\tvar keyPointerPath = dataPointerPath + "/" + key.replace(/~/g, \'~0\').replace(/\\//g, \'~1\');\r\n\t\tvar foundMatch = false;\r\n\t\tif (schema.properties !== undefined && schema.properties[key] !== undefined) {\r\n\t\t\tfoundMatch = true;\r\n\t\t\tif (error = this.validateAll(data[key], schema.properties[key], [key], ["properties", key], keyPointerPath)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (schema.patternProperties !== undefined) {\r\n\t\t\tfor (var patternKey in schema.patternProperties) {\r\n\t\t\t\tvar regexp = new RegExp(patternKey);\r\n\t\t\t\tif (regexp.test(key)) {\r\n\t\t\t\t\tfoundMatch = true;\r\n\t\t\t\t\tif (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], ["patternProperties", patternKey], keyPointerPath)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!foundMatch) {\r\n\t\t\tif (schema.additionalProperties !== undefined) {\r\n\t\t\t\tif (this.trackUnknownProperties) {\r\n\t\t\t\t\tthis.knownPropertyPaths[keyPointerPath] = true;\r\n\t\t\t\t\tdelete this.unknownPropertyPaths[keyPointerPath];\r\n\t\t\t\t}\r\n\t\t\t\tif (typeof schema.additionalProperties === "boolean") {\r\n\t\t\t\t\tif (!schema.additionalProperties) {\r\n\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {key: key}, \'\', \'/additionalProperties\', null, data, schema).prefixWith(key, null);\r\n\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (error = this.validateAll(data[key], schema.additionalProperties, [key], ["additionalProperties"], keyPointerPath)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) {\r\n\t\t\t\tthis.unknownPropertyPaths[keyPointerPath] = true;\r\n\t\t\t}\r\n\t\t} else if (this.trackUnknownProperties) {\r\n\t\t\tthis.knownPropertyPaths[keyPointerPath] = true;\r\n\t\t\tdelete this.unknownPropertyPaths[keyPointerPath];\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) {\r\n\tvar error;\r\n\tif (schema.dependencies !== undefined) {\r\n\t\tfor (var depKey in schema.dependencies) {\r\n\t\t\tif (data[depKey] !== undefined) {\r\n\t\t\t\tvar dep = schema.dependencies[depKey];\r\n\t\t\t\tif (typeof dep === "string") {\r\n\t\t\t\t\tif (data[dep] === undefined) {\r\n\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}, \'\', \'\', null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies");\r\n\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (Array.isArray(dep)) {\r\n\t\t\t\t\tfor (var i = 0; i < dep.length; i++) {\r\n\t\t\t\t\t\tvar requiredKey = dep[i];\r\n\t\t\t\t\t\tif (data[requiredKey] === undefined) {\r\n\t\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}, \'\', \'/\' + i, null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies");\r\n\t\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (error = this.validateAll(data, dep, [], ["dependencies", depKey], dataPointerPath)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) {\r\n\treturn this.validateAllOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateAnyOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateOneOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateNot(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) {\r\n\tif (schema.allOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar error;\r\n\tfor (var i = 0; i < schema.allOf.length; i++) {\r\n\t\tvar subSchema = schema.allOf[i];\r\n\t\tif (error = this.validateAll(data, subSchema, [], ["allOf", i], dataPointerPath)) {\r\n\t\t\treturn error;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) {\r\n\tif (schema.anyOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar errors = [];\r\n\tvar startErrorCount = this.errors.length;\r\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\r\n\tif (this.trackUnknownProperties) {\r\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\r\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\r\n\t}\r\n\tvar errorAtEnd = true;\r\n\tfor (var i = 0; i < schema.anyOf.length; i++) {\r\n\t\tif (this.trackUnknownProperties) {\r\n\t\t\tthis.unknownPropertyPaths = {};\r\n\t\t\tthis.knownPropertyPaths = {};\r\n\t\t}\r\n\t\tvar subSchema = schema.anyOf[i];\r\n\r\n\t\tvar errorCount = this.errors.length;\r\n\t\tvar error = this.validateAll(data, subSchema, [], ["anyOf", i], dataPointerPath);\r\n\r\n\t\tif (error === null && errorCount === this.errors.length) {\r\n\t\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\r\n\t\t\tif (this.trackUnknownProperties) {\r\n\t\t\t\tfor (var knownKey in this.knownPropertyPaths) {\r\n\t\t\t\t\toldKnownPropertyPaths[knownKey] = true;\r\n\t\t\t\t\tdelete oldUnknownPropertyPaths[knownKey];\r\n\t\t\t\t}\r\n\t\t\t\tfor (var unknownKey in this.unknownPropertyPaths) {\r\n\t\t\t\t\tif (!oldKnownPropertyPaths[unknownKey]) {\r\n\t\t\t\t\t\toldUnknownPropertyPaths[unknownKey] = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// We need to continue looping so we catch all the property definitions, but we don\'t want to return an error\r\n\t\t\t\terrorAtEnd = false;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif (error) {\r\n\t\t\terrors.push(error.prefixWith(null, "" + i).prefixWith(null, "anyOf"));\r\n\t\t}\r\n\t}\r\n\tif (this.trackUnknownProperties) {\r\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\r\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\r\n\t}\r\n\tif (errorAtEnd) {\r\n\t\terrors = errors.concat(this.errors.slice(startErrorCount));\r\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t\treturn this.createError(ErrorCodes.ANY_OF_MISSING, {}, "", "/anyOf", errors, data, schema);\r\n\t}\r\n};\r\n\r\nValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) {\r\n\tif (schema.oneOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar validIndex = null;\r\n\tvar errors = [];\r\n\tvar startErrorCount = this.errors.length;\r\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\r\n\tif (this.trackUnknownProperties) {\r\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\r\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\r\n\t}\r\n\tfor (var i = 0; i < schema.oneOf.length; i++) {\r\n\t\tif (this.trackUnknownProperties) {\r\n\t\t\tthis.unknownPropertyPaths = {};\r\n\t\t\tthis.knownPropertyPaths = {};\r\n\t\t}\r\n\t\tvar subSchema = schema.oneOf[i];\r\n\r\n\t\tvar errorCount = this.errors.length;\r\n\t\tvar error = this.validateAll(data, subSchema, [], ["oneOf", i], dataPointerPath);\r\n\r\n\t\tif (error === null && errorCount === this.errors.length) {\r\n\t\t\tif (validIndex === null) {\r\n\t\t\t\tvalidIndex = i;\r\n\t\t\t} else {\r\n\t\t\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t\t\t\treturn this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, "", "/oneOf", null, data, schema);\r\n\t\t\t}\r\n\t\t\tif (this.trackUnknownProperties) {\r\n\t\t\t\tfor (var knownKey in this.knownPropertyPaths) {\r\n\t\t\t\t\toldKnownPropertyPaths[knownKey] = true;\r\n\t\t\t\t\tdelete oldUnknownPropertyPaths[knownKey];\r\n\t\t\t\t}\r\n\t\t\t\tfor (var unknownKey in this.unknownPropertyPaths) {\r\n\t\t\t\t\tif (!oldKnownPropertyPaths[unknownKey]) {\r\n\t\t\t\t\t\toldUnknownPropertyPaths[unknownKey] = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (error) {\r\n\t\t\terrors.push(error);\r\n\t\t}\r\n\t}\r\n\tif (this.trackUnknownProperties) {\r\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\r\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\r\n\t}\r\n\tif (validIndex === null) {\r\n\t\terrors = errors.concat(this.errors.slice(startErrorCount));\r\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t\treturn this.createError(ErrorCodes.ONE_OF_MISSING, {}, "", "/oneOf", errors, data, schema);\r\n\t} else {\r\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) {\r\n\tif (schema.not === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar oldErrorCount = this.errors.length;\r\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\r\n\tif (this.trackUnknownProperties) {\r\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\r\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\r\n\t\tthis.unknownPropertyPaths = {};\r\n\t\tthis.knownPropertyPaths = {};\r\n\t}\r\n\tvar error = this.validateAll(data, schema.not, null, null, dataPointerPath);\r\n\tvar notErrors = this.errors.slice(oldErrorCount);\r\n\tthis.errors = this.errors.slice(0, oldErrorCount);\r\n\tif (this.trackUnknownProperties) {\r\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\r\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\r\n\t}\r\n\tif (error === null && notErrors.length === 0) {\r\n\t\treturn this.createError(ErrorCodes.NOT_PASSED, {}, "", "/not", null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateHypermedia = function validateCombinations(data, schema, dataPointerPath) {\r\n\tif (!schema.links) {\r\n\t\treturn null;\r\n\t}\r\n\tvar error;\r\n\tfor (var i = 0; i < schema.links.length; i++) {\r\n\t\tvar ldo = schema.links[i];\r\n\t\tif (ldo.rel === "describedby") {\r\n\t\t\tvar template = new UriTemplate(ldo.href);\r\n\t\t\tvar allPresent = true;\r\n\t\t\tfor (var j = 0; j < template.varNames.length; j++) {\r\n\t\t\t\tif (!(template.varNames[j] in data)) {\r\n\t\t\t\t\tallPresent = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (allPresent) {\r\n\t\t\t\tvar schemaUrl = template.fillFromObject(data);\r\n\t\t\t\tvar subSchema = {"$ref": schemaUrl};\r\n\t\t\t\tif (error = this.validateAll(data, subSchema, [], ["links", i], dataPointerPath)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\n// parseURI() and resolveUrl() are from https://gist.github.com/1088850\r\n// - released as public domain by author ("Yaffle") - see comments on gist\r\n\r\nfunction parseURI(url) {\r\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, \'\').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\r\n\t// authority = \'//\' + user + \':\' + pass \'@\' + hostname + \':\' port\r\n\treturn (m ? {\r\n\t\thref : m[0] || \'\',\r\n\t\tprotocol : m[1] || \'\',\r\n\t\tauthority: m[2] || \'\',\r\n\t\thost : m[3] || \'\',\r\n\t\thostname : m[4] || \'\',\r\n\t\tport : m[5] || \'\',\r\n\t\tpathname : m[6] || \'\',\r\n\t\tsearch : m[7] || \'\',\r\n\t\thash : m[8] || \'\'\r\n\t} : null);\r\n}\r\n\r\nfunction resolveUrl(base, href) {// RFC 3986\r\n\r\n\tfunction removeDotSegments(input) {\r\n\t\tvar output = [];\r\n\t\tinput.replace(/^(\\.\\.?(\\/|$))+/, \'\')\r\n\t\t\t.replace(/\\/(\\.(\\/|$))+/g, \'/\')\r\n\t\t\t.replace(/\\/\\.\\.$/, \'/../\')\r\n\t\t\t.replace(/\\/?[^\\/]*/g, function (p) {\r\n\t\t\t\tif (p === \'/..\') {\r\n\t\t\t\t\toutput.pop();\r\n\t\t\t\t} else {\r\n\t\t\t\t\toutput.push(p);\r\n\t\t\t\t}\r\n\t\t});\r\n\t\treturn output.join(\'\').replace(/^\\//, input.charAt(0) === \'/\' ? \'/\' : \'\');\r\n\t}\r\n\r\n\thref = parseURI(href || \'\');\r\n\tbase = parseURI(base || \'\');\r\n\r\n\treturn !href || !base ? null : (href.protocol || base.protocol) +\r\n\t\t(href.protocol || href.authority ? href.authority : base.authority) +\r\n\t\tremoveDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === \'/\' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? \'/\' : \'\') + base.pathname.slice(0, base.pathname.lastIndexOf(\'/\') + 1) + href.pathname) : base.pathname)) +\r\n\t\t(href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) +\r\n\t\thref.hash;\r\n}\r\n\r\nfunction getDocumentUri(uri) {\r\n\treturn uri.split(\'#\')[0];\r\n}\r\nfunction normSchema(schema, baseUri) {\r\n\tif (schema && typeof schema === "object") {\r\n\t\tif (baseUri === undefined) {\r\n\t\t\tbaseUri = schema.id;\r\n\t\t} else if (typeof schema.id === "string") {\r\n\t\t\tbaseUri = resolveUrl(baseUri, schema.id);\r\n\t\t\tschema.id = baseUri;\r\n\t\t}\r\n\t\tif (Array.isArray(schema)) {\r\n\t\t\tfor (var i = 0; i < schema.length; i++) {\r\n\t\t\t\tnormSchema(schema[i], baseUri);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (typeof schema[\'$ref\'] === "string") {\r\n\t\t\t\tschema[\'$ref\'] = resolveUrl(baseUri, schema[\'$ref\']);\r\n\t\t\t}\r\n\t\t\tfor (var key in schema) {\r\n\t\t\t\tif (key !== "enum") {\r\n\t\t\t\t\tnormSchema(schema[key], baseUri);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction defaultErrorReporter(language) {\r\n\tlanguage = language || \'en\';\r\n\r\n\tvar errorMessages = languages[language];\r\n\r\n\treturn function (error) {\r\n\t\tvar messageTemplate = errorMessages[error.code] || ErrorMessagesDefault[error.code];\r\n\t\tif (typeof messageTemplate !== \'string\') {\r\n\t\t\treturn "Unknown error code " + error.code + ": " + JSON.stringify(error.messageParams);\r\n\t\t}\r\n\t\tvar messageParams = error.params;\r\n\t\t// Adapted from Crockford\'s supplant()\r\n\t\treturn messageTemplate.replace(/\\{([^{}]*)\\}/g, function (whole, varName) {\r\n\t\t\tvar subValue = messageParams[varName];\r\n\t\t\treturn typeof subValue === \'string\' || typeof subValue === \'number\' ? subValue : whole;\r\n\t\t});\r\n\t};\r\n}\r\n\r\nvar ErrorCodes = {\r\n\tINVALID_TYPE: 0,\r\n\tENUM_MISMATCH: 1,\r\n\tANY_OF_MISSING: 10,\r\n\tONE_OF_MISSING: 11,\r\n\tONE_OF_MULTIPLE: 12,\r\n\tNOT_PASSED: 13,\r\n\t// Numeric errors\r\n\tNUMBER_MULTIPLE_OF: 100,\r\n\tNUMBER_MINIMUM: 101,\r\n\tNUMBER_MINIMUM_EXCLUSIVE: 102,\r\n\tNUMBER_MAXIMUM: 103,\r\n\tNUMBER_MAXIMUM_EXCLUSIVE: 104,\r\n\tNUMBER_NOT_A_NUMBER: 105,\r\n\t// String errors\r\n\tSTRING_LENGTH_SHORT: 200,\r\n\tSTRING_LENGTH_LONG: 201,\r\n\tSTRING_PATTERN: 202,\r\n\t// Object errors\r\n\tOBJECT_PROPERTIES_MINIMUM: 300,\r\n\tOBJECT_PROPERTIES_MAXIMUM: 301,\r\n\tOBJECT_REQUIRED: 302,\r\n\tOBJECT_ADDITIONAL_PROPERTIES: 303,\r\n\tOBJECT_DEPENDENCY_KEY: 304,\r\n\t// Array errors\r\n\tARRAY_LENGTH_SHORT: 400,\r\n\tARRAY_LENGTH_LONG: 401,\r\n\tARRAY_UNIQUE: 402,\r\n\tARRAY_ADDITIONAL_ITEMS: 403,\r\n\t// Custom/user-defined errors\r\n\tFORMAT_CUSTOM: 500,\r\n\tKEYWORD_CUSTOM: 501,\r\n\t// Schema structure\r\n\tCIRCULAR_REFERENCE: 600,\r\n\t// Non-standard validation options\r\n\tUNKNOWN_PROPERTY: 1000\r\n};\r\nvar ErrorCodeLookup = {};\r\nfor (var key in ErrorCodes) {\r\n\tErrorCodeLookup[ErrorCodes[key]] = key;\r\n}\r\nvar ErrorMessagesDefault = {\r\n\tINVALID_TYPE: "Invalid type: {type} (expected {expected})",\r\n\tENUM_MISMATCH: "No enum match for: {value}",\r\n\tANY_OF_MISSING: "Data does not match any schemas from \\"anyOf\\"",\r\n\tONE_OF_MISSING: "Data does not match any schemas from \\"oneOf\\"",\r\n\tONE_OF_MULTIPLE: "Data is valid against more than one schema from \\"oneOf\\": indices {index1} and {index2}",\r\n\tNOT_PASSED: "Data matches schema from \\"not\\"",\r\n\t// Numeric errors\r\n\tNUMBER_MULTIPLE_OF: "Value {value} is not a multiple of {multipleOf}",\r\n\tNUMBER_MINIMUM: "Value {value} is less than minimum {minimum}",\r\n\tNUMBER_MINIMUM_EXCLUSIVE: "Value {value} is equal to exclusive minimum {minimum}",\r\n\tNUMBER_MAXIMUM: "Value {value} is greater than maximum {maximum}",\r\n\tNUMBER_MAXIMUM_EXCLUSIVE: "Value {value} is equal to exclusive maximum {maximum}",\r\n\tNUMBER_NOT_A_NUMBER: "Value {value} is not a valid number",\r\n\t// String errors\r\n\tSTRING_LENGTH_SHORT: "String is too short ({length} chars), minimum {minimum}",\r\n\tSTRING_LENGTH_LONG: "String is too long ({length} chars), maximum {maximum}",\r\n\tSTRING_PATTERN: "String does not match pattern: {pattern}",\r\n\t// Object errors\r\n\tOBJECT_PROPERTIES_MINIMUM: "Too few properties defined ({propertyCount}), minimum {minimum}",\r\n\tOBJECT_PROPERTIES_MAXIMUM: "Too many properties defined ({propertyCount}), maximum {maximum}",\r\n\tOBJECT_REQUIRED: "Missing required property: {key}",\r\n\tOBJECT_ADDITIONAL_PROPERTIES: "Additional properties not allowed",\r\n\tOBJECT_DEPENDENCY_KEY: "Dependency failed - key must exist: {missing} (due to key: {key})",\r\n\t// Array errors\r\n\tARRAY_LENGTH_SHORT: "Array is too short ({length}), minimum {minimum}",\r\n\tARRAY_LENGTH_LONG: "Array is too long ({length}), maximum {maximum}",\r\n\tARRAY_UNIQUE: "Array items are not unique (indices {match1} and {match2})",\r\n\tARRAY_ADDITIONAL_ITEMS: "Additional items not allowed",\r\n\t// Format errors\r\n\tFORMAT_CUSTOM: "Format validation failed ({message})",\r\n\tKEYWORD_CUSTOM: "Keyword failed: {key} ({message})",\r\n\t// Schema structure\r\n\tCIRCULAR_REFERENCE: "Circular $refs: {urls}",\r\n\t// Non-standard validation options\r\n\tUNKNOWN_PROPERTY: "Unknown property (not in schema)"\r\n};\r\n\r\nfunction ValidationError(code, params, dataPath, schemaPath, subErrors) {\r\n\tError.call(this);\r\n\tif (code === undefined) {\r\n\t\tthrow new Error ("No error code supplied: " + schemaPath);\r\n\t}\r\n\tthis.message = \'\';\r\n\tthis.params = params;\r\n\tthis.code = code;\r\n\tthis.dataPath = dataPath || "";\r\n\tthis.schemaPath = schemaPath || "";\r\n\tthis.subErrors = subErrors || null;\r\n\r\n\tvar err = new Error(this.message);\r\n\tthis.stack = err.stack || err.stacktrace;\r\n\tif (!this.stack) {\r\n\t\ttry {\r\n\t\t\tthrow err;\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\tthis.stack = err.stack || err.stacktrace;\r\n\t\t}\r\n\t}\r\n}\r\nValidationError.prototype = Object.create(Error.prototype);\r\nValidationError.prototype.constructor = ValidationError;\r\nValidationError.prototype.name = \'ValidationError\';\r\n\r\nValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) {\r\n\tif (dataPrefix !== null) {\r\n\t\tdataPrefix = dataPrefix.replace(/~/g, "~0").replace(/\\//g, "~1");\r\n\t\tthis.dataPath = "/" + dataPrefix + this.dataPath;\r\n\t}\r\n\tif (schemaPrefix !== null) {\r\n\t\tschemaPrefix = schemaPrefix.replace(/~/g, "~0").replace(/\\//g, "~1");\r\n\t\tthis.schemaPath = "/" + schemaPrefix + this.schemaPath;\r\n\t}\r\n\tif (this.subErrors !== null) {\r\n\t\tfor (var i = 0; i < this.subErrors.length; i++) {\r\n\t\t\tthis.subErrors[i].prefixWith(dataPrefix, schemaPrefix);\r\n\t\t}\r\n\t}\r\n\treturn this;\r\n};\r\n\r\nfunction isTrustedUrl(baseUrl, testUrl) {\r\n\tif(testUrl.substring(0, baseUrl.length) === baseUrl){\r\n\t\tvar remainder = testUrl.substring(baseUrl.length);\r\n\t\tif ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === "/")\r\n\t\t\t|| remainder.charAt(0) === "#"\r\n\t\t\t|| remainder.charAt(0) === "?") {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nvar languages = {};\r\nfunction createApi(language) {\r\n\tvar globalContext = new ValidatorContext();\r\n\tvar currentLanguage;\r\n\tvar customErrorReporter;\r\n\tvar api = {\r\n\t\tsetErrorReporter: function (reporter) {\r\n\t\t\tif (typeof reporter === \'string\') {\r\n\t\t\t\treturn this.language(reporter);\r\n\t\t\t}\r\n\t\t\tcustomErrorReporter = reporter;\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\taddFormat: function () {\r\n\t\t\tglobalContext.addFormat.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tlanguage: function (code) {\r\n\t\t\tif (!code) {\r\n\t\t\t\treturn currentLanguage;\r\n\t\t\t}\r\n\t\t\tif (!languages[code]) {\r\n\t\t\t\tcode = code.split(\'-\')[0]; // fall back to base language\r\n\t\t\t}\r\n\t\t\tif (languages[code]) {\r\n\t\t\t\tcurrentLanguage = code;\r\n\t\t\t\treturn code; // so you can tell if fall-back has happened\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\taddLanguage: function (code, messageMap) {\r\n\t\t\tvar key;\r\n\t\t\tfor (key in ErrorCodes) {\r\n\t\t\t\tif (messageMap[key] && !messageMap[ErrorCodes[key]]) {\r\n\t\t\t\t\tmessageMap[ErrorCodes[key]] = messageMap[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar rootCode = code.split(\'-\')[0];\r\n\t\t\tif (!languages[rootCode]) { // use for base language if not yet defined\r\n\t\t\t\tlanguages[code] = messageMap;\r\n\t\t\t\tlanguages[rootCode] = messageMap;\r\n\t\t\t} else {\r\n\t\t\t\tlanguages[code] = Object.create(languages[rootCode]);\r\n\t\t\t\tfor (key in messageMap) {\r\n\t\t\t\t\tif (typeof languages[rootCode][key] === \'undefined\') {\r\n\t\t\t\t\t\tlanguages[rootCode][key] = messageMap[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlanguages[code][key] = messageMap[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\tfreshApi: function (language) {\r\n\t\t\tvar result = createApi();\r\n\t\t\tif (language) {\r\n\t\t\t\tresult.language(language);\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tvalidate: function (data, schema, checkRecursive, banUnknownProperties) {\r\n\t\t\tvar def = defaultErrorReporter(currentLanguage);\r\n\t\t\tvar errorReporter = customErrorReporter ? function (error, data, schema) {\r\n\t\t\t\treturn customErrorReporter(error, data, schema) || def(error, data, schema);\r\n\t\t\t} : def;\r\n\t\t\tvar context = new ValidatorContext(globalContext, false, errorReporter, checkRecursive, banUnknownProperties);\r\n\t\t\tif (typeof schema === "string") {\r\n\t\t\t\tschema = {"$ref": schema};\r\n\t\t\t}\r\n\t\t\tcontext.addSchema("", schema);\r\n\t\t\tvar error = context.validateAll(data, schema, null, null, "");\r\n\t\t\tif (!error && banUnknownProperties) {\r\n\t\t\t\terror = context.banUnknownProperties(data, schema);\r\n\t\t\t}\r\n\t\t\tthis.error = error;\r\n\t\t\tthis.missing = context.missing;\r\n\t\t\tthis.valid = (error === null);\r\n\t\t\treturn this.valid;\r\n\t\t},\r\n\t\tvalidateResult: function () {\r\n\t\t\tvar result = {toString: function () {\r\n\t\t\t\treturn this.valid ? \'valid\' : this.error.message;\r\n\t\t\t}};\r\n\t\t\tthis.validate.apply(result, arguments);\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tvalidateMultiple: function (data, schema, checkRecursive, banUnknownProperties) {\r\n\t\t\tvar def = defaultErrorReporter(currentLanguage);\r\n\t\t\tvar errorReporter = customErrorReporter ? function (error, data, schema) {\r\n\t\t\t\treturn customErrorReporter(error, data, schema) || def(error, data, schema);\r\n\t\t\t} : def;\r\n\t\t\tvar context = new ValidatorContext(globalContext, true, errorReporter, checkRecursive, banUnknownProperties);\r\n\t\t\tif (typeof schema === "string") {\r\n\t\t\t\tschema = {"$ref": schema};\r\n\t\t\t}\r\n\t\t\tcontext.addSchema("", schema);\r\n\t\t\tcontext.validateAll(data, schema, null, null, "");\r\n\t\t\tif (banUnknownProperties) {\r\n\t\t\t\tcontext.banUnknownProperties(data, schema);\r\n\t\t\t}\r\n\t\t\tvar result = {toString: function () {\r\n\t\t\t\treturn this.valid ? \'valid\' : this.error.message;\r\n\t\t\t}};\r\n\t\t\tresult.errors = context.errors;\r\n\t\t\tresult.missing = context.missing;\r\n\t\t\tresult.valid = (result.errors.length === 0);\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\taddSchema: function () {\r\n\t\t\treturn globalContext.addSchema.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetSchema: function () {\r\n\t\t\treturn globalContext.getSchema.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetSchemaMap: function () {\r\n\t\t\treturn globalContext.getSchemaMap.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetSchemaUris: function () {\r\n\t\t\treturn globalContext.getSchemaUris.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetMissingUris: function () {\r\n\t\t\treturn globalContext.getMissingUris.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tdropSchemas: function () {\r\n\t\t\tglobalContext.dropSchemas.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tdefineKeyword: function () {\r\n\t\t\tglobalContext.defineKeyword.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tdefineError: function (codeName, codeNumber, defaultMessage) {\r\n\t\t\tif (typeof codeName !== \'string\' || !/^[A-Z]+(_[A-Z]+)*$/.test(codeName)) {\r\n\t\t\t\tthrow new Error(\'Code name must be a string in UPPER_CASE_WITH_UNDERSCORES\');\r\n\t\t\t}\r\n\t\t\tif (typeof codeNumber !== \'number\' || codeNumber%1 !== 0 || codeNumber < 10000) {\r\n\t\t\t\tthrow new Error(\'Code number must be an integer > 10000\');\r\n\t\t\t}\r\n\t\t\tif (typeof ErrorCodes[codeName] !== \'undefined\') {\r\n\t\t\t\tthrow new Error(\'Error already defined: \' + codeName + \' as \' + ErrorCodes[codeName]);\r\n\t\t\t}\r\n\t\t\tif (typeof ErrorCodeLookup[codeNumber] !== \'undefined\') {\r\n\t\t\t\tthrow new Error(\'Error code already used: \' + ErrorCodeLookup[codeNumber] + \' as \' + codeNumber);\r\n\t\t\t}\r\n\t\t\tErrorCodes[codeName] = codeNumber;\r\n\t\t\tErrorCodeLookup[codeNumber] = codeName;\r\n\t\t\tErrorMessagesDefault[codeName] = ErrorMessagesDefault[codeNumber] = defaultMessage;\r\n\t\t\tfor (var langCode in languages) {\r\n\t\t\t\tvar language = languages[langCode];\r\n\t\t\t\tif (language[codeName]) {\r\n\t\t\t\t\tlanguage[codeNumber] = language[codeNumber] || language[codeName];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\treset: function () {\r\n\t\t\tglobalContext.reset();\r\n\t\t\tthis.error = null;\r\n\t\t\tthis.missing = [];\r\n\t\t\tthis.valid = true;\r\n\t\t},\r\n\t\tmissing: [],\r\n\t\terror: null,\r\n\t\tvalid: true,\r\n\t\tnormSchema: normSchema,\r\n\t\tresolveUrl: resolveUrl,\r\n\t\tgetDocumentUri: getDocumentUri,\r\n\t\terrorCodes: ErrorCodes\r\n\t};\r\n\tapi.language(language || \'en\');\r\n\treturn api;\r\n}\r\n\r\nvar tv4 = createApi();\r\ntv4.addLanguage(\'en-gb\', ErrorMessagesDefault);\r\n\r\n//legacy property\r\ntv4.tv4 = tv4;\r\n\r\nreturn tv4; // used by _header.js to globalise.\r\n\r\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL3R2NC90djQuanM/NGRjMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG5BdXRob3I6IEdlcmFpbnQgTHVmZiBhbmQgb3RoZXJzXHJcblllYXI6IDIwMTNcclxuXHJcblRoaXMgY29kZSBpcyByZWxlYXNlZCBpbnRvIHRoZSBcInB1YmxpYyBkb21haW5cIiBieSBpdHMgYXV0aG9yKHMpLiAgQW55Ym9keSBtYXkgdXNlLCBhbHRlciBhbmQgZGlzdHJpYnV0ZSB0aGUgY29kZSB3aXRob3V0IHJlc3RyaWN0aW9uLiAgVGhlIGF1dGhvciBtYWtlcyBubyBndWFyYW50ZWVzLCBhbmQgdGFrZXMgbm8gbGlhYmlsaXR5IG9mIGFueSBraW5kIGZvciB1c2Ugb2YgdGhpcyBjb2RlLlxyXG5cclxuSWYgeW91IGZpbmQgYSBidWcgb3IgbWFrZSBhbiBpbXByb3ZlbWVudCwgaXQgd291bGQgYmUgY291cnRlb3VzIHRvIGxldCB0aGUgYXV0aG9yIGtub3csIGJ1dCBpdCBpcyBub3QgY29tcHVsc29yeS5cclxuKi9cclxuKGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcclxuICBpZiAodHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kKSB7XHJcbiAgICAvLyBBTUQuIFJlZ2lzdGVy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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///558\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the "License");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an "AS IS" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n * Created by amo on 14/11/2015.\n */\nvar SourcePackage = function () {\n function SourcePackage(sourceCodeClassname, sourceCode) {\n (0, _classCallCheck3.default)(this, SourcePackage);\n\n this._sourceCode = sourceCode;\n this._sourceCodeClassname = sourceCodeClassname;\n\n this._encoding = null;\n this._signature = null;\n }\n\n (0, _createClass3.default)(SourcePackage, [{\n key: "sourceCode",\n get: function get() {\n return this._sourceCode;\n },\n set: function set(sourceCode) {\n if (sourceCode) this._sourceCode = sourceCode;\n }\n }, {\n key: "sourceCodeClassname",\n get: function get() {\n return this._sourceCodeClassname;\n },\n set: function set(sourceCodeClassname) {\n if (sourceCodeClassname) this._sourceCodeClassname = sourceCodeClassname;\n }\n }, {\n key: "encoding",\n get: function get() {\n return this._encoding;\n },\n set: function set(encoding) {\n if (encoding) this._encoding = encoding;\n }\n }, {\n key: "signature",\n get: function get() {\n return this._signature;\n },\n set: function set(sign) {\n if (sign) this._signature = sign;\n }\n }]);\n return SourcePackage;\n}();\n\nexports.default = SourcePackage;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9Tb3VyY2VQYWNrYWdlLmpzP2I0MzUiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZ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gICAgc2V0IHNvdXJjZUNvZGVDbGFzc25hbWUoc291cmNlQ29kZUNsYXNzbmFtZSkge1xuICAgICAgICBpZiAoc291cmNlQ29kZUNsYXNzbmFtZSlcbiAgICAgICAgICAgIHRoaXMuX3NvdXJjZUNvZGVDbGFzc25hbWUgPSBzb3VyY2VDb2RlQ2xhc3NuYW1lO1xuICAgIH1cbn1cblxuZXhwb3J0IGRlZmF1bHQgU291cmNlUGFja2FnZTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcnVudGltZS1jYXRhbG9ndWUvU291cmNlUGFja2FnZS5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXVCQTs7O0FBR0E7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBd0JBO0FBQ0E7QUFFQTs7O0FBekJBO0FBQ0E7QUFDQTtBQXlCQTtBQUNBO0FBRUE7OztBQTFCQTtBQUNBO0FBQ0E7QUFNQTtBQUNBO0FBRUE7OztBQVBBO0FBQ0E7QUFDQTtBQU9BO0FBQ0E7QUFFQTs7Ozs7QUFhQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///559\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.HypertyResourceType = exports.HypertyType = exports.RuntimeHypertyCapabilityType = undefined;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HypertyDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(HypertyDescriptor, _CatalogueDataObject);\n\n /**\n *\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object enabling the same object to be\n * stored and discovered in different Catalogues. Guid corresponds to per BNF of Resource Path.\n * @param {CatalogueObjectType} catalogueType - \tIndicates the type of Catalogue Data Object\n * @param {string} version\n * @param {string} objectName\n * @param {string} description\n * @param {string} language\n * @param {string} sourcePackageURL\n * @param {HypertyResourceType[]} hypertyType A tag that identifies what type of hyperty is described in the object.\n * @param {URL.HypertyCatalogueURLList} dataObjectUrls - It defines the Data Object Schemas supported by the Hyperty\n * through a list of Catalogue URLs from where these schemas can be reached\n */\n function HypertyDescriptor(guid, catalogueType, version, objectName, description, language, sourcePackageURL, hypertyType, dataObjectUrls) {\n (0, _classCallCheck3.default)(this, HypertyDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (HypertyDescriptor.__proto__ || (0, _getPrototypeOf2.default)(HypertyDescriptor)).call(this, guid, catalogueType, version, objectName, description, language, sourcePackageURL));\n\n _this._configuration = {};\n _this._constraints = {};\n _this._policies = {};\n _this._messageSchema = null;\n\n _this._hypertyType = hypertyType;\n _this._dataObjects = dataObjectUrls;\n return _this;\n }\n\n (0, _createClass3.default)(HypertyDescriptor, [{\n key: 'hypertyType',\n get: function get() {\n return this._hypertyType;\n },\n set: function set(hType) {\n if (hType) this._hypertyType = hType;\n }\n }, {\n key: 'dataObjects',\n get: function get() {\n return this._dataObjects;\n },\n set: function set(dataObjects) {\n if (dataObjects) this._dataObjects = dataObjects;\n }\n }, {\n key: 'configuration',\n get: function get() {\n return this._configuration;\n },\n set: function set(configuration) {\n if (configuration) this._configuration = configuration;\n }\n }, {\n key: 'constraints',\n get: function get() {\n return this._constraints;\n },\n set: function set(constraints) {\n if (constraints) this._constraints = constraints;\n }\n }, {\n key: 'messageSchema',\n get: function get() {\n return this._messageSchema;\n },\n set: function set(messageSchema) {\n if (messageSchema) this._messageSchema = messageSchema;\n }\n }, {\n key: 'policies',\n get: function get() {\n return this._policies;\n },\n set: function set(policies) {\n if (policies) this._policies = policies;\n }\n }]);\n return HypertyDescriptor;\n}(_CatalogueDataObject3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by amo on 14/11/2015.\n */\n\n\nvar RuntimeHypertyCapabilityType = exports.RuntimeHypertyCapabilityType = {};\nvar HypertyType = exports.HypertyType = { COMMUNICATOR: 'communicator', IDENTITY: 'identity', CONTEXT: 'context' };\nvar HypertyResourceType = exports.HypertyResourceType = { chat: 'CHAT', audio: 'Audio', video: 'Video', av: 'AV', screen: 'SCREEN',\n file: 'FILe', midi: 'MIDI' };\nexports.default = HypertyDescript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l0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUEwQkE7QUFDQTs7Ozs7QUFDQTs7O0FBRUE7Ozs7Ozs7Ozs7Ozs7O0FBY0E7QUFBQTtBQUNBO0FBREE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBVEE7QUFVQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFzQkE7QUFDQTtBQUVBOzs7QUF2QkE7QUFDQTtBQUNBO0FBdUJBO0FBQ0E7QUFFQTs7O0FBeEJBO0FBQ0E7QUFDQTtBQXdCQTtBQUNBO0FBRUE7OztBQXpCQTtBQUNBO0FBQ0E7QUF5QkE7QUFDQTtBQUVBOzs7QUExQkE7QUFDQTtBQUNBO0FBMEJBO0FBQ0E7QUFFQTs7O0FBM0JBO0FBQ0E7QUFDQTtBQTJCQTtBQUNBO0FBRUE7OztBQWhGQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFMQTs7Ozs7QUEwRkE7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///560\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ProtocolStubDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(ProtocolStubDescriptor, _CatalogueDataObject);\n\n function ProtocolStubDescriptor(guid, type, version, objectName, description, language, sourcePackageURL, messageSchemas, configuration, constraints, hypertyType, dataObjects, interworking, idpProxy, mutualAuthentication) {\n (0, _classCallCheck3.default)(this, ProtocolStubDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (ProtocolStubDescriptor.__proto__ || (0, _getPrototypeOf2.default)(ProtocolStubDescriptor)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n\n _this._messageSchemas = messageSchemas;\n\n if (configuration) _this._configuration = configuration;else _this._configuration = {};\n\n if (constraints) _this._constraints = constraints;else _this._constraints = {};\n\n _this._hypertyType = hypertyType;\n\n if (dataObjects) _this._dataObjects = dataObjects;else _this._dataObjects = [];\n\n _this._interworking = interworking;\n _this._idpProxy = idpProxy;\n _this._mutualAuthentication = mutualAuthentication;\n\n return _this;\n }\n\n (0, _createClass3.default)(ProtocolStubDescriptor, [{\n key: "messageSchemas",\n get: function get() {\n return this._messageSchemas;\n },\n set: function set(messageSchemas) {\n if (messageSchemas) this._messageSchemas = messageSchemas;\n }\n }, {\n key: "constraints",\n get: function get() {\n return this._constraints;\n },\n set: function set(constraints) {\n if (constraints) this._constraints = constraints;\n }\n }, {\n key: "configuration",\n get: function get() {\n return this._configuration;\n },\n set: function set(configuration) {\n if (configuration) this._configuration = configuration;\n }\n }, {\n key: "hypertyType",\n get: function get() {\n return this._hypertyType;\n },\n set: function set(value) {\n this._hypertyType = value;\n }\n }, {\n key: "dataObjects",\n get: function get() {\n return this._dataObjects;\n },\n set: function set(value) {\n this._dataObjects = value;\n }\n }, {\n key: "interworking",\n get: function get() {\n return this._interworking;\n },\n set: function set(value) {\n this._interworking = value;\n }\n }, {\n key: "idpProxy",\n get: function get() {\n return this._idpProxy;\n },\n set: function set(value) {\n this._idpProxy = value;\n }\n }, {\n key: "mutualAuthentication",\n get: function get() {\n return this._mutualAuthentication;\n },\n set: function set(value) {\n this._mutualAuthentication = value;\n }\n }]);\n return ProtocolStubDescriptor;\n}(_CatalogueDataObject3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by amo on 14/11/2015.\n */\n\nexports.default = ProtocolStubDescriptor;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9Qcm90b2NvbFN0dWJEZXNjcmlwdG9yLmpzP2I2NTIiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiAqIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4gKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xc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WJEZXNjcmlwdG9yO1xuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcnVudGltZS1jYXRhbG9ndWUvUHJvdG9jb2xTdHViRGVzY3JpcHRvci5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUEyQkE7QUFDQTs7Ozs7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBSUE7QUFDQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUF6QkE7QUEwQkE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBVUE7QUFDQTtBQUVBOzs7QUFYQTtBQUNBO0FBQ0E7QUFXQTtBQUNBO0FBRUE7OztBQVpBO0FBQ0E7QUFDQTtBQVlBO0FBQ0E7QUFFQTs7O0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQS9GQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFOQTs7OztBQXdHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///561\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.RuntimeType = exports.RuntimeProtocolCapability = exports.RuntimeHypertyCapability = undefined;\n\nvar _stringify = __webpack_require__(35);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HypertyRuntimeDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(HypertyRuntimeDescriptor, _CatalogueDataObject);\n\n function HypertyRuntimeDescriptor(guid, catalogueType, version, objectName, description, language, sourcePackageURL, runtimeType, hypertyCapabilities, protocolCapabilities, p2pHandlerStub, p2pRequesterStub) {\n (0, _classCallCheck3.default)(this, HypertyRuntimeDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (HypertyRuntimeDescriptor.__proto__ || (0, _getPrototypeOf2.default)(HypertyRuntimeDescriptor)).call(this, guid, catalogueType, version, objectName, description, language, sourcePackageURL));\n\n _this._runtimeType = runtimeType;\n\n if (hypertyCapabilities) _this._hypertyCapabilities = hypertyCapabilities;else _this._hypertyCapabilities = new RuntimeHypertyCapability(true, false, false, false, false);\n if (protocolCapabilities) _this._protocolCapabilities = protocolCapabilities;else _this._protocolCapabilities = new RuntimeProtocolCapability(true, false, true, false, false, false);\n\n _this._p2pHandlerStub = p2pHandlerStub;\n _this._p2pRequesterStub = p2pRequesterStub;\n return _this;\n }\n\n (0, _createClass3.default)(HypertyRuntimeDescriptor, [{\n key: 'runtimeType',\n get: function get() {\n return this._runtimeType;\n },\n set: function set(runtimeType) {\n if (runtimeType) this._runtimeType = runtimeType;\n }\n }, {\n key: 'hypertyCapabilities',\n get: function get() {\n return this._hypertyCapabilities;\n },\n set: function set(hypertyCapabilities) {\n if (hypertyCapabilities) this._hypertyCapabilities = hypertyCapabilities;\n }\n }, {\n key: 'protocolCapabilities',\n get: function get() {\n return this._hypertyCapabilities;\n },\n set: function set(protocolCapabilities) {\n if (protocolCapabilities) this._protocolCapabilities = protocolCapabilities;\n }\n }, {\n key: 'p2pHandlerStub',\n get: function get() {\n return this._p2pHandlerStub;\n },\n set: function set(value) {\n this._p2pHandlerStub = value;\n }\n }, {\n key: 'p2pRequesterStub',\n get: function get() {\n return this._p2pRequesterStub;\n },\n set: function set(value) {\n this._p2pRequesterStub = value;\n }\n }]);\n return HypertyRuntimeDescriptor;\n}(_CatalogueDataObject3.default);\n\n/**\n * A class representation of the capability set of the Runtime Hyperty\n */\n/**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by amo on 14/11/2015.\n */\n\nvar RuntimeHypertyCapability = exports.RuntimeHypertyCapability = function () {\n /**\n * Creates an object of the Runtime Hyperty capability set\n * @param {boolean} isWebRTCSupported\n * @param {boolean} isMicSupported\n * @param {boolean} isCameraSupported\n * @param {boolean} isSensorSupported\n * @param {boolean} isORTCSupported\n */\n function RuntimeHypertyCapability(isWebRTCSupported, isMicSupported, isCameraSupported, isSensorSupported, isORTCSupported) {\n (0, _classCallCheck3.default)(this, RuntimeHypertyCapability);\n\n this._isWebRTC = isWebRTCSupported;\n this._isMic = isMicSupported;\n this._isCamera = isCameraSupported;\n this._isSensor = isSensorSupported;\n this._isORTC = isORTCSupported;\n }\n\n (0, _createClass3.default)(RuntimeHypertyCapability, [{\n key: 'getCapabilitySet',\n value: function getCapabilitySet() {\n return (0, _stringify2.default)(this);\n }\n }, {\n key: 'isMic',\n get: function get() {\n return this._isMic;\n }\n }, {\n key: 'isCamera',\n get: function get() {\n return this._isCamera;\n }\n }, {\n key: 'isSensor',\n get: function get() {\n return this._isSensor;\n }\n }, {\n key: 'isWebRTC',\n get: function get() {\n return this._isWebRTC;\n }\n }, {\n key: 'isORTCS',\n get: function get() {\n return this._isORTC;\n }\n }]);\n return RuntimeHypertyCapability;\n}();\n\n/**\n * A class representation of the protocol capability set of the Runtime Hyperty\n */\n\n\nvar RuntimeProtocolCapability = exports.RuntimeProtocolCapability = function () {\n\n /**\n * Creates an object of the runtime protocol capability\n * @param {boolean} isHttp\n * @param {boolean} isHttps\n * @param {boolean} isWS\n * @param {boolean} isWSS\n * @param {boolean} isCoap\n * @param {boolean} isDataChannel\n */\n function RuntimeProtocolCapability(isHttp, isHttps, isWS, isWSS, isCoap, isDataChannel) {\n (0, _classCallCheck3.default)(this, RuntimeProtocolCapability);\n\n this._isHttp = isHttp;\n this._isHttps = isHttps;\n this._isWS = isWS;\n this._isWSS = isWSS;\n this._isCoap = isCoap;\n this._isDataChannel = isDataChannel;\n }\n\n (0, _createClass3.default)(RuntimeProtocolCapability, [{\n key: 'isHttp',\n value: function isHttp() {\n return this._isHttp;\n }\n }, {\n key: 'isHttps',\n value: function isHttps() {\n return this._isHttps;\n }\n }, {\n key: 'isWS',\n value: function isWS() {\n return this._isWS;\n }\n }, {\n key: 'isSensorSupported',\n value: function isSensorSupported() {\n return this._isSensor;\n }\n }, {\n key: 'isWSS',\n value: function isWSS() {\n return this._isWSS;\n }\n }, {\n key: 'isCoap',\n value: function isCoap() {\n return this._isCoap;\n }\n }, {\n key: 'isDataChannel',\n value: function isDataChannel() {\n return this._isDataChannel;\n }\n }, {\n key: 'getCapabilitySet',\n value: function getCapabilitySet() {\n return (0, _stringify2.default)(this);\n }\n }]);\n return RuntimeProtocolCapability;\n}();\n\nvar RuntimeType = exports.RuntimeType = { BROWSER: 'browser', STANDALONE: 'standalone', SERVER: 'server', GATEWAY: 'gateway' };\n\nexports.default = HypertyRuntimeDescriptor;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9IeXBlcnR5UnVudGltZURlc2NyaXB0b3IuanM/ZDdkNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuICogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiAqIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuICogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiAqIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuICogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuICogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4gKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuICpcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5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UFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7Ozs7QUFRQTs7Ozs7QUFHQTtBQUNBO0FBQ0E7Ozs7Ozs7OztBQVNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBR0E7QUFDQTtBQUNBOzs7OztBQUdBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///562\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PolicyEnforcerDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(PolicyEnforcerDescriptor, _CatalogueDataObject);\n\n function PolicyEnforcerDescriptor(guid, type, version, objectName, description, language, sourcePackageURL, configuration, policies) {\n (0, _classCallCheck3.default)(this, PolicyEnforcerDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (PolicyEnforcerDescriptor.__proto__ || (0, _getPrototypeOf2.default)(PolicyEnforcerDescriptor)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n\n _this._configuration = configuration;\n _this._policies = policies;\n return _this;\n }\n\n (0, _createClass3.default)(PolicyEnforcerDescriptor, [{\n key: 'configuration',\n get: function get() {\n return this._configuration;\n },\n set: function set(configuration) {\n this._configuration = configuration;\n }\n }, {\n key: 'policies',\n get: function get() {\n return this._policies;\n },\n set: function set(policies) {\n this._policies = policies;\n }\n }]);\n return PolicyEnforcerDescriptor;\n}(_CatalogueDataObject3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by pzu on 19.11.15.\n */\n\n\nexports.default = PolicyEnforcerDescriptor;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy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Y2llcyhwb2xpY2llcykge1xuICAgICAgICB0aGlzLl9wb2xpY2llcyA9IHBvbGljaWVzO1xuICAgIH1cblxuICAgIHNldCBjb25maWd1cmF0aW9uKGNvbmZpZ3VyYXRpb24pIHtcbiAgICAgICAgdGhpcy5fY29uZmlndXJhdGlvbiA9IGNvbmZpZ3VyYXRpb247XG4gICAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBQb2xpY3lFbmZvcmNlckRlc2NyaXB0b3I7XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9ydW50aW1lLWNhdGFsb2d1ZS9IeXBlcnR5SW50ZXJjZXB0b3JEZXNjcmlwdG9yLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTBCQTtBQUNBOzs7OztBQUNBOzs7QUFDQTtBQUFBO0FBQ0E7QUFEQTtBQUNBO0FBRUE7QUFDQTtBQUpBO0FBS0E7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBVUE7QUFDQTtBQUNBOzs7QUFWQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQWxCQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFMQTs7Ozs7QUE4QkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///563\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DataUrlScheme = exports.ContextDataObjectSchema = exports.IdentityDataObjectSchema = exports.ConnectionDataObjectSchema = exports.CommunicationDataObjectSchema = exports.HypertyDataObjectSchema = exports.MessageDataObjectSchema = exports.DataObjectSchema = undefined;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar DataObjectSchema = exports.DataObjectSchema = function (_CatalogueDataObject) {\n (0, _inherits3.default)(DataObjectSchema, _CatalogueDataObject);\n\n function DataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL) {\n (0, _classCallCheck3.default)(this, DataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (DataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(DataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n }\n\n return DataObjectSchema;\n}(_CatalogueDataObject3.default);\n\n//Children\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n * Created by pzu on 19.11.15.\n */\n\nvar MessageDataObjectSchema = exports.MessageDataObjectSchema = function (_DataObjectSchema) {\n (0, _inherits3.default)(MessageDataObjectSchema, _DataObjectSchema);\n\n function MessageDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL) {\n (0, _classCallCheck3.default)(this, MessageDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (MessageDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(MessageDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n }\n\n return MessageDataObjectSchema;\n}(DataObjectSchema);\n\nvar HypertyDataObjectSchema = exports.HypertyDataObjectSchema = function (_DataObjectSchema2) {\n (0, _inherits3.default)(HypertyDataObjectSchema, _DataObjectSchema2);\n\n function HypertyDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy, dataUrlScheme) {\n (0, _classCallCheck3.default)(this, HypertyDataObjectSchema);\n\n var _this3 = (0, _possibleConstructorReturn3.default)(this, (HypertyDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(HypertyDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n\n _this3._accessControlPolicy = accessControlPolicy;\n _this3._scheme = dataUrlScheme;\n return _this3;\n }\n\n return HypertyDataObjectSchema;\n}(DataObjectSchema);\n\n//Children\n\n\nvar CommunicationDataObjectSchema = exports.CommunicationDataObjectSchema = function (_HypertyDataObjectSch) {\n (0, _inherits3.default)(CommunicationDataObjectSchema, _HypertyDataObjectSch);\n\n function CommunicationDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, CommunicationDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (CommunicationDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(CommunicationDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return CommunicationDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar ConnectionDataObjectSchema = exports.ConnectionDataObjectSchema = function (_HypertyDataObjectSch2) {\n (0, _inherits3.default)(ConnectionDataObjectSchema, _HypertyDataObjectSch2);\n\n function ConnectionDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, ConnectionDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (ConnectionDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(ConnectionDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return ConnectionDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar IdentityDataObjectSchema = exports.IdentityDataObjectSchema = function (_HypertyDataObjectSch3) {\n (0, _inherits3.default)(IdentityDataObjectSchema, _HypertyDataObjectSch3);\n\n function IdentityDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, IdentityDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (IdentityDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(IdentityDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return IdentityDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar ContextDataObjectSchema = exports.ContextDataObjectSchema = function (_HypertyDataObjectSch4) {\n (0, _inherits3.default)(ContextDataObjectSchema, _HypertyDataObjectSch4);\n\n function ContextDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, ContextDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (ContextDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(ContextDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return ContextDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar DataUrlScheme = exports.DataUrlScheme = {\n COMM: 'COMM', CONNECTION: 'CONNECTION', CTXT: 'CTXT', IDENTITY: 'IDENTITY'\n};\n\nexports.default = DataObject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OztBQUpBO0FBQ0E7QUFLQTs7O0FBQ0E7QUFBQTtBQUFBO0FBRUE7QUFDQTs7QUFKQTtBQUNBO0FBS0E7QUFDQTtBQURBO0FBQ0E7QUFHQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///564\n")}])}); \ No newline at end of file +!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Runtime",[],n):"object"==typeof exports?exports.Runtime=n():e.Runtime=n()}("undefined"!=typeof self?self:this,function(){return function(e){var n={};function t(c){if(n[c])return n[c].exports;var g=n[c]={i:c,l:!1,exports:{}};return e[c].call(g.exports,g,g.exports,t),g.l=!0,g.exports}return t.m=e,t.c=n,t.d=function(e,n,c){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:c})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=225)}([function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar core = __webpack_require__(32);\nvar hide = __webpack_require__(23);\nvar redefine = __webpack_require__(24);\nvar ctx = __webpack_require__(33);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});\n var key, own, out, exp;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n // export native or passed\n out = (own ? target : source)[key];\n // bind timers to global for call from export context\n exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // extend global\n if (target) redefine(target, key, out, type & $export.U);\n // export\n if (exports[key] != out) hide(exports, key, exp);\n if (IS_PROTO && expProto[key] != out) expProto[key] = out;\n }\n};\nglobal.core = core;\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2V4cG9ydC5qcz8wZWNlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIFBST1RPVFlQRSA9ICdwcm90b3R5cGUnO1xuXG52YXIgJGV4cG9ydCA9IGZ1bmN0aW9uICh0eXBlLCBuYW1lLCBzb3VyY2UpIHtcbiAgdmFyIElTX0ZPUkNFRCA9IHR5cGUgJiAkZXhwb3J0LkY7XG4gIHZhciBJU19HTE9CQUwgPSB0eXBlICYgJGV4cG9ydC5HO1xuICB2YXIgSVNfU1RBVElDID0gdHlwZSAmICRleHBvcnQuUztcbiAgdmFyIElTX1BST1RPID0gdHlwZSAmICRleHBvcnQuUDtcbiAgdmFyIElTX0JJTkQgPSB0eXBlICYgJGV4cG9ydC5CO1xuICB2YXIgdGFyZ2V0ID0gSVNfR0xPQkFMID8gZ2xv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\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError("Cannot call a class as a function");\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY2xhc3NDYWxsQ2hlY2suanM/NjZiOSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKGluc3RhbmNlLCBDb25zdHJ1Y3Rvcikge1xuICBpZiAoIShpbnN0YW5jZSBpbnN0YW5jZW9mIENvbnN0cnVjdG9yKSkge1xuICAgIHRocm93IG5ldyBUeXBlRXJyb3IoXCJDYW5ub3QgY2FsbCBhIGNsYXNzIGFzIGEgZnVuY3Rpb25cIik7XG4gIH1cbn07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL2NsYXNzQ2FsbENoZWNrLmpzXG4vLyBtb2R1bGUgaWQgPSAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(204);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ("value" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvY3JlYXRlQ2xhc3MuanM/YzMxMCJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF9kZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoXCIuLi9jb3JlLWpzL29iamVjdC9kZWZpbmUtcHJvcGVydHlcIik7XG5cbnZhciBfZGVmaW5lUHJvcGVydHkyID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfZGVmaW5lUHJvcGVydHkpO1xuXG5mdW5jdGlvbiBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KG9iaikgeyByZXR1cm4gb2JqICYmIG9iai5fX2VzTW9kdWxlID8gb2JqIDogeyBkZWZhdWx0OiBvYmogfTsgfVxuXG5leHBvcnRzLmRlZmF1bHQgPSBmdW5jdGlvbiAoKSB7XG4gIGZ1bmN0aW9uIGRlZmluZVByb3BlcnRpZXModGFyZ2V0LCBwcm9wcykge1xuICAgIGZvciAodmFyIGkgPSAwOyBpIDwgcHJvcHMubGVuZ3RoOyBpKyspIHtcbiAgICAgIHZhciBkZXNjcmlwdG9yID0gcHJvcHNbaV07XG4gICAgICBkZXNjcmlwdG9yLm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L=webpack-internal:///2\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(433), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvcHJvbWlzZS5qcz9mZmYxIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9wcm9taXNlXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3Byb21pc2UuanNcbi8vIG1vZHVsZSBpZCA9IDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///3\n')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n* loglevel - https://github.com/pimterry/loglevel\n*\n* Copyright (c) 2013 Tim Perry\n* Licensed under the MIT license.\n*/\n(function (root, definition) {\n "use strict";\n if (true) {\n !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) :\n\t\t\t\t__WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else if (typeof module === \'object\' && module.exports) {\n module.exports = definition();\n } else {\n root.log = definition();\n }\n}(this, function () {\n "use strict";\n\n // Slightly dubious tricks to cut down minimized file size\n var noop = function() {};\n var undefinedType = "undefined";\n\n var logMethods = [\n "trace",\n "debug",\n "info",\n "warn",\n "error"\n ];\n\n // Cross-browser bind equivalent that works at least back to IE6\n function bindMethod(obj, methodName) {\n var method = obj[methodName];\n if (typeof method.bind === \'function\') {\n return method.bind(obj);\n } else {\n try {\n return Function.prototype.bind.call(method, obj);\n } catch (e) {\n // Missing bind shim or IE8 + Modernizr, fallback to wrapping\n return function() {\n return Function.prototype.apply.apply(method, [obj, arguments]);\n };\n }\n }\n }\n\n // Build the best logging method possible for this env\n // Wherever possible we want to bind, not wrap, to preserve stack traces\n function realMethod(methodName) {\n if (methodName === \'debug\') {\n methodName = \'log\';\n }\n\n if (typeof console === undefinedType) {\n return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives\n } else if (console[methodName] !== undefined) {\n return bindMethod(console, methodName);\n } else if (console.log !== undefined) {\n return bindMethod(console, \'log\');\n } else {\n return noop;\n }\n }\n\n // These private functions always need `this` to be set properly\n\n function replaceLoggingMethods(level, loggerName) {\n /*jshint validthis:true */\n for (var i = 0; i < logMethods.length; i++) {\n var methodName = logMethods[i];\n this[methodName] = (i < level) ?\n noop :\n this.methodFactory(methodName, level, loggerName);\n }\n\n // Define log.log as an alias for log.debug\n this.log = this.debug;\n }\n\n // In old IE versions, the console isn\'t present until you first open it.\n // We build realMethod() replacements here that regenerate logging methods\n function enableLoggingWhenConsoleArrives(methodName, level, loggerName) {\n return function () {\n if (typeof console !== undefinedType) {\n replaceLoggingMethods.call(this, level, loggerName);\n this[methodName].apply(this, arguments);\n }\n };\n }\n\n // By default, we use closely bound real methods wherever possible, and\n // otherwise we wait for a console to appear, and then try again.\n function defaultMethodFactory(methodName, level, loggerName) {\n /*jshint validthis:true */\n return realMethod(methodName) ||\n enableLoggingWhenConsoleArrives.apply(this, arguments);\n }\n\n function Logger(name, defaultLevel, factory) {\n var self = this;\n var currentLevel;\n var storageKey = "loglevel";\n if (name) {\n storageKey += ":" + name;\n }\n\n function persistLevelIfPossible(levelNum) {\n var levelName = (logMethods[levelNum] || \'silent\').toUpperCase();\n\n if (typeof window === undefinedType) return;\n\n // Use localStorage if available\n try {\n window.localStorage[storageKey] = levelName;\n return;\n } catch (ignore) {}\n\n // Use session cookie as fallback\n try {\n window.document.cookie =\n encodeURIComponent(storageKey) + "=" + levelName + ";";\n } catch (ignore) {}\n }\n\n function getPersistedLevel() {\n var storedLevel;\n\n if (typeof window === undefinedType) return;\n\n try {\n storedLevel = window.localStorage[storageKey];\n } catch (ignore) {}\n\n // Fallback to cookies if local storage gives us nothing\n if (typeof storedLevel === undefinedType) {\n try {\n var cookie = window.document.cookie;\n var location = cookie.indexOf(\n encodeURIComponent(storageKey) + "=");\n if (location !== -1) {\n storedLevel = /^([^;]+)/.exec(cookie.slice(location))[1];\n }\n } catch (ignore) {}\n }\n\n // If the stored level is not valid, treat it as if nothing was stored.\n if (self.levels[storedLevel] === undefined) {\n storedLevel = undefined;\n }\n\n return storedLevel;\n }\n\n /*\n *\n * Public logger API - see https://github.com/pimterry/loglevel for details\n *\n */\n\n self.name = name;\n\n self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3,\n "ERROR": 4, "SILENT": 5};\n\n self.methodFactory = factory || defaultMethodFactory;\n\n self.getLevel = function () {\n return currentLevel;\n };\n\n self.setLevel = function (level, persist) {\n if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) {\n level = self.levels[level.toUpperCase()];\n }\n if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) {\n currentLevel = level;\n if (persist !== false) { // defaults to true\n persistLevelIfPossible(level);\n }\n replaceLoggingMethods.call(self, level, name);\n if (typeof console === undefinedType && level < self.levels.SILENT) {\n return "No console available for logging";\n }\n } else {\n throw "log.setLevel() called with invalid level: " + level;\n }\n };\n\n self.setDefaultLevel = function (level) {\n if (!getPersistedLevel()) {\n self.setLevel(level, false);\n }\n };\n\n self.enableAll = function(persist) {\n self.setLevel(self.levels.TRACE, persist);\n };\n\n self.disableAll = function(persist) {\n self.setLevel(self.levels.SILENT, persist);\n };\n\n // Initialize with the right level\n var initialLevel = getPersistedLevel();\n if (initialLevel == null) {\n initialLevel = defaultLevel == null ? "WARN" : defaultLevel;\n }\n self.setLevel(initialLevel, false);\n }\n\n /*\n *\n * Top-level API\n *\n */\n\n var defaultLogger = new Logger();\n\n var _loggersByName = {};\n defaultLogger.getLogger = function getLogger(name) {\n if (typeof name !== "string" || name === "") {\n throw new TypeError("You must supply a name when creating a logger.");\n }\n\n var logger = _loggersByName[name];\n if (!logger) {\n logger = _loggersByName[name] = new Logger(\n name, defaultLogger.getLevel(), defaultLogger.methodFactory);\n }\n return logger;\n };\n\n // Grab the current global log variable in case of overwrite\n var _log = (typeof window !== undefinedType) ? window.log : undefined;\n defaultLogger.noConflict = function() {\n if (typeof window !== undefinedType &&\n window.log === defaultLogger) {\n window.log = _log;\n }\n\n return defaultLogger;\n };\n\n defaultLogger.getLoggers = function getLoggers() {\n return _loggersByName;\n };\n\n return defaultLogger;\n}));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9sb2dsZXZlbC9saWIvbG9nbGV2ZWwuanM/MDZmYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuKiBsb2dsZXZlbCAtIGh0dHBzOi8vZ2l0aHViLmNvbS9waW10ZXJyeS9sb2dsZXZlbFxuKlxuKiBDb3B5cmlnaHQgKGMpIDIwMTMgVGltIFBlcnJ5XG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBNSVQgbGljZW5zZS5cbiovXG4oZnVuY3Rpb24gKHJvb3QsIGRlZmluaXRp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T09IHVuZGVmaW5lZFR5cGUpIHJldHVybjtcblxuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIHN0b3JlZExldmVsID0gd2luZG93LmxvY2FsU3RvcmFnZVtzdG9yYWdlS2V5XTtcbiAgICAgICAgICB9IGNhdGNoIChpZ25vcmUpIHt9XG5cbiAgICAgICAgICAvLyBGYWxsYmFjayB0byBjb29raWVzIGlmIGxvY2FsIHN0b3JhZ2UgZ2l2ZXMgdXMgbm90aGluZ1xuICAgICAgICAgIGlmICh0eXBlb2Ygc3RvcmVkTGV2ZWwgPT09IHVuZGVmaW5lZFR5cGUpIHtcbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgIHZhciBjb29raWUgPSB3aW5kb3cuZG9jdW1lbnQuY29va2llO1xuICAgICAgICAgICAgICAgICAgdmFyIGxvY2F0aW9uID0gY29va2llLmluZGV4T2YoXG4gICAgICAgICAgICAgICAgICAgICAgZW5jb2RlVVJJQ29tcG9uZW50KHN0b3JhZ2VLZXkpICsgXCI9XCIpO1xuICAgICAgICAgICAgICAgICAgaWYgKGxvY2F0aW9uICE9PSAtMSkge1xuICAgICAgICAgICAgICAgICAgICAgIHN0b3JlZExldmVsID0gL14oW147XSspLy5leGVjKGNvb2tpZS5zbGljZShsb2NhdGlvbikpWzFdO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9IGNhdGNoIChpZ25vcmUpIHt9XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgLy8gSWYgdGhlIHN0b3JlZCBsZXZlbCBpcyBub3QgdmFsaWQsIHRyZWF0IGl0IGFzIGlmIG5vdGhpbmcgd2FzIHN0b3JlZC5cbiAgICAgICAgICBpZiAoc2VsZi5sZXZlbHNbc3RvcmVkTGV2ZWxdID09PSB1bmRlZmluZWQpIHtcbiAgICAgICAgICAgICAgc3RvcmVkTGV2ZWwgPSB1bmRlZmluZWQ7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0d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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///4\n')},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2FuLW9iamVjdC5qcz8wYzg1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYW4tb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///5\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.divideURL = divideURL;\nexports.emptyObject = emptyObject;\nexports.secondsSinceEpoch = secondsSinceEpoch;\nexports.deepClone = deepClone;\nexports.removePathFromURL = removePathFromURL;\nexports.getUserURLFromEmail = getUserURLFromEmail;\nexports.getUserEmailFromURL = getUserEmailFromURL;\nexports.convertToUserURL = convertToUserURL;\nexports.isDataObjectURL = isDataObjectURL;\nexports.isLegacy = isLegacy;\nexports.isURL = isURL;\nexports.isUserURL = isUserURL;\nexports.isHypertyURL = isHypertyURL;\nexports.getConfigurationResources = getConfigurationResources;\nexports.buildURL = buildURL;\nexports.generateGUID = generateGUID;\nexports.getUserIdentityDomain = getUserIdentityDomain;\nexports.isBackendServiceURL = isBackendServiceURL;\nexports.divideEmail = divideEmail;\nexports.assign = assign;\nexports.splitObjectURL = splitObjectURL;\nexports.checkAttribute = checkAttribute;\nexports.parseAttributes = parseAttributes;\nexports.isEmpty = isEmpty;\nexports.chatkeysToStringCloner = chatkeysToStringCloner;\nexports.chatkeysToArrayCloner = chatkeysToArrayCloner;\nexports.parseMessageURL = parseMessageURL;\nexports.availableSpace = availableSpace;\nexports.encode = encode;\nexports.decode = decode;\nexports.decodeToUint8Array = decodeToUint8Array;\nexports.stringify = stringify;\nexports.parse = parse;\nexports.parseToUint8Array = parseToUint8Array;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * Support module with some functions will be useful\n * @module utils\n */\n\n/**\n * @typedef divideURL\n * @type Object\n * @property {string} type The type of URL\n * @property {string} domain The domain of URL\n * @property {string} identity The identity of URL\n */\n\n/**\n * Divide an url in type, domain and identity\n * @param {URL.URL} url - url address\n * @return {divideURL} the result of divideURL\n */\nfunction divideURL(url) {\n\n function recurse(value) {\n var regex = /([a-zA-Z-]*)(:\\/\\/(?:\\.)?|:)([-a-zA-Z0-9@:%._+~#=]{2,256})([-a-zA-Z0-9@:%._+~#=/]*)/gi;\n var subst = '$1,$3,$4';\n var parts = value.replace(regex, subst).split(',');\n return parts;\n }\n\n var parts = recurse(url);\n\n // If the url has no scheme\n if (parts[0] === url && !parts[0].includes('@')) {\n\n var _result = {\n type: '',\n domain: url,\n identity: ''\n };\n\n console.warn('[DivideURL] DivideURL don\\'t support url without scheme. Please review your url address', url);\n\n return _result;\n }\n\n // check if the url has the scheme and includes an @\n if (parts[0] === url && parts[0].includes('@')) {\n var scheme = parts[0] === url ? 'smtp' : parts[0];\n parts = recurse(scheme + '://' + parts[0]);\n }\n\n // if the domain includes an @, divide it to domain and identity respectively\n if (parts[1].includes('@')) {\n parts[2] = parts[0] + '://' + parts[1];\n parts[1] = parts[1].substr(parts[1].indexOf('@') + 1);\n } /*else if (parts[2].includes('/')) {\n parts[2] = parts[2].substr(parts[2].lastIndexOf('/')+1);\n }*/\n\n var result = {\n type: parts[0],\n domain: parts[1],\n identity: parts[2]\n };\n\n return result;\n}\n\n/**\n * Check if an Object is empty\n * @param {Object} object Object to be checked\n * @return {Boolean} status of Object, empty or not (true|false);\n */\nfunction emptyObject(object) {\n return (0, _keys2.default)(object).length > 0 ? false : true;\n}\n\nfunction secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n}\n\n/**\n * Make a COPY of the original data\n * @param {Object} obj - object to be cloned\n * @return {Object}\n */\nfunction deepClone(obj) {\n //TODO: simple but inefficient JSON deep clone...\n if (obj) return JSON.parse((0, _stringify2.default)(obj));\n}\n\nfunction removePathFromURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n}\n\n/**\n * Obtains the user URL that corresponds to a given email\n * @param {string} userEmail The user email\n * @return {URL.URL} userURL The user URL\n */\nfunction getUserURLFromEmail(userEmail) {\n var indexOfAt = userEmail.indexOf('@');\n return 'user://' + userEmail.substring(indexOfAt + 1, userEmail.length) + '/' + userEmail.substring(0, indexOfAt);\n}\n\n/**\n * Obtains the user email that corresponds to a given URL\n * @param {URL.URL} userURL The user URL\n * @return {string} userEmail The user email\n */\nfunction getUserEmailFromURL(userURL) {\n var url = divideURL(userURL);\n return url.identity.replace('/', '') + '@' + url.domain; // identity field has '/exampleID' instead of 'exampleID'\n}\n\n/**\n * Check if the user identifier is already in the URL format, if not, convert to URL format\n * @param {string} identifier user identifier\n * @return {string} userURL the user URL\n */\nfunction convertToUserURL(identifier) {\n\n // check if the identifier is already in the url format\n if (identifier.substring(0, 7) === 'user://') {\n var dividedURL = divideURL(identifier);\n\n //check if the url is well formated\n if (dividedURL.domain && dividedURL.identity) {\n return identifier;\n } else {\n throw 'userURL with wrong format';\n }\n\n //if not, convert the user email to URL format\n } else {\n return getUserURLFromEmail(identifier);\n }\n}\n\nfunction isDataObjectURL(url) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain', 'hyperty'];\n var splitURL = url.split('://');\n var urlSchema = splitURL[0];\n\n return schemasToIgnore.indexOf(urlSchema) === -1;\n}\n\nfunction isLegacy(url) {\n if (url.split('@').length > 1) {\n return true;\n } else {\n return false;\n }\n}\n\nfunction isURL(url) {\n return url.split('/').length >= 3;\n}\n\nfunction isUserURL(url) {\n return divideURL(url).type === 'user';\n}\n\nfunction isHypertyURL(url) {\n return divideURL(url).type === 'hyperty';\n}\n\n/**\n * get information relative each component configured on runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @return {object} return an object with all configurations;\n */\nfunction getConfigurationResources(configuration, component, resource) {\n var objectResource = configuration[component];\n var resourceType = objectResource[resource];\n\n return resourceType;\n}\n\n/**\n * Build a full url with the runtime configuration;\n * @param {object} configuration object with all configuration\n * @param {string} component string with the component to get the configuration, like, runtimeURLS, catalogueURLs, msgNodeURL, domainRegistryURL;\n * @param {string} resource type of resource to get, like, catalogue, runtimeUA, protocolstub, idpProxy\n * @param {string} type resource to get, like a hyperty name or protocolstub name;\n * @param {boolean} useFallback if true the function will check if have a fallback url;\n * @return {string} partial url to contact the resource;\n */\nfunction buildURL(configuration, component, resource, type) {\n var useFallback = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n var objectResource = configuration[component];\n var url = void 0;\n\n if (!objectResource.hasOwnProperty(resource)) {\n throw Error('The configuration ' + (0, _stringify2.default)(objectResource, '', 2) + ' don\\'t have the ' + resource + ' resource you are looking for');\n }\n\n var resourceType = objectResource[resource];\n\n if (type) {\n url = resourceType.prefix + configuration.domain + resourceType.suffix + type;\n if (resourceType.hasOwnProperty('fallback') && useFallback) {\n if (resourceType.fallback.indexOf('%domain%')) {\n url = resourceType.fallback.replace(/(%domain%)/g, configuration.domain) + type;\n } else {\n url = resourceType.fallback + type;\n }\n }\n } else {\n url = resourceType.prefix + configuration.domain + resourceType.suffix;\n }\n\n // console.log(url);\n\n return url;\n}\n\n/**\n * Generate a Global Unique ID\n *\n * @returns String;\n */\nfunction generateGUID() {\n\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}\n\nfunction getUserIdentityDomain(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var splitedLength = splitedDomain.length;\n if (splitedLength == 1) {\n return splitedDomain[splitedLength - 1];\n }\n var domain = splitedDomain[splitedLength - 2] + '.' + splitedDomain[splitedLength - 1];\n return domain;\n}\n\n/**\n * Check if URL is from a backend service\n * @param {string} url URL to be processed\n * @return {boolean}\n */\n\nfunction isBackendServiceURL(url) {\n var dividedURL = divideURL(url);\n var splitedDomain = dividedURL.domain.split('.');\n var backendSchemes = ['domain', 'global', 'domain-idp']; // should be defined in the runtime configuration\n var backendSubDomains = ['registry', 'msg-node']; // should be defined in the runtime configuration\n var subDomain = void 0;\n\n if (splitedDomain.length > 1) {\n subDomain = splitedDomain.filter(function (item) {\n return backendSubDomains.indexOf(item) !== -1;\n })[0];\n }\n\n if (subDomain && backendSubDomains.indexOf(subDomain) !== -1) {\n return true;\n }\n\n if (dividedURL.type) {\n return backendSchemes.indexOf(dividedURL.type) !== -1;\n }\n\n return false;\n}\n\nfunction divideEmail(email) {\n var indexOfAt = email.indexOf('@');\n\n var result = {\n username: email.substring(0, indexOfAt),\n domain: email.substring(indexOfAt + 1, email.length)\n };\n\n return result;\n}\n\nfunction assign(obj, keyPath, value) {\n\n if (!obj) obj = {};\n if (typeof keyPath === 'string') keyPath = parseAttributes(keyPath);\n\n var lastKeyIndex = keyPath.length - 1;\n\n for (var i = 0; i < lastKeyIndex; ++i) {\n var key = keyPath[i];\n if (!(key in obj)) {\n obj[key] = {};\n }\n\n obj = obj[key];\n }\n\n obj[keyPath[lastKeyIndex]] = value;\n}\n\nfunction splitObjectURL(dataObjectURL) {\n console.info('[utils - splitObjectURL]: ', dataObjectURL);\n\n var splitedURL = dataObjectURL.split('/');\n var url = splitedURL[0] + '//' + splitedURL[2] + '/' + splitedURL[3];\n var resource = splitedURL[5];\n\n var result = {\n url: url,\n resource: resource\n };\n\n console.info('[utils - splitObjectURL]: ', result);\n\n return result;\n}\n\nfunction checkAttribute(path) {\n\n var regex = /((([a-zA-Z]+):\\/\\/([0-9a-zA-Z][-\\w]*[0-9a-zA-Z]\\.)+[a-zA-Z]{2,9})\\/[a-zA-Z0-9.]+@[a-zA-Z0-9]+(-)?[a-zA-Z0-9]+(\\.)?[a-zA-Z0-9]{2,10}?\\.[a-zA-Z]{2,10})(.+(?=.identity))?/gm;\n\n var list = [];\n var final = [];\n var test = path.match(regex);\n\n if (test == null) {\n final = path.split('.');\n } else {\n var m = void 0;\n while ((m = regex.exec(path)) !== null) {\n // This is necessary to avoid infinite loops with zero-width matches\n if (m.index === regex.lastIndex) {\n regex.lastIndex++;\n }\n\n // The result can be accessed through the `m`-variable.\n m.forEach(function (match, groupIndex) {\n if (groupIndex === 0) {\n list.push(match);\n }\n });\n }\n var result = void 0;\n list.forEach(function (url) {\n\n result = path.replace(url, '*-*');\n final = result.split('.').map(function (item) {\n\n if (item === '*-*') {\n return url;\n }\n\n return item;\n });\n });\n }\n\n console.log('[RuntimeCore.Utils.checkAttribute]', final);\n return final;\n}\n\nfunction parseAttributes(path) {\n var regex = /([0-9a-zA-Z][-\\w]*):\\/\\//g;\n\n var string3 = 'identity';\n\n if (!path.includes('://')) {\n return path.split('.');\n } else {\n var string1 = path.split(regex)[0];\n\n var array1 = string1.split('.');\n\n var string2 = path.replace(string1, '');\n\n if (path.includes(string3)) {\n\n var array2 = string2.split(string3 + '.');\n\n console.log('array2 ' + array2);\n\n string2 = array2[0].slice('.', -1);\n\n array2 = array2[1].split('.');\n\n array1.push(string2, string3);\n\n array1 = array1.concat(array2);\n } else {\n array1.push(string2);\n }\n\n return array1.filter(Boolean);\n }\n}\n\nfunction isEmpty(obj) {\n for (var prop in obj) {\n\n if (obj.hasOwnProperty(prop)) {\n return false;\n }\n }\n\n return (0, _stringify2.default)(obj) === (0, _stringify2.default)({});\n}\n\nfunction chatkeysToStringCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n dataObjectSessionKeysClone[field].sessionKey = sessionKeys[field].sessionKey.toString();\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToStringCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction chatkeysToArrayCloner(sessionKeys) {\n var dataObjectSessionKeysClone = {};\n var fields = (0, _keys2.default)(sessionKeys);\n if (fields) {\n try {\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n dataObjectSessionKeysClone[field] = {};\n var arrayValues = JSON.parse('[' + sessionKeys[field].sessionKey + ']');\n dataObjectSessionKeysClone[field].sessionKey = new Uint8Array(arrayValues);\n dataObjectSessionKeysClone[field].isToEncrypt = sessionKeys[field].isToEncrypt;\n }\n } catch (err) {\n console.error('_chatkeysToArrayCloner:err', err);\n }\n }\n return dataObjectSessionKeysClone;\n}\n\nfunction parseMessageURL(URL) {\n var splitedToURL = URL.split('/');\n if (splitedToURL.length <= 6) {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3];\n } else {\n return splitedToURL[0] + '//' + splitedToURL[2] + '/' + splitedToURL[3] + '/' + splitedToURL[4];\n }\n}\n\nfunction availableSpace(usage, quota) {\n var available = (usage / quota).toFixed(2);\n return {\n quota: quota,\n usage: usage,\n percent: Number(available)\n };\n}\n\n/**\n* Encodes a JS object to base 64 encode\n* @param {Object} value byteArray value\n* @return {string} encoded value\n*/\nfunction encode(value) {\n try {\n var stringValue = stringify(value);\n return btoa(stringValue);\n } catch (err) {\n console.error('[Utils.encode:err] ' + err);\n throw err;\n }\n}\n\n/**\n * Decode a base64 string to object\n * @param {string_b64} value value encoded in base 64\n * @return {Object} decodedValue\n */\nfunction decode(value) {\n try {\n return JSON.parse(atob(value));\n } catch (err) {\n console.log('[Utils.decode:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Decode a base64 string to Uint8Array\n* @param {string_b64} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction decodeToUint8Array(value) {\n try {\n return new Uint8Array(decode(value));\n } catch (err) {\n console.error('[Utils.decodeToUint8Array:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a JS object to string\n* NOTE: Special conversion for Uint8Arrays\n* @param {Object} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction stringify(value) {\n try {\n var stringValue = void 0;\n if (value.constructor === Uint8Array) {\n stringValue = '[' + value.toString() + ']'; // the [] is for JSON.parse compatibility\n } else {\n stringValue = (0, _stringify2.default)(value);\n }\n return stringValue;\n } catch (err) {\n console.error('[Utils.stringify:err] ' + err);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Object} encoded value\n*/\nfunction parse(value) {\n try {\n return JSON.parse(value);\n } catch (err) {\n console.error('[Utils.parse:err]' + err);\n console.trace();\n console.error('That that cause the error:', value);\n throw err;\n }\n}\n\n/**\n* Converts a stringified object to object\n* @param {String} value byteArray value\n* @return {Uint8Array} encoded value\n*/\nfunction parseToUint8Array(value) {\n try {\n return new Uint8Array(parse(value));\n } catch (err) {\n console.error('[Utils.parseToUint8Array:err]' + err);\n throw err;\n }\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNi5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy9zcmMvdXRpbHMvdXRpbHMuanM/YmU3MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjBcbipc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UNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///6\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNy5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2dsb2JhbC5qcz8zYjMyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS96bG9pcm9jay9jb3JlLWpzL2lzc3Vlcy84NiNpc3N1ZWNvbW1lbnQtMTE1NzU5MDI4XG52YXIgZ2xvYmFsID0gbW9kdWxlLmV4cG9ydHMgPSB0eXBlb2Ygd2luZG93ICE9ICd1bmRlZmluZWQnICYmIHdpbmRvdy5NYXRoID09IE1hdGhcbiAgPyB3aW5kb3cgOiB0eXBlb2Ygc2VsZiAhPSAndW5kZWZpbmVkJyAmJiBzZWxmLk1hdGggPT0gTWF0aCA/IHNlbGZcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLW5ldy1mdW5jXG4gIDogRnVuY3Rpb24oJ3JldHVybiB0aGlzJykoKTtcbmlmICh0eXBlb2YgX19nID09ICdudW1iZXInKSBfX2cgPSBnbG9iYWw7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZ2xvYmFsLmpzXG4vLyBtb2R1bGUgaWQgPSA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///7\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOC5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZhaWxzLmpzP2NlMDIiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mYWlscy5qc1xuLy8gbW9kdWxlIGlkID0gOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOS5qcyIsInNvdXJjZXMiOlsid2VicGFjazovLy8uL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2lzLW9iamVjdC5qcz81MGEzIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiB0eXBlb2YgaXQgPT09ICdvYmplY3QnID8gaXQgIT09IG51bGwgOiB0eXBlb2YgaXQgPT09ICdmdW5jdGlvbic7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///9\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(83)('wks');\nvar uid = __webpack_require__(53);\nvar Symbol = __webpack_require__(7).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL193a3MuanM/OTI0MCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgc3RvcmUgPSByZXF1aXJlKCcuL19zaGFyZWQnKSgnd2tzJyk7XG52YXIgdWlkID0gcmVxdWlyZSgnLi9fdWlkJyk7XG52YXIgU3ltYm9sID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuU3ltYm9sO1xudmFyIFVTRV9TWU1CT0wgPSB0eXBlb2YgU3ltYm9sID09ICdmdW5jdGlvbic7XG5cbnZhciAkZXhwb3J0cyA9IG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgcmV0dXJuIHN0b3JlW25hbWVdIHx8IChzdG9yZVtuYW1lXSA9XG4gICAgVVNFX1NZTUJPTCAmJiBTeW1ib2xbbmFtZV0gfHwgKFVTRV9TWU1CT0wgPyBTeW1ib2wgOiB1aWQpKCdTeW1ib2wuJyArIG5hbWUpKTtcbn07XG5cbiRleHBvcnRzLnN0b3JlID0gc3RvcmU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3drcy5qc1xuLy8gbW9kdWxlIGlkID0gMTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///10\n")},function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvcmUuanM/MTVlMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29yZSA9IG1vZHVsZS5leHBvcnRzID0geyB2ZXJzaW9uOiAnMi41LjcnIH07XG5pZiAodHlwZW9mIF9fZSA9PSAnbnVtYmVyJykgX19lID0gY29yZTsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bmRlZlxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvcmUuanNcbi8vIG1vZHVsZSBpZCA9IDExXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///11\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(8)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qcz82ZDRhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIFRoYW5rJ3MgSUU4IGZvciBoaXMgZnVubnkgZGVmaW5lUHJvcGVydHlcbm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHt9LCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gMTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///12\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(5);\nvar IE8_DOM_DEFINE = __webpack_require__(155);\nvar toPrimitive = __webpack_require__(36);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(12) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanM/OTQzMiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBkUCA9IE9iamVjdC5kZWZpbmVQcm9wZXJ0eTtcblxuZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0eSA6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KE8sIFAsIEF0dHJpYnV0ZXMpIHtcbiAgYW5PYmplY3QoTyk7XG4gIFAgPSB0b1ByaW1pdGl2ZShQLCB0cnVlKTtcbiAgYW5PYmplY3QoQXR0cmlidXRlcyk7XG4gIGlmIChJRThfRE9NX0RFRklORSkgdHJ5IHtcbiAgICByZXR1cm4gZFAoTywgUCwgQXR0cmlidXRlcyk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoJ2dldCcgaW4gQXR0cmlidXRlcyB8fCAnc2V0JyBpbiBBdHRyaWJ1dGVzKSB0aHJvdyBUeXBlRXJyb3IoJ0FjY2Vzc29ycyBub3Qgc3VwcG9ydGVkIScpO1xuICBpZiAoJ3ZhbHVlJyBpbiBBdHRyaWJ1dGVzKSBPW1BdID0gQXR0cmlidXRlcy52YWx1ZTtcbiAgcmV0dXJuIE87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZHAuanNcbi8vIG1vZHVsZSBpZCA9IDEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///13\n")},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(38);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1sZW5ndGguanM/MDViYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMTUgVG9MZW5ndGhcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXQgPiAwID8gbWluKHRvSW50ZWdlcihpdCksIDB4MWZmZmZmZmZmZmZmZmYpIDogMDsgLy8gcG93KDIsIDUzKSAtIDEgPT0gOTAwNzE5OTI1NDc0MDk5MVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8tbGVuZ3RoLmpzXG4vLyBtb2R1bGUgaWQgPSAxNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///14\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(469), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzPzY3MWUiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtcHJvdG90eXBlLW9mXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAxNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///15\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(429), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzPzdkOTgiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9rZXlzXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAxNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///16\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (self, call) {\n if (!self) {\n throw new ReferenceError("this hasn\'t been initialised - super() hasn\'t been called");\n }\n\n return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3Bvc3NpYmxlQ29uc3RydWN0b3JSZXR1cm4uanM/Y2YwYSJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuZXhwb3J0cy5fX2VzTW9kdWxlID0gdHJ1ZTtcblxudmFyIF90eXBlb2YyID0gcmVxdWlyZShcIi4uL2hlbHBlcnMvdHlwZW9mXCIpO1xuXG52YXIgX3R5cGVvZjMgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF90eXBlb2YyKTtcblxuZnVuY3Rpb24gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChvYmopIHsgcmV0dXJuIG9iaiAmJiBvYmouX19lc01vZHVsZSA/IG9iaiA6IHsgZGVmYXVsdDogb2JqIH07IH1cblxuZXhwb3J0cy5kZWZhdWx0ID0gZnVuY3Rpb24gKHNlbGYsIGNhbGwpIHtcbiAgaWYgKCFzZWxmKSB7XG4gICAgdGhyb3cgbmV3IFJlZmVyZW5jZUVycm9yKFwidGhpcyBoYXNuJ3QgYmVlbiBpbml0aWFsaXNlZCAtIHN1cGVyKCkgaGFzbid0IGJlZW4gY2FsbGVkXCIpO1xuICB9XG5cbiAgcmV0dXJuIGNhbGwgJiYgKCh0eXBlb2YgY2FsbCA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiAoMCwgX3R5cGVvZjMuZGVmYXVsdCkoY2FsbCkpID09PSBcIm9iamVjdFwiIHx8IHR5cGVvZiBjYWxsID09PSBcImZ1bmN0aW9uXCIpID8gY2FsbCA6IHNlbGY7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9wb3NzaWJsZUNvbnN0cnVjdG9yUmV0dXJuLmpzXG4vLyBtb2R1bGUgaWQgPSAxN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///17\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _setPrototypeOf = __webpack_require__(471);\n\nvar _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);\n\nvar _create = __webpack_require__(475);\n\nvar _create2 = _interopRequireDefault(_create);\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (subClass, superClass) {\n if (typeof superClass !== "function" && superClass !== null) {\n throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));\n }\n\n subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uI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vb3QiOiIifQ==\n//# sourceURL=webpack-internal:///18\n')},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(37);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1vYmplY3QuanM/MTZiYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMTMgVG9PYmplY3QoYXJndW1lbnQpXG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBPYmplY3QoZGVmaW5lZChpdCkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8tb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSAxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///19\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hLWZ1bmN0aW9uLmpzPzVkMjMiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKHR5cGVvZiBpdCAhPSAnZnVuY3Rpb24nKSB0aHJvdyBUeXBlRXJyb3IoaXQgKyAnIGlzIG5vdCBhIGZ1bmN0aW9uIScpO1xuICByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hLWZ1bmN0aW9uLmpzXG4vLyBtb2R1bGUgaWQgPSAyMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///20\n")},function(module,exports){eval("// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self\n // eslint-disable-next-line no-new-func\n : Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2dsb2JhbC5qcz9lY2FiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS96bG9pcm9jay9jb3JlLWpzL2lzc3Vlcy84NiNpc3N1ZWNvbW1lbnQtMTE1NzU5MDI4XG52YXIgZ2xvYmFsID0gbW9kdWxlLmV4cG9ydHMgPSB0eXBlb2Ygd2luZG93ICE9ICd1bmRlZmluZWQnICYmIHdpbmRvdy5NYXRoID09IE1hdGhcbiAgPyB3aW5kb3cgOiB0eXBlb2Ygc2VsZiAhPSAndW5kZWZpbmVkJyAmJiBzZWxmLk1hdGggPT0gTWF0aCA/IHNlbGZcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLW5ldy1mdW5jXG4gIDogRnVuY3Rpb24oJ3JldHVybiB0aGlzJykoKTtcbmlmICh0eXBlb2YgX19nID09ICdudW1iZXInKSBfX2cgPSBnbG9iYWw7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19nbG9iYWwuanNcbi8vIG1vZHVsZSBpZCA9IDIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///21\n")},function(module,exports,__webpack_require__){eval("var store = __webpack_require__(136)('wks');\nvar uid = __webpack_require__(98);\nvar Symbol = __webpack_require__(21).Symbol;\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] =\n USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy5qcz83NTJjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBzdG9yZSA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpKCd3a3MnKTtcbnZhciB1aWQgPSByZXF1aXJlKCcuL191aWQnKTtcbnZhciBTeW1ib2wgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5TeW1ib2w7XG52YXIgVVNFX1NZTUJPTCA9IHR5cGVvZiBTeW1ib2wgPT0gJ2Z1bmN0aW9uJztcblxudmFyICRleHBvcnRzID0gbW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAobmFtZSkge1xuICByZXR1cm4gc3RvcmVbbmFtZV0gfHwgKHN0b3JlW25hbWVdID1cbiAgICBVU0VfU1lNQk9MICYmIFN5bWJvbFtuYW1lXSB8fCAoVVNFX1NZTUJPTCA/IFN5bWJvbCA6IHVpZCkoJ1N5bWJvbC4nICsgbmFtZSkpO1xufTtcblxuJGV4cG9ydHMuc3RvcmUgPSBzdG9yZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MuanNcbi8vIG1vZHVsZSBpZCA9IDIyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///22\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(13);\nvar createDesc = __webpack_require__(52);\nmodule.exports = __webpack_require__(12) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzP2RhOWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIGRQLmYob2JqZWN0LCBrZXksIGNyZWF0ZURlc2MoMSwgdmFsdWUpKTtcbn0gOiBmdW5jdGlvbiAob2JqZWN0LCBrZXksIHZhbHVlKSB7XG4gIG9iamVjdFtrZXldID0gdmFsdWU7XG4gIHJldHVybiBvYmplY3Q7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oaWRlLmpzXG4vLyBtb2R1bGUgaWQgPSAyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///23\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar hide = __webpack_require__(23);\nvar has = __webpack_require__(27);\nvar SRC = __webpack_require__(53)('src');\nvar TO_STRING = 'toString';\nvar $toString = Function[TO_STRING];\nvar TPL = ('' + $toString).split(TO_STRING);\n\n__webpack_require__(32).inspectSource = function (it) {\n return $toString.call(it);\n};\n\n(module.exports = function (O, key, val, safe) {\n var isFunction = typeof val == 'function';\n if (isFunction) has(val, 'name') || hide(val, 'name', key);\n if (O[key] === val) return;\n if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));\n if (O === global) {\n O[key] = val;\n } else if (!safe) {\n delete O[key];\n hide(O, key, val);\n } else if (O[key]) {\n O[key] = val;\n } else {\n hide(O, key, val);\n }\n// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative\n})(Function.prototype, TO_STRING, function toString() {\n return typeof this == 'function' && this[SRC] || $toString.call(this);\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19yZWRlZmluZS5qcz80NzcwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFNSQyA9IHJlcXVpcmUoJy4vX3VpZCcpKCdzcmMnKTtcbnZhciBUT19TVFJJTkcgPSAndG9TdHJpbmcnO1xudmFyICR0b1N0cmluZyA9IEZ1bmN0aW9uW1RPX1NUUklOR107XG52YXIgVFBMID0gKCcnICsgJHRvU3RyaW5nKS5zcGxpdChUT19TVFJJTkcpO1xuXG5yZXF1aXJlKCcuL19jb3JlJykuaW5zcGVjdFNvdXJjZSA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gJHRvU3RyaW5nLmNhbGwoaXQpO1xufTtcblxuKG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKE8sIGtleSwgdmFsLCBzYWZlKSB7XG4gIHZhciBpc0Z1bmN0aW9uID0gdHlwZW9mIHZhbCA9PSAnZnVuY3Rpb24nO1xuICBpZiAoaXNGdW5jdGlvbikgaGFzKHZhbCwgJ25hbWUnKSB8fCBoaWRlKHZhbCwgJ25hbWUnLCBrZXkpO1xuICBpZiAoT1trZXldID09PSB2YWwpIHJldHVybjtcbiAgaWYgKGlzRnVuY3Rpb24pIGhhcyh2YWwsIFNSQykgfH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0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///24\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar fails = __webpack_require__(8);\nvar defined = __webpack_require__(37);\nvar quot = /\"/g;\n// B.2.3.2.1 CreateHTML(string, tag, attribute, value)\nvar createHTML = function (string, tag, attribute, value) {\n var S = String(defined(string));\n var p1 = '<' + tag;\n if (attribute !== '') p1 += ' ' + attribute + '=\"' + String(value).replace(quot, '"') + '\"';\n return p1 + '>' + S + '';\n};\nmodule.exports = function (NAME, exec) {\n var O = {};\n O[NAME] = exec(createHTML);\n $export($export.P + $export.F * fails(function () {\n var test = ''[NAME]('\"');\n return test !== test.toLowerCase() || test.split('\"').length > 3;\n }), 'String', O);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpbmctaHRtbC5qcz9jYjdkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG52YXIgcXVvdCA9IC9cIi9nO1xuLy8gQi4yLjMuMi4xIENyZWF0ZUhUTUwoc3RyaW5nLCB0YWcsIGF0dHJpYnV0ZSwgdmFsdWUpXG52YXIgY3JlYXRlSFRNTCA9IGZ1bmN0aW9uIChzdHJpbmcsIHRhZywgYXR0cmlidXRlLCB2YWx1ZSkge1xuICB2YXIgUyA9IFN0cmluZyhkZWZpbmVkKHN0cmluZykpO1xuICB2YXIgcDEgPSAnPCcgKyB0YWc7XG4gIGlmIChhdHRyaWJ1dGUgIT09ICcnKSBwMSArPSAnICcgKyBhdHRyaWJ1dGUgKyAnPVwiJyArIFN0cmluZyh2YWx1ZSkucmVwbGFjZShxdW90LCAnJnF1b3Q7JykgKyAnXCInO1xuICByZXR1cm4gcDEgKyAnPicgKyBTICsgJzwvJyArIHRhZyArICc+Jztcbn07XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChOQU1FLCBleGVjKSB7XG4gIHZhciBPID0ge307XG4gIE9bTkFNRV0gPSBleGVjKGNyZWF0ZUhUTUwpO1xuICAkZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIGZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgICB2YXIgdGVzdCA9ICcnW05BTUVdKCdcIicpO1xuICAgIHJldHVybiB0ZXN0ICE9PSB0ZXN0LnRvTG93ZXJDYXNlKCkgfHwgdGVzdC5zcGxpdCgnXCInKS5sZW5ndGggPiAzO1xuICB9KSwgJ1N0cmluZycsIE8pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWh0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///25\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar core = __webpack_require__(11);\nvar ctx = __webpack_require__(69);\nvar hide = __webpack_require__(63);\nvar has = __webpack_require__(62);\nvar PROTOTYPE = 'prototype';\n\nvar $export = function (type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function (C) {\n var F = function (a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0: return new C();\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library`\nmodule.exports = $export;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2R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xubW9kdWxlLmV4cG9ydHMgPSAkZXhwb3J0O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2V4cG9ydC5qc1xuLy8gbW9kdWxlIGlkID0gMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///26\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oYXMuanM/NTgxNyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGFzT3duUHJvcGVydHkgPSB7fS5oYXNPd25Qcm9wZXJ0eTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBrZXkpIHtcbiAgcmV0dXJuIGhhc093blByb3BlcnR5LmNhbGwoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19oYXMuanNcbi8vIG1vZHVsZSBpZCA9IDI3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///27\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(73);\nvar defined = __webpack_require__(37);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1pb2JqZWN0LmpzPzNjN2EiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gdG8gaW5kZXhlZCBvYmplY3QsIHRvT2JqZWN0IHdpdGggZmFsbGJhY2sgZm9yIG5vbi1hcnJheS1saWtlIEVTMyBzdHJpbmdzXG52YXIgSU9iamVjdCA9IHJlcXVpcmUoJy4vX2lvYmplY3QnKTtcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIElPYmplY3QoZGVmaW5lZChpdCkpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8taW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gMjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///28\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(74);\nvar createDesc = __webpack_require__(52);\nvar toIObject = __webpack_require__(28);\nvar toPrimitive = __webpack_require__(36);\nvar has = __webpack_require__(27);\nvar IE8_DOM_DEFINE = __webpack_require__(155);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(12) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qcz9jN2RjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgZ09QRCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBnT1BEIDogZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIFApIHtcbiAgTyA9IHRvSU9iamVjdChPKTtcbiAgUCA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGdPUEQoTywgUCk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoaGFzKE8sIFApKSByZXR1cm4gY3JlYXRlRGVzYyghcElFLmYuY2FsbChPLCBQKSwgT1tQXSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wZC5qc1xuLy8gbW9kdWxlIGlkID0gMjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///29\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(27);\nvar toObject = __webpack_require__(19);\nvar IE_PROTO = __webpack_require__(108)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ3BvLmpzPzI4ZWEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjkgLyAxNS4yLjMuMiBPYmplY3QuZ2V0UHJvdG90eXBlT2YoTylcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElFX1BST1RPID0gcmVxdWlyZSgnLi9fc2hhcmVkLWtleScpKCdJRV9QUk9UTycpO1xudmFyIE9iamVjdFByb3RvID0gT2JqZWN0LnByb3RvdHlwZTtcblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuZ2V0UHJvdG90eXBlT2YgfHwgZnVuY3Rpb24gKE8pIHtcbiAgTyA9IHRvT2JqZWN0KE8pO1xuICBpZiAoaGFzKE8sIElFX1BST1RPKSkgcmV0dXJuIE9bSUVfUFJPVE9dO1xuICBpZiAodHlwZW9mIE8uY29uc3RydWN0b3IgPT0gJ2Z1bmN0aW9uJyAmJiBPIGluc3RhbmNlb2YgTy5jb25zdHJ1Y3Rvcikge1xuICAgIHJldHVybiBPLmNvbnN0cnVjdG9yLnByb3RvdHlwZTtcbiAgfSByZXR1cm4gTyBpbnN0YW5jZW9mIE9iamVjdCA/IE9iamVjdFByb3RvIDogbnVsbDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1ncG8uanNcbi8vIG1vZHVsZSBpZCA9IDMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///30\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(481), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzPzlhZjEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5XCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSAzMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///31\n')},function(module,exports){eval("var core = module.exports = { version: '2.5.7' };\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb3JlLmpzP2VlMDUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGNvcmUgPSBtb2R1bGUuZXhwb3J0cyA9IHsgdmVyc2lvbjogJzIuNS43JyB9O1xuaWYgKHR5cGVvZiBfX2UgPT0gJ251bWJlcicpIF9fZSA9IGNvcmU7IC8vIGVzbGludC1kaXNhYmxlLWxpbmUgbm8tdW5kZWZcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29yZS5qc1xuLy8gbW9kdWxlIGlkID0gMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///32\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(20);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jdHguanM/YWM1YyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBvcHRpb25hbCAvIHNpbXBsZSBjb250ZXh0IGJpbmRpbmdcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChmbiwgdGhhdCwgbGVuZ3RoKSB7XG4gIGFGdW5jdGlvbihmbik7XG4gIGlmICh0aGF0ID09PSB1bmRlZmluZWQpIHJldHVybiBmbjtcbiAgc3dpdGNoIChsZW5ndGgpIHtcbiAgICBjYXNlIDE6IHJldHVybiBmdW5jdGlvbiAoYSkge1xuICAgICAgcmV0dXJuIGZuLmNhbGwodGhhdCwgYSk7XG4gICAgfTtcbiAgICBjYXNlIDI6IHJldHVybiBmdW5jdGlvbiAoYSwgYikge1xuICAgICAgcmV0dXJuIGZuLmNhbGwodGhhdCwgYSwgYik7XG4gICAgfTtcbiAgICBjYXNlIDM6IHJldHVybiBmdW5jdGlvbiAoYSwgYiwgYykge1xuICAgICAgcmV0dXJuIGZuLmNhbGwodGhhdCwgYSwgYiwgYyk7XG4gICAgfTtcbiAgfVxuICByZXR1cm4gZnVuY3Rpb24gKC8qIC4uLmFyZ3MgKi8pIHtcbiAgICByZXR1cm4gZm4uYXBwbHkodGhhdCwgYXJndW1lbnRzKTtcbiAgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2N0eC5qc1xuLy8gbW9kdWxlIGlkID0gMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///33\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb2YuanM/YzlkMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9TdHJpbmcgPSB7fS50b1N0cmluZztcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIHRvU3RyaW5nLmNhbGwoaXQpLnNsaWNlKDgsIC0xKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2NvZi5qc1xuLy8gbW9kdWxlIGlkID0gMzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///34\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar fails = __webpack_require__(8);\n\nmodule.exports = function (method, arg) {\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call\n arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpY3QtbWV0aG9kLmpzPzM0ZGEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAobWV0aG9kLCBhcmcpIHtcbiAgcmV0dXJuICEhbWV0aG9kICYmIGZhaWxzKGZ1bmN0aW9uICgpIHtcbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdXNlbGVzcy1jYWxsXG4gICAgYXJnID8gbWV0aG9kLmNhbGwobnVsbCwgZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9LCAxKSA6IG1ldGhvZC5jYWxsKG51bGwpO1xuICB9KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3N0cmljdC1tZXRob2QuanNcbi8vIG1vZHVsZSBpZCA9IDM1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///35\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(9);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1wcmltaXRpdmUuanM/YjM4OCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3Lj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wIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///36\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kZWZpbmVkLmpzP2ZmMDgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjEgUmVxdWlyZU9iamVjdENvZXJjaWJsZShhcmd1bWVudClcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIGlmIChpdCA9PSB1bmRlZmluZWQpIHRocm93IFR5cGVFcnJvcihcIkNhbid0IGNhbGwgbWV0aG9kIG9uICBcIiArIGl0KTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGVmaW5lZC5qc1xuLy8gbW9kdWxlIGlkID0gMzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///37\n')},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1pbnRlZ2VyLmpzP2ExZTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4xLjQgVG9JbnRlZ2VyXG52YXIgY2VpbCA9IE1hdGguY2VpbDtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXNOYU4oaXQgPSAraXQpID8gMCA6IChpdCA+IDAgPyBmbG9vciA6IGNlaWwpKGl0KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3RvLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDM4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///38\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(0);\nvar core = __webpack_require__(32);\nvar fails = __webpack_require__(8);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3Qtc2FwLmpzP2RlMmUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gbW9zdCBPYmplY3QgbWV0aG9kcyBieSBFUzYgc2hvdWxkIGFjY2VwdCBwcmltaXRpdmVzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZLCBleGVjKSB7XG4gIHZhciBmbiA9IChjb3JlLk9iamVjdCB8fCB7fSlbS0VZXSB8fCBPYmplY3RbS0VZXTtcbiAgdmFyIGV4cCA9IHt9O1xuICBleHBbS0VZXSA9IGV4ZWMoZm4pO1xuICAkZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIGZhaWxzKGZ1bmN0aW9uICgpIHsgZm4oMSk7IH0pLCAnT2JqZWN0JywgZXhwKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1zYXAuanNcbi8vIG1vZHVsZSBpZCA9IDM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///39\n")},function(module,exports,__webpack_require__){eval("// 0 -> Array#forEach\n// 1 -> Array#map\n// 2 -> Array#filter\n// 3 -> Array#some\n// 4 -> Array#every\n// 5 -> Array#find\n// 6 -> Array#findIndex\nvar ctx = __webpack_require__(33);\nvar IObject = __webpack_require__(73);\nvar toObject = __webpack_require__(19);\nvar toLength = __webpack_require__(14);\nvar asc = __webpack_require__(125);\nmodule.exports = function (TYPE, $create) {\n var IS_MAP = TYPE == 1;\n var IS_FILTER = TYPE == 2;\n var IS_SOME = TYPE == 3;\n var IS_EVERY = TYPE == 4;\n var IS_FIND_INDEX = TYPE == 6;\n var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;\n var create = $create || asc;\n return function ($this, callbackfn, that) {\n var O = toObject($this);\n var self = IObject(O);\n var f = ctx(callbackfn, that, 3);\n var length = toLength(self.length);\n var index = 0;\n var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;\n var val, res;\n for (;length > index; index++) if (NO_HOLES || index in self) {\n val = self[index];\n res = f(val, index, O);\n if (TYPE) {\n if (IS_MAP) result[index] = res; // map\n else if (res) switch (TYPE) {\n case 3: return true; // some\n case 5: return val; // find\n case 6: return index; // findIndex\n case 2: result.push(val); // filter\n } else if (IS_EVERY) return false; // every\n }\n }\n return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1tZXRob2RzLmpzPzJlMTQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMCAtPiBBcnJheSNmb3JFYWNoXG4vLyAxIC0+IEFycmF5I21hcFxuLy8gMiAtPiBBcnJheSNmaWx0ZXJcbi8vIDMgLT4gQXJyYXkjc29tZVxuLy8gNCAtPiBBcnJheSNldmVyeVxuLy8gNSAtPiBBcnJheSNmaW5kXG4vLyA2IC0+IEFycmF5I2ZpbmRJbmRleFxudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgdG9PYmplY3QgPSByZX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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///40\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(46);\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLW9iamVjdC5qcz9lZmIzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKCFpc09iamVjdChpdCkpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGFuIG9iamVjdCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1vYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDQxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///41\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(450), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL29iamVjdC9hc3NpZ24uanM/YzI4MyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2Fzc2lnblwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA0MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///42\n')},function(module,exports,__webpack_require__){"use strict";eval("\nif (__webpack_require__(12)) {\n var LIBRARY = __webpack_require__(48);\n var global = __webpack_require__(7);\n var fails = __webpack_require__(8);\n var $export = __webpack_require__(0);\n var $typed = __webpack_require__(94);\n var $buffer = __webpack_require__(131);\n var ctx = __webpack_require__(33);\n var anInstance = __webpack_require__(59);\n var propertyDesc = __webpack_require__(52);\n var hide = __webpack_require__(23);\n var redefineAll = __webpack_require__(61);\n var toInteger = __webpack_require__(38);\n var toLength = __webpack_require__(14);\n var toIndex = __webpack_require__(181);\n var toAbsoluteIndex = __webpack_require__(55);\n var toPrimitive = __webpack_require__(36);\n var has = __webpack_require__(27);\n var classof = __webpack_require__(75);\n var isObject = __webpack_require__(9);\n var toObject = __webpack_require__(19);\n var isArrayIter = __webpack_require__(122);\n var create = __webpack_require__(56);\n var getPrototypeOf = __webpack_require__(30);\n var gOPN = __webpack_require__(57).f;\n var getIterFn = __webpack_require__(124);\n var uid = __webpack_require__(53);\n var wks = __webpack_require__(10);\n var createArrayMethod = __webpack_require__(40);\n var createArrayIncludes = __webpack_require__(84);\n var speciesConstructor = __webpack_require__(91);\n var ArrayIterators = __webpack_require__(127);\n var Iterators = __webpack_require__(66);\n var $iterDetect = __webpack_require__(88);\n var setSpecies = __webpack_require__(58);\n var arrayFill = __webpack_require__(126);\n var arrayCopyWithin = __webpack_require__(171);\n var $DP = __webpack_require__(13);\n var $GOPD = __webpack_require__(29);\n var dP = $DP.f;\n var gOPD = $GOPD.f;\n var RangeError = global.RangeError;\n var TypeError = global.TypeError;\n var Uint8Array = global.Uint8Array;\n var ARRAY_BUFFER = 'ArrayBuffer';\n var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;\n var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';\n var PROTOTYPE = 'prototype';\n var ArrayProto = Array[PROTOTYPE];\n var $ArrayBuffer = $buffer.ArrayBuffer;\n var $DataView = $buffer.DataView;\n var arrayForEach = createArrayMethod(0);\n var arrayFilter = createArrayMethod(2);\n var arraySome = createArrayMethod(3);\n var arrayEvery = createArrayMethod(4);\n var arrayFind = createArrayMethod(5);\n var arrayFindIndex = createArrayMethod(6);\n var arrayIncludes = createArrayIncludes(true);\n var arrayIndexOf = createArrayIncludes(false);\n var arrayValues = ArrayIterators.values;\n var arrayKeys = ArrayIterators.keys;\n var arrayEntries = ArrayIterators.entries;\n var arrayLastIndexOf = ArrayProto.lastIndexOf;\n var arrayReduce = ArrayProto.reduce;\n var arrayReduceRight = ArrayProto.reduceRight;\n var arrayJoin = ArrayProto.join;\n var arraySort = ArrayProto.sort;\n var arraySlice = ArrayProto.slice;\n var arrayToString = ArrayProto.toString;\n var arrayToLocaleString = ArrayProto.toLocaleString;\n var ITERATOR = wks('iterator');\n var TAG = wks('toStringTag');\n var TYPED_CONSTRUCTOR = uid('typed_constructor');\n var DEF_CONSTRUCTOR = uid('def_constructor');\n var ALL_CONSTRUCTORS = $typed.CONSTR;\n var TYPED_ARRAY = $typed.TYPED;\n var VIEW = $typed.VIEW;\n var WRONG_LENGTH = 'Wrong length!';\n\n var $map = createArrayMethod(1, function (O, length) {\n return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);\n });\n\n var LITTLE_ENDIAN = fails(function () {\n // eslint-disable-next-line no-undef\n return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;\n });\n\n var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {\n new Uint8Array(1).set({});\n });\n\n var toOffset = function (it, BYTES) {\n var offset = toInteger(it);\n if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');\n return offset;\n };\n\n var validate = function (it) {\n if (isObject(it) && TYPED_ARRAY in it) return it;\n throw TypeError(it + ' is not a typed array!');\n };\n\n var allocate = function (C, length) {\n if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {\n throw TypeError('It is not a typed array constructor!');\n } return new C(length);\n };\n\n var speciesFromList = function (O, list) {\n return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);\n };\n\n var fromList = function (C, list) {\n var index = 0;\n var length = list.length;\n var result = allocate(C, length);\n while (length > index) result[index] = list[index++];\n return result;\n };\n\n var addGetter = function (it, key, internal) {\n dP(it, key, { get: function () { return this._d[internal]; } });\n };\n\n var $from = function from(source /* , mapfn, thisArg */) {\n var O = toObject(source);\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var iterFn = getIterFn(O);\n var i, length, values, result, step, iterator;\n if (iterFn != undefined && !isArrayIter(iterFn)) {\n for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {\n values.push(step.value);\n } O = values;\n }\n if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);\n for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {\n result[i] = mapping ? mapfn(O[i], i) : O[i];\n }\n return result;\n };\n\n var $of = function of(/* ...items */) {\n var index = 0;\n var length = arguments.length;\n var result = allocate(this, length);\n while (length > index) result[index] = arguments[index++];\n return result;\n };\n\n // iOS Safari 6.x fails here\n var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });\n\n var $toLocaleString = function toLocaleString() {\n return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);\n };\n\n var proto = {\n copyWithin: function copyWithin(target, start /* , end */) {\n return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);\n },\n every: function every(callbackfn /* , thisArg */) {\n return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars\n return arrayFill.apply(validate(this), arguments);\n },\n filter: function filter(callbackfn /* , thisArg */) {\n return speciesFromList(this, arrayFilter(validate(this), callbackfn,\n arguments.length > 1 ? arguments[1] : undefined));\n },\n find: function find(predicate /* , thisArg */) {\n return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n findIndex: function findIndex(predicate /* , thisArg */) {\n return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);\n },\n forEach: function forEach(callbackfn /* , thisArg */) {\n arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n indexOf: function indexOf(searchElement /* , fromIndex */) {\n return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n includes: function includes(searchElement /* , fromIndex */) {\n return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);\n },\n join: function join(separator) { // eslint-disable-line no-unused-vars\n return arrayJoin.apply(validate(this), arguments);\n },\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars\n return arrayLastIndexOf.apply(validate(this), arguments);\n },\n map: function map(mapfn /* , thisArg */) {\n return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduce.apply(validate(this), arguments);\n },\n reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars\n return arrayReduceRight.apply(validate(this), arguments);\n },\n reverse: function reverse() {\n var that = this;\n var length = validate(that).length;\n var middle = Math.floor(length / 2);\n var index = 0;\n var value;\n while (index < middle) {\n value = that[index];\n that[index++] = that[--length];\n that[length] = value;\n } return that;\n },\n some: function some(callbackfn /* , thisArg */) {\n return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n },\n sort: function sort(comparefn) {\n return arraySort.call(validate(this), comparefn);\n },\n subarray: function subarray(begin, end) {\n var O = validate(this);\n var length = O.length;\n var $begin = toAbsoluteIndex(begin, length);\n return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(\n O.buffer,\n O.byteOffset + $begin * O.BYTES_PER_ELEMENT,\n toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)\n );\n }\n };\n\n var $slice = function slice(start, end) {\n return speciesFromList(this, arraySlice.call(validate(this), start, end));\n };\n\n var $set = function set(arrayLike /* , offset */) {\n validate(this);\n var offset = toOffset(arguments[1], 1);\n var length = this.length;\n var src = toObject(arrayLike);\n var len = toLength(src.length);\n var index = 0;\n if (len + offset > length) throw RangeError(WRONG_LENGTH);\n while (index < len) this[offset + index] = src[index++];\n };\n\n var $iterators = {\n entries: function entries() {\n return arrayEntries.call(validate(this));\n },\n keys: function keys() {\n return arrayKeys.call(validate(this));\n },\n values: function values() {\n return arrayValues.call(validate(this));\n }\n };\n\n var isTAIndex = function (target, key) {\n return isObject(target)\n && target[TYPED_ARRAY]\n && typeof key != 'symbol'\n && key in target\n && String(+key) == String(key);\n };\n var $getDesc = function getOwnPropertyDescriptor(target, key) {\n return isTAIndex(target, key = toPrimitive(key, true))\n ? propertyDesc(2, target[key])\n : gOPD(target, key);\n };\n var $setDesc = function defineProperty(target, key, desc) {\n if (isTAIndex(target, key = toPrimitive(key, true))\n && isObject(desc)\n && has(desc, 'value')\n && !has(desc, 'get')\n && !has(desc, 'set')\n // TODO: add validation descriptor w/o calling accessors\n && !desc.configurable\n && (!has(desc, 'writable') || desc.writable)\n && (!has(desc, 'enumerable') || desc.enumerable)\n ) {\n target[key] = desc.value;\n return target;\n } return dP(target, key, desc);\n };\n\n if (!ALL_CONSTRUCTORS) {\n $GOPD.f = $getDesc;\n $DP.f = $setDesc;\n }\n\n $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {\n getOwnPropertyDescriptor: $getDesc,\n defineProperty: $setDesc\n });\n\n if (fails(function () { arrayToString.call({}); })) {\n arrayToString = arrayToLocaleString = function toString() {\n return arrayJoin.call(this);\n };\n }\n\n var $TypedArrayPrototype$ = redefineAll({}, proto);\n redefineAll($TypedArrayPrototype$, $iterators);\n hide($TypedArrayPrototype$, ITERATOR, $iterators.values);\n redefineAll($TypedArrayPrototype$, {\n slice: $slice,\n set: $set,\n constructor: function () { /* noop */ },\n toString: arrayToString,\n toLocaleString: $toLocaleString\n });\n addGetter($TypedArrayPrototype$, 'buffer', 'b');\n addGetter($TypedArrayPrototype$, 'byteOffset', 'o');\n addGetter($TypedArrayPrototype$, 'byteLength', 'l');\n addGetter($TypedArrayPrototype$, 'length', 'e');\n dP($TypedArrayPrototype$, TAG, {\n get: function () { return this[TYPED_ARRAY]; }\n });\n\n // eslint-disable-next-line max-statements\n module.exports = function (KEY, BYTES, wrapper, CLAMPED) {\n CLAMPED = !!CLAMPED;\n var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';\n var GETTER = 'get' + KEY;\n var SETTER = 'set' + KEY;\n var TypedArray = global[NAME];\n var Base = TypedArray || {};\n var TAC = TypedArray && getPrototypeOf(TypedArray);\n var FORCED = !TypedArray || !$typed.ABV;\n var O = {};\n var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];\n var getter = function (that, index) {\n var data = that._d;\n return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);\n };\n var setter = function (that, index, value) {\n var data = that._d;\n if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;\n data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);\n };\n var addElement = function (that, index) {\n dP(that, index, {\n get: function () {\n return getter(this, index);\n },\n set: function (value) {\n return setter(this, index, value);\n },\n enumerable: true\n });\n };\n if (FORCED) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME, '_d');\n var index = 0;\n var offset = 0;\n var buffer, byteLength, length, klass;\n if (!isObject(data)) {\n length = toIndex(data);\n byteLength = length * BYTES;\n buffer = new $ArrayBuffer(byteLength);\n } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n buffer = data;\n offset = toOffset($offset, BYTES);\n var $len = data.byteLength;\n if ($length === undefined) {\n if ($len % BYTES) throw RangeError(WRONG_LENGTH);\n byteLength = $len - offset;\n if (byteLength < 0) throw RangeError(WRONG_LENGTH);\n } else {\n byteLength = toLength($length) * BYTES;\n if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);\n }\n length = byteLength / BYTES;\n } else if (TYPED_ARRAY in data) {\n return fromList(TypedArray, data);\n } else {\n return $from.call(TypedArray, data);\n }\n hide(that, '_d', {\n b: buffer,\n o: offset,\n l: byteLength,\n e: length,\n v: new $DataView(buffer)\n });\n while (index < length) addElement(that, index++);\n });\n TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);\n hide(TypedArrayPrototype, 'constructor', TypedArray);\n } else if (!fails(function () {\n TypedArray(1);\n }) || !fails(function () {\n new TypedArray(-1); // eslint-disable-line no-new\n }) || !$iterDetect(function (iter) {\n new TypedArray(); // eslint-disable-line no-new\n new TypedArray(null); // eslint-disable-line no-new\n new TypedArray(1.5); // eslint-disable-line no-new\n new TypedArray(iter); // eslint-disable-line no-new\n }, true)) {\n TypedArray = wrapper(function (that, data, $offset, $length) {\n anInstance(that, TypedArray, NAME);\n var klass;\n // `ws` module bug, temporarily remove validation length for Uint8Array\n // https://github.com/websockets/ws/pull/645\n if (!isObject(data)) return new Base(toIndex(data));\n if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {\n return $length !== undefined\n ? new Base(data, toOffset($offset, BYTES), $length)\n : $offset !== undefined\n ? new Base(data, toOffset($offset, BYTES))\n : new Base(data);\n }\n if (TYPED_ARRAY in data) return fromList(TypedArray, data);\n return $from.call(TypedArray, data);\n });\n arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {\n if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);\n });\n TypedArray[PROTOTYPE] = TypedArrayPrototype;\n if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;\n }\n var $nativeIterator = TypedArrayPrototype[ITERATOR];\n var CORRECT_ITER_NAME = !!$nativeIterator\n && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);\n var $iterator = $iterators.values;\n hide(TypedArray, TYPED_CONSTRUCTOR, true);\n hide(TypedArrayPrototype, TYPED_ARRAY, NAME);\n hide(TypedArrayPrototype, VIEW, true);\n hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);\n\n if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {\n dP(TypedArrayPrototype, TAG, {\n get: function () { return NAME; }\n });\n }\n\n O[NAME] = TypedArray;\n\n $export($export.G + $export.W + $export.F * (TypedArray != Base), O);\n\n $export($export.S, NAME, {\n BYTES_PER_ELEMENT: BYTES\n });\n\n $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {\n from: $from,\n of: $of\n });\n\n if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);\n\n $export($export.P, NAME, proto);\n\n setSpecies(NAME);\n\n $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });\n\n $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);\n\n if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;\n\n $export($export.P + $export.F * fails(function () {\n new TypedArray(1).slice();\n }), NAME, { slice: $slice });\n\n $export($export.P + $export.F * (fails(function () {\n return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();\n }) || !fails(function () {\n TypedArrayPrototype.toLocaleString.call([1, 2]);\n })), NAME, { toLocaleString: $toLocaleString });\n\n Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;\n if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);\n };\n} else module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190eXBlZC1hcnJheS5qcz9lZmI1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbmlmIChyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpKSB7XG4gIHZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xuICB2YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG4gIHZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG4gIHZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4gIHZhciAkdHlwZWQgPSByZXF1aXJlKCcuL190eXBlZCcpO1xuICB2YXIgJGJ1ZmZlciA9IHJlcXVpcmUoJy4vX3R5cGVkLWJ1ZmZlcicpO1xuICB2YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jy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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///43\n")},function(module,exports,__webpack_require__){eval("var Map = __webpack_require__(176);\nvar $export = __webpack_require__(0);\nvar shared = __webpack_require__(83)('metadata');\nvar store = shared.store || (shared.store = new (__webpack_require__(179))());\n\nvar getOrCreateMetadataMap = function (target, targetKey, create) {\n var targetMetadata = store.get(target);\n if (!targetMetadata) {\n if (!create) return undefined;\n store.set(target, targetMetadata = new Map());\n }\n var keyMetadata = targetMetadata.get(targetKey);\n if (!keyMetadata) {\n if (!create) return undefined;\n targetMetadata.set(targetKey, keyMetadata = new Map());\n } return keyMetadata;\n};\nvar ordinaryHasOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? false : metadataMap.has(MetadataKey);\n};\nvar ordinaryGetOwnMetadata = function (MetadataKey, O, P) {\n var metadataMap = getOrCreateMetadataMap(O, P, false);\n return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);\n};\nvar ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {\n getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);\n};\nvar ordinaryOwnMetadataKeys = function (target, targetKey) {\n var metadataMap = getOrCreateMetadataMap(target, targetKey, false);\n var keys = [];\n if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });\n return keys;\n};\nvar toMetaKey = function (it) {\n return it === undefined || typeof it == 'symbol' ? it : String(it);\n};\nvar exp = function (O) {\n $export($export.S, 'Reflect', O);\n};\n\nmodule.exports = {\n store: store,\n map: getOrCreateMetadataMap,\n has: ordinaryHasOwnMetadata,\n get: ordinaryGetOwnMetadata,\n set: ordinaryDefineOwnMetadata,\n keys: ordinaryOwnMetadataKeys,\n key: toMetaKey,\n exp: exp\n};\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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///44\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(41);\nvar IE8_DOM_DEFINE = __webpack_require__(191);\nvar toPrimitive = __webpack_require__(140);\nvar dP = Object.defineProperty;\n\nexports.f = __webpack_require__(51) ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) { /* empty */ }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcC5qcz83YWYwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIElFOF9ET01fREVGSU5FID0gcmVxdWlyZSgnLi9faWU4LWRvbS1kZWZpbmUnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIGRQID0gT2JqZWN0LmRlZmluZVByb3BlcnR5O1xuXG5leHBvcnRzLmYgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gT2JqZWN0LmRlZmluZVByb3BlcnR5IDogZnVuY3Rpb24gZGVmaW5lUHJvcGVydHkoTywgUCwgQXR0cmlidXRlcykge1xuICBhbk9iamVjdChPKTtcbiAgUCA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICBhbk9iamVjdChBdHRyaWJ1dGVzKTtcbiAgaWYgKElFOF9ET01fREVGSU5FKSB0cnkge1xuICAgIHJldHVybiBkUChPLCBQLCBBdHRyaWJ1dGVzKTtcbiAgfSBjYXRjaCAoZSkgeyAvKiBlbXB0eSAqLyB9XG4gIGlmICgnZ2V0JyBpbiBBdHRyaWJ1dGVzIHx8ICdzZXQnIGluIEF0dHJpYnV0ZXMpIHRocm93IFR5cGVFcnJvcignQWNjZXNzb3JzIG5vdCBzdXBwb3J0ZWQhJyk7XG4gIGlmICgndmFsdWUnIGluIEF0dHJpYnV0ZXMpIE9bUF0gPSBBdHRyaWJ1dGVzLnZhbHVlO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWRwLmpzXG4vLyBtb2R1bGUgaWQgPSA0NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///45\n")},function(module,exports){eval("module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLW9iamVjdC5qcz8xMmE4Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiB0eXBlb2YgaXQgPT09ICdvYmplY3QnID8gaXQgIT09IG51bGwgOiB0eXBlb2YgaXQgPT09ICdmdW5jdGlvbic7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///46\n")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(53)('meta');\nvar isObject = __webpack_require__(9);\nvar has = __webpack_require__(27);\nvar setDesc = __webpack_require__(13).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(8)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tZXRhLmpzP2Q1YTAiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIE1FVEEgPSByZXF1aXJlKCcuL191aWQnKSgnbWV0YScpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgc2V0RGVzYyA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaWQgPSAwO1xudmFyIGlzRXh0ZW5zaWJsZSA9IE9iamVjdC5pc0V4dGVuc2libGUgfHwgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gdHJ1ZTtcbn07XG52YXIgRlJFRVpFID0gIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gaXNFeHRlbnNpYmxlKE9iamVjdC5wcmV2ZW50RXh0ZW5zaW9ucyh7fSkpO1xufSk7XG52YXIgc2V0TWV0YSA9IGZ1bmN0aW9uIChpdCkge1xuICBzZXREZXNjKGl0LCBNRVRBLCB7IHZhbHVlOiB7XG4gICAgaTogJ08nICsgKytpZCwgLy8gb2JqZWN0IElEXG4gICAgdzoge30gICAgICAgICAgLy8gd2VhayBjb2xsZWN0aW9ucyBJRHNcbiAgfSB9KTtcbn07XG52YXIgZmFzdEtleSA9IGZ1bmN0aW9uIChpdCwgY3JlYXRlKSB7XG4gIC8vIHJldHVybiBwcmltaXRpdmUgd2l0aCBwcmVmaXhcbiAgaWYgKCFpc09iamVjdChpdCkpIHJldHVybiB0eXBlb2YgaXQgPT0gJ3N5bWJ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CkgJiYgIWhhcyhpdCwgTUVUQSkpIHNldE1ldGEoaXQpO1xuICByZXR1cm4gaXQ7XG59O1xudmFyIG1ldGEgPSBtb2R1bGUuZXhwb3J0cyA9IHtcbiAgS0VZOiBNRVRBLFxuICBORUVEOiBmYWxzZSxcbiAgZmFzdEtleTogZmFzdEtleSxcbiAgZ2V0V2VhazogZ2V0V2VhayxcbiAgb25GcmVlemU6IG9uRnJlZXplXG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tZXRhLmpzXG4vLyBtb2R1bGUgaWQgPSA0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///47\n")},function(module,exports){eval("module.exports = false;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19saWJyYXJ5LmpzPzU3NzkiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmYWxzZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///48\n")},function(module,exports,__webpack_require__){eval("// 22.1.3.31 Array.prototype[@@unscopables]\nvar UNSCOPABLES = __webpack_require__(10)('unscopables');\nvar ArrayProto = Array.prototype;\nif (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(23)(ArrayProto, UNSCOPABLES, {});\nmodule.exports = function (key) {\n ArrayProto[UNSCOPABLES][key] = true;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanM/NDYxMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjMuMzEgQXJyYXkucHJvdG90eXBlW0BAdW5zY29wYWJsZXNdXG52YXIgVU5TQ09QQUJMRVMgPSByZXF1aXJlKCcuL193a3MnKSgndW5zY29wYWJsZXMnKTtcbnZhciBBcnJheVByb3RvID0gQXJyYXkucHJvdG90eXBlO1xuaWYgKEFycmF5UHJvdG9bVU5TQ09QQUJMRVNdID09IHVuZGVmaW5lZCkgcmVxdWlyZSgnLi9faGlkZScpKEFycmF5UHJvdG8sIFVOU0NPUEFCTEVTLCB7fSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgQXJyYXlQcm90b1tVTlNDT1BBQkxFU11ba2V5XSA9IHRydWU7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanNcbi8vIG1vZHVsZSBpZCA9IDQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///49\n")},function(module,exports,__webpack_require__){eval("// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = __webpack_require__(190);\nvar defined = __webpack_require__(132);\nmodule.exports = function (it) {\n return IObject(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanM/NGRjNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyB0byBpbmRleGVkIG9iamVjdCwgdG9PYmplY3Qgd2l0aCBmYWxsYmFjayBmb3Igbm9uLWFycmF5LWxpa2UgRVMzIHN0cmluZ3NcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gSU9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWlvYmplY3QuanNcbi8vIG1vZHVsZSBpZCA9IDUwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///50\n")},function(module,exports,__webpack_require__){eval("// Thank's IE8 for his funny defineProperty\nmodule.exports = !__webpack_require__(70)(function () {\n return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2Rlc2NyaXB0b3JzLmpzP2Y4NGQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gVGhhbmsncyBJRTggZm9yIGhpcyBmdW5ueSBkZWZpbmVQcm9wZXJ0eVxubW9kdWxlLmV4cG9ydHMgPSAhcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBPYmplY3QuZGVmaW5lUHJvcGVydHkoe30sICdhJywgeyBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIDc7IH0gfSkuYSAhPSA3O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZGVzY3JpcHRvcnMuanNcbi8vIG1vZHVsZSBpZCA9IDUxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///51\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wcm9wZXJ0eS1kZXNjLmpzPzdkNGQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoYml0bWFwLCB2YWx1ZSkge1xuICByZXR1cm4ge1xuICAgIGVudW1lcmFibGU6ICEoYml0bWFwICYgMSksXG4gICAgY29uZmlndXJhYmxlOiAhKGJpdG1hcCAmIDIpLFxuICAgIHdyaXRhYmxlOiAhKGJpdG1hcCAmIDQpLFxuICAgIHZhbHVlOiB2YWx1ZVxuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvcGVydHktZGVzYy5qc1xuLy8gbW9kdWxlIGlkID0gNTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///52\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL191aWQuanM/YmE1NCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaWQgPSAwO1xudmFyIHB4ID0gTWF0aC5yYW5kb20oKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSkge1xuICByZXR1cm4gJ1N5bWJvbCgnLmNvbmNhdChrZXkgPT09IHVuZGVmaW5lZCA/ICcnIDoga2V5LCAnKV8nLCAoKytpZCArIHB4KS50b1N0cmluZygzNikpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdWlkLmpzXG4vLyBtb2R1bGUgaWQgPSA1M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///53\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(157);\nvar enumBugKeys = __webpack_require__(109);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3Qta2V5cy5qcz80MjFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCAvIDE1LjIuMy4xNCBPYmplY3Qua2V5cyhPKVxudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMtaW50ZXJuYWwnKTtcbnZhciBlbnVtQnVnS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3Qua2V5cyB8fCBmdW5jdGlvbiBrZXlzKE8pIHtcbiAgcmV0dXJuICRrZXlzKE8sIGVudW1CdWdLZXlzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA1NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///54\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(38);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1hYnNvbHV0ZS1pbmRleC5qcz9jZThmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWF4ID0gTWF0aC5tYXg7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpbmRleCwgbGVuZ3RoKSB7XG4gIGluZGV4ID0gdG9JbnRlZ2VyKGluZGV4KTtcbiAgcmV0dXJuIGluZGV4IDwgMCA/IG1heChpbmRleCArIGxlbmd0aCwgMCkgOiBtaW4oaW5kZXgsIGxlbmd0aCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1hYnNvbHV0ZS1pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gNTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///55\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(5);\nvar dPs = __webpack_require__(158);\nvar enumBugKeys = __webpack_require__(109);\nvar IE_PROTO = __webpack_require__(108)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(106)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(110).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtY3JlYXRlLmpzP2VmMjkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjIgLyAxNS4yLjMuNSBPYmplY3QuY3JlYXRlKE8gWywgUHJvcGVydGllc10pXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBkUHMgPSByZXF1aXJlKCcuL19vYmplY3QtZHBzJyk7XG52YXIgZW51bUJ1Z0tleXMgPSByZXF1aXJlKCcuL19lbnVtLWJ1Zy1rZXlzJyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgRW1wdHkgPSBmdW5jdGlvbiAoKSB7IC8qIGVtcHR5ICovIH07XG52YXIgUFJPVE9UWVBFID0gJ3Byb3RvdHlwZSc7XG5cbi8vIENyZWF0ZSBvYmplY3Qgd2l0aCBmYWtlIGBudWxsYCBwcm90b3R5cGU6IHVzZSBpZnJhbWUgT2JqZWN0IHdpdGggY2xlYXJlZCBwcm90b3R5cGVcbnZhciBjcmVhdGVEaWN0ID0gZnVuY3Rpb24gKCkge1xuICAvLyBUaHJhc2gsIHdhc3RlIGFuZCBzb2RvbXk6IElFIEdDIGJ1Z1xuICB2YXIgaWZyYW1lID0gcmVxdWlyZSgnLi9fZG9tLWNyZWF0ZScpKCdpZnJhbWUnKTtcbiAgdmFyIGkgPSBlbnVtQnVnS2V5cy5sZW5ndGg7XG4gIHZhciBsdCA9ICc8JztcbiAgdmFyIGd0ID0gJz4nO1xuICB2YXIgaWZyYW1lRG9jdW1lbnQ7XG4gIGlmcmFtZS5zdHls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dFtJRV9QUk9UT10gPSBPO1xuICB9IGVsc2UgcmVzdWx0ID0gY3JlYXRlRGljdCgpO1xuICByZXR1cm4gUHJvcGVydGllcyA9PT0gdW5kZWZpbmVkID8gcmVzdWx0IDogZFBzKHJlc3VsdCwgUHJvcGVydGllcyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSA1NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///56\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(157);\nvar hiddenKeys = __webpack_require__(109).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wbi5qcz81OWMzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi43IC8gMTUuMi4zLjQgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMoTylcbnZhciAka2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzLWludGVybmFsJyk7XG52YXIgaGlkZGVuS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKS5jb25jYXQoJ2xlbmd0aCcsICdwcm90b3R5cGUnKTtcblxuZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMgfHwgZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlOYW1lcyhPKSB7XG4gIHJldHVybiAka2V5cyhPLCBoaWRkZW5LZXlzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1nb3BuLmpzXG4vLyBtb2R1bGUgaWQgPSA1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///57\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar dP = __webpack_require__(13);\nvar DESCRIPTORS = __webpack_require__(12);\nvar SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function (KEY) {\n var C = global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtc3BlY2llcy5qcz8wODQ5Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBTUEVDSUVTID0gcmVxdWlyZSgnLi9fd2tzJykoJ3NwZWNpZXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZKSB7XG4gIHZhciBDID0gZ2xvYmFsW0tFWV07XG4gIGlmIChERVNDUklQVE9SUyAmJiBDICYmICFDW1NQRUNJRVNdKSBkUC5mKEMsIFNQRUNJRVMsIHtcbiAgICBjb25maWd1cmFibGU6IHRydWUsXG4gICAgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9XG4gIH0pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2V0LXNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///58\n")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hbi1pbnN0YW5jZS5qcz9mNDZhIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBDb25zdHJ1Y3RvciwgbmFtZSwgZm9yYmlkZGVuRmllbGQpIHtcbiAgaWYgKCEoaXQgaW5zdGFuY2VvZiBDb25zdHJ1Y3RvcikgfHwgKGZvcmJpZGRlbkZpZWxkICE9PSB1bmRlZmluZWQgJiYgZm9yYmlkZGVuRmllbGQgaW4gaXQpKSB7XG4gICAgdGhyb3cgVHlwZUVycm9yKG5hbWUgKyAnOiBpbmNvcnJlY3QgaW52b2NhdGlvbiEnKTtcbiAgfSByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hbi1pbnN0YW5jZS5qc1xuLy8gbW9kdWxlIGlkID0gNTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///59\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(33);\nvar call = __webpack_require__(169);\nvar isArrayIter = __webpack_require__(122);\nvar anObject = __webpack_require__(5);\nvar toLength = __webpack_require__(14);\nvar getIterFn = __webpack_require__(124);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mb3Itb2YuanM/YmU2NCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgY2FsbCA9IHJlcXVpcmUoJy4vX2l0ZXItY2FsbCcpO1xudmFyIGlzQXJyYXlJdGVyID0gcmVxdWlyZSgnLi9faXMtYXJyYXktaXRlcicpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBnZXRJdGVyRm4gPSByZXF1aXJlKCcuL2NvcmUuZ2V0LWl0ZXJhdG9yLW1ldGhvZCcpO1xudmFyIEJSRUFLID0ge307XG52YXIgUkVUVVJOID0ge307XG52YXIgZXhwb3J0cyA9IG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0ZXJhYmxlLCBlbnRyaWVzLCBmbiwgdGhhdCwgSVRFUkFUT1IpIHtcbiAgdmFyIGl0ZXJGbiA9IElURVJBVE9SID8gZnVuY3Rpb24gKCkgeyByZXR1cm4gaXRlcmFibGU7IH0gOiBnZXRJdGVyRm4oaXRlcmFibGUpO1xuICB2YXIgZiA9IGN0eChmbiwg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y9tb2R1bGVzL19mb3Itb2YuanNcbi8vIG1vZHVsZSBpZCA9IDYwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///60\n")},function(module,exports,__webpack_require__){eval("var redefine = __webpack_require__(24);\nmodule.exports = function (target, src, safe) {\n for (var key in src) redefine(target, key, src[key], safe);\n return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19yZWRlZmluZS1hbGwuanM/MDM1ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGFyZ2V0LCBzcmMsIHNhZmUpIHtcbiAgZm9yICh2YXIga2V5IGluIHNyYykgcmVkZWZpbmUodGFyZ2V0LCBrZXksIHNyY1trZXldLCBzYWZlKTtcbiAgcmV0dXJuIHRhcmdldDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3JlZGVmaW5lLWFsbC5qc1xuLy8gbW9kdWxlIGlkID0gNjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///61\n")},function(module,exports){eval("var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hhcy5qcz8wZjYyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXNPd25Qcm9wZXJ0eSA9IHt9Lmhhc093blByb3BlcnR5O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQsIGtleSkge1xuICByZXR1cm4gaGFzT3duUHJvcGVydHkuY2FsbChpdCwga2V5KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGFzLmpzXG4vLyBtb2R1bGUgaWQgPSA2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///62\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(45);\nvar createDesc = __webpack_require__(79);\nmodule.exports = __webpack_require__(51) ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2hpZGUuanM/ODQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKTtcbnZhciBjcmVhdGVEZXNjID0gcmVxdWlyZSgnLi9fcHJvcGVydHktZGVzYycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gZnVuY3Rpb24gKG9iamVjdCwga2V5LCB2YWx1ZSkge1xuICByZXR1cm4gZFAuZihvYmplY3QsIGtleSwgY3JlYXRlRGVzYygxLCB2YWx1ZSkpO1xufSA6IGZ1bmN0aW9uIChvYmplY3QsIGtleSwgdmFsdWUpIHtcbiAgb2JqZWN0W2tleV0gPSB2YWx1ZTtcbiAgcmV0dXJuIG9iamVjdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faGlkZS5qc1xuLy8gbW9kdWxlIGlkID0gNjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///63\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(13).f;\nvar has = __webpack_require__(27);\nvar TAG = __webpack_require__(10)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtdG8tc3RyaW5nLXRhZy5qcz9jOThiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkZWYgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFRBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgdGFnLCBzdGF0KSB7XG4gIGlmIChpdCAmJiAhaGFzKGl0ID0gc3RhdCA/IGl0IDogaXQucHJvdG90eXBlLCBUQUcpKSBkZWYoaXQsIFRBRywgeyBjb25maWd1cmFibGU6IHRydWUsIHZhbHVlOiB0YWcgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtdG8tc3RyaW5nLXRhZy5qc1xuLy8gbW9kdWxlIGlkID0gNjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///64\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar defined = __webpack_require__(37);\nvar fails = __webpack_require__(8);\nvar spaces = __webpack_require__(112);\nvar space = '[' + spaces + ']';\nvar non = '\\u200b\\u0085';\nvar ltrim = RegExp('^' + space + space + '*');\nvar rtrim = RegExp(space + space + '*$');\n\nvar exporter = function (KEY, exec, ALIAS) {\n var exp = {};\n var FORCE = fails(function () {\n return !!spaces[KEY]() || non[KEY]() != non;\n });\n var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];\n if (ALIAS) exp[ALIAS] = fn;\n $export($export.P + $export.F * FORCE, 'String', exp);\n};\n\n// 1 -> String#trimLeft\n// 2 -> String#trimRight\n// 3 -> String#trim\nvar trim = exporter.trim = function (string, TYPE) {\n string = String(defined(string));\n if (TYPE & 1) string = string.replace(ltrim, '');\n if (TYPE & 2) string = string.replace(rtrim, '');\n return string;\n};\n\nmodule.exports = exporter;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpbmctdHJpbS5qcz82MjY3Il0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG52YXIgc3BhY2VzID0gcmVxdWlyZSgnLi9fc3RyaW5nLXdzJyk7XG52YXIgc3BhY2UgPSAnWycgKyBzcGFjZXMgKyAnXSc7XG52YXIgbm9uID0gJ1xcdTIwMGJcXHUwMDg1JztcbnZhciBsdHJpbSA9IFJlZ0V4cCgnXicgKyBzcGFjZSArIHNwYWNlICsgJyonKTtcbnZhciBydHJpbSA9IFJlZ0V4cChzcGFjZSArIHNwYWNlICsgJyokJyk7XG5cbnZhciBleHBvcnRlciA9IGZ1bmN0aW9uIChLRVksIGV4ZWMsIEFMSUFTKSB7XG4gIHZhciBleHAgPSB7fTtcbiAgdmFyIEZPUkNFID0gZmFpbHMoZnVuY3Rpb24gKCkge1xuICAgIHJldHVybiAhIXNwYWNlc1tLRVldKCkgfHwgbm9uW0tFWV0oKSAhPSBub247XG4gIH0pO1xuICB2YXIgZm4gPSBleHBbS0VZXSA9IEZPUkNFID8gZXhlYyh0cmltKSA6IHNwYWNlc1tLRVld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data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyYXRvcnMuanM/NmNkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHt9O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyYXRvcnMuanNcbi8vIG1vZHVsZSBpZCA9IDY2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///66\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nmodule.exports = function (it, TYPE) {\n if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL192YWxpZGF0ZS1jb2xsZWN0aW9uLmpzP2NlYWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgVFlQRSkge1xuICBpZiAoIWlzT2JqZWN0KGl0KSB8fCBpdC5fdCAhPT0gVFlQRSkgdGhyb3cgVHlwZUVycm9yKCdJbmNvbXBhdGlibGUgcmVjZWl2ZXIsICcgKyBUWVBFICsgJyByZXF1aXJlZCEnKTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdmFsaWRhdGUtY29sbGVjdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///67\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = __webpack_require__(189);\nvar enumBugKeys = __webpack_require__(137);\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLmpzPzk2NGIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjE0IC8gMTUuMi4zLjE0IE9iamVjdC5rZXlzKE8pXG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cy1pbnRlcm5hbCcpO1xudmFyIGVudW1CdWdLZXlzID0gcmVxdWlyZSgnLi9fZW51bS1idWcta2V5cycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IE9iamVjdC5rZXlzIHx8IGZ1bmN0aW9uIGtleXMoTykge1xuICByZXR1cm4gJGtleXMoTywgZW51bUJ1Z0tleXMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///68\n")},function(module,exports,__webpack_require__){eval("// optional / simple context binding\nvar aFunction = __webpack_require__(99);\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n switch (length) {\n case 1: return function (a) {\n return fn.call(that, a);\n };\n case 2: return function (a, b) {\n return fn.call(that, a, b);\n };\n case 3: return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n return function (/* ...args */) {\n return fn.apply(that, arguments);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2N0eC5qcz9mOTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIG9wdGlvbmFsIC8gc2ltcGxlIGNvbnRleHQgYmluZGluZ1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCB0aGF0LCBsZW5ndGgpIHtcbiAgYUZ1bmN0aW9uKGZuKTtcbiAgaWYgKHRoYXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIGZuO1xuICBzd2l0Y2ggKGxlbmd0aCkge1xuICAgIGNhc2UgMTogcmV0dXJuIGZ1bmN0aW9uIChhKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhKTtcbiAgICB9O1xuICAgIGNhc2UgMjogcmV0dXJuIGZ1bmN0aW9uIChhLCBiKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiKTtcbiAgICB9O1xuICAgIGNhc2UgMzogcmV0dXJuIGZ1bmN0aW9uIChhLCBiLCBjKSB7XG4gICAgICByZXR1cm4gZm4uY2FsbCh0aGF0LCBhLCBiLCBjKTtcbiAgICB9O1xuICB9XG4gIHJldHVybiBmdW5jdGlvbiAoLyogLi4uYXJncyAqLykge1xuICAgIHJldHVybiBmbi5hcHBseSh0aGF0LCBhcmd1bWVudHMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jdHguanNcbi8vIG1vZHVsZSBpZCA9IDY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///69\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzPzRiY2QiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiAhIWV4ZWMoKTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB0cnVlO1xuICB9XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2ZhaWxzLmpzXG4vLyBtb2R1bGUgaWQgPSA3MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///70\n")},function(module,exports){eval("module.exports = {};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2l0ZXJhdG9ycy5qcz9mZGI0Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0ge307XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlcmF0b3JzLmpzXG4vLyBtb2R1bGUgaWQgPSA3MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///71\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DataObjectSourceLanguage = exports.CatalogueObjectType = undefined;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _RethinkObject2 = __webpack_require__(559);\n\nvar _RethinkObject3 = _interopRequireDefault(_RethinkObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author alice.cheambe[at]fokus.fraunhofer.de\n * The CatalogueDataObject class is the representation of the reTHINK Catalogue Data Model\n */\nvar CatalogueDataObject = function (_RethinkObject) {\n (0, _inherits3.default)(CatalogueDataObject, _RethinkObject);\n\n /**\n * Creates the Catalogue Data Object\n * @param guid - Global Unique identifier of the Catalogue Object (e.g. Hyperty descriptor, ProtocolStub descriptor,\n * etc) enabling the same object to be stored and discovered in different Catalogues. That means, guid corresponds to\n * [resource-type-id] per BNF of Resource Path. Couldn't we have problems with too long URL paths?\n * @param type - indicates the type of Catalogue Data Object e.g. Hyperty, ProtocolStub, etc\n * @param {string} version - Indicates the version of Catalogue Data\n * @param objectName - human-understandable name of the catalogue object e.g. \"My Awesome Hyperty\"\n * @param description - description of the source package\n * @param language - the programming language used in the SourcePackage.SourceCode\n * @param sourcePackageURL - A string containing the URL from where the source code package of the corresponding\n * catalogue object, e.g. deployable packages containing executable code for Hyperties or ProtoStubs, can be downloaded\n */\n function CatalogueDataObject(guid, type, version, objectName, description, language, sourcePackageURL) {\n (0, _classCallCheck3.default)(this, CatalogueDataObject);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (CatalogueDataObject.__proto__ || (0, _getPrototypeOf2.default)(CatalogueDataObject)).call(this));\n\n _this._guid = guid;\n _this._type = type;\n _this._version = version;\n _this._objectName = objectName;\n _this._description = description;\n _this._language = language;\n _this._sourcePackageURL = sourcePackageURL;\n\n _this._signature = null;\n _this._sourcePackage = null;\n return _this;\n }\n\n // Getters\n\n\n (0, _createClass3.default)(CatalogueDataObject, [{\n key: 'guid',\n get: function get() {\n return this._guid;\n },\n set: function set(guid) {\n if (guid) this._guid = guid;\n }\n }, {\n key: 'type',\n get: function get() {\n return this._type;\n },\n set: function set(type) {\n if (type) this._type = type;\n }\n }, {\n key: 'version',\n get: function get() {\n return this._version;\n },\n set: function set(version) {\n if (version) {\n this._version = version;\n }\n }\n }, {\n key: 'objectName',\n get: function get() {\n return this._objectName;\n },\n set: function set(objectName) {\n if (objectName) this._objectName = objectName;\n }\n }, {\n key: 'description',\n get: function get() {\n return this._description;\n },\n set: function set(description) {\n if (description) this._description = description;\n }\n }, {\n key: 'language',\n get: function get() {\n return this._language;\n },\n set: function set(language) {\n if (language) this._language = language;\n }\n }, {\n key: 'signature',\n get: function get() {\n return this._signature;\n },\n\n\n // Setters\n /**\n * Set the signature to enables integrity and authenticity verification\n * @param signature\n */\n set: function set(signature) {\n if (signature) this._signature = signature;\n }\n }, {\n key: 'sourcePackage',\n get: function get() {\n return this._sourcePackage;\n },\n set: function set(sourcePackage) {\n if (sourcePackage) this._sourcePackage = sourcePackage;\n }\n }, {\n key: 'sourcePackageURL',\n get: function get() {\n return this._sourcePackageURL;\n },\n set: function set(sourcePackageURL) {\n if (sourcePackageURL) this._sourcePackageURL = sourcePackageURL;\n }\n }]);\n return CatalogueDataObject;\n}(_RethinkObject3.default);\n//Alice: removed POLICY_ENFORCER: 'policy_enforcer', DATA_SCHEMA: 'data_schema' from the list\n//wrt: https://github.com/reTHINK-project/dev-service-framework/blob/develop/docs/datamodel/core/hyperty-catalogue/readme.md#data-object-schema\n/**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nvar CatalogueObjectType = exports.CatalogueObjectType = {\n HYPERTY: 'hyperty', PROTOSTUB: 'protostub', HYPERTY_RUNTIME: 'hyperty_runtime',\n HYPERTY_INTERCEPTOR: 'hyperty_inspector', HYPERTY_DATA_OBJECT: 'hyperty_data_object'\n};\nvar DataObjectSourceLanguage = exports.DataObjectSourceLanguage = {\n JAVASCRIPT_ECMA6: 'javascript_ecma6', JAVASCRIPT_ECMA5: 'javascript_ecma5',\n JSON_SCHEMA_V4: 'json_schema_v4', PYTHON: 'python', TYPESCRIPT: 'typescript'\n};\nexports.default = CatalogueDataObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vc3JjL3J1bnRpbWUtY2F0YWxvZ3VlL0NhdGFsb2d1ZURhdGFPYmplY3QuanM/ZTViNiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuICogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiAqIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuICogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSI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ozs7QUFtSkE7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBO0FBQ0E7QUFGQTtBQUlBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///72\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(34);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pb2JqZWN0LmpzPzQzYTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsbGJhY2sgZm9yIG5vbi1hcnJheS1saWtlIEVTMyBhbmQgbm9uLWVudW1lcmFibGUgb2xkIFY4IHN0cmluZ3NcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wcm90b3R5cGUtYnVpbHRpbnNcbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0KCd6JykucHJvcGVydHlJc0VudW1lcmFibGUoMCkgPyBPYmplY3QgOiBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGNvZihpdCkgPT0gJ1N0cmluZycgPyBpdC5zcGxpdCgnJykgOiBPYmplY3QoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///73\n")},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtcGllLmpzPzYzNTYiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0ge30ucHJvcGVydHlJc0VudW1lcmFibGU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1waWUuanNcbi8vIG1vZHVsZSBpZCA9IDc0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///74\n")},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(34);\nvar TAG = __webpack_require__(10)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIj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dGlvbicgPyAnQXJndW1lbnRzJyA6IEI7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jbGFzc29mLmpzXG4vLyBtb2R1bGUgaWQgPSA3NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///75\n")},function(module,exports,__webpack_require__){eval("// 7.1.13 ToObject(argument)\nvar defined = __webpack_require__(132);\nmodule.exports = function (it) {\n return Object(defined(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qcz9iMDFkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMS4xMyBUb09iamVjdChhcmd1bWVudClcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIE9iamVjdChkZWZpbmVkKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLW9iamVjdC5qc1xuLy8gbW9kdWxlIGlkID0gNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///76\n")},function(module,exports){eval("var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2NvZi5qcz80N2QzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b1N0cmluZyA9IHt9LnRvU3RyaW5nO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gdG9TdHJpbmcuY2FsbChpdCkuc2xpY2UoOCwgLTEpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jb2YuanNcbi8vIG1vZHVsZSBpZCA9IDc3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///77\n")},function(module,exports){eval("module.exports = true;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2xpYnJhcnkuanM/M2I4OCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHRydWU7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fbGlicmFyeS5qc1xuLy8gbW9kdWxlIGlkID0gNzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///78\n")},function(module,exports){eval("module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanM/NWZjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChiaXRtYXAsIHZhbHVlKSB7XG4gIHJldHVybiB7XG4gICAgZW51bWVyYWJsZTogIShiaXRtYXAgJiAxKSxcbiAgICBjb25maWd1cmFibGU6ICEoYml0bWFwICYgMiksXG4gICAgd3JpdGFibGU6ICEoYml0bWFwICYgNCksXG4gICAgdmFsdWU6IHZhbHVlXG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb3BlcnR5LWRlc2MuanNcbi8vIG1vZHVsZSBpZCA9IDc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///79\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(434)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(193)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qcz9jZDA0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuLy8gMjEuMS4zLjI3IFN0cmluZy5wcm90b3R5cGVbQEBpdGVyYXRvcl0oKVxucmVxdWlyZSgnLi9faXRlci1kZWZpbmUnKShTdHJpbmcsICdTdHJpbmcnLCBmdW5jdGlvbiAoaXRlcmF0ZWQpIHtcbiAgdGhpcy5fdCA9IFN0cmluZyhpdGVyYXRlZCk7IC8vIHRhcmdldFxuICB0aGlzLl9pID0gMDsgICAgICAgICAgICAgICAgLy8gbmV4dCBpbmRleFxuLy8gMjEuMS41LjIuMSAlU3RyaW5nSXRlcmF0b3JQcm90b3R5cGUlLm5leHQoKVxufSwgZnVuY3Rpb24gKCkge1xuICB2YXIgTyA9IHRoaXMuX3Q7XG4gIHZhciBpbmRleCA9IHRoaXMuX2k7XG4gIHZhciBwb2ludDtcbiAgaWYgKGluZGV4ID49IE8ubGVuZ3RoKSByZXR1cm4geyB2YWx1ZTogdW5kZWZpbmVkLCBkb25lOiB0cnVlIH07XG4gIHBvaW50ID0gJGF0KE8sIGluZGV4KTtcbiAgdGhpcy5faSArPSBwb2ludC5sZW5ndGg7XG4gIHJldHVybiB7IHZhbHVlOiBwb2ludCwgZG9uZTogZmFsc2UgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gODBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///80\n")},function(module,exports){eval("exports.f = {}.propertyIsEnumerable;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1waWUuanM/MzY5MiJdLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnRzLmYgPSB7fS5wcm9wZXJ0eUlzRW51bWVyYWJsZTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtcGllLmpzXG4vLyBtb2R1bGUgaWQgPSA4MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///81\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _iterator = __webpack_require__(457);\n\nvar _iterator2 = _interopRequireDefault(_iterator);\n\nvar _symbol = __webpack_require__(459);\n\nvar _symbol2 = _interopRequireDefault(_symbol);\n\nvar _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {\n return typeof obj === "undefined" ? "undefined" : _typeof(obj);\n} : function (obj) {\n return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9oZWxwZXJzL3R5cGVvZi5qcz9hNDU2Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2l0ZXJhdG9yID0gcmVxdWlyZShcIi4uL2NvcmUtanMvc3ltYm9sL2l0ZXJhdG9yXCIpO1xuXG52YXIgX2l0ZXJhdG9yMiA9IF9pbnRlcm9wUmVxdWlyZURlZmF1bHQoX2l0ZXJhdG9y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iYgb2JqLmNvbnN0cnVjdG9yID09PSBfc3ltYm9sMi5kZWZhdWx0ICYmIG9iaiAhPT0gX3N5bWJvbDIuZGVmYXVsdC5wcm90b3R5cGUgPyBcInN5bWJvbFwiIDogdHlwZW9mIG9iaiA9PT0gXCJ1bmRlZmluZWRcIiA/IFwidW5kZWZpbmVkXCIgOiBfdHlwZW9mKG9iaik7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90eXBlb2YuanNcbi8vIG1vZHVsZSBpZCA9IDgyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///82\n')},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(32);\nvar global = __webpack_require__(7);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(48) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zaGFyZWQuanM/NTU2OCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBTSEFSRUQgPSAnX19jb3JlLWpzX3NoYXJlZF9fJztcbnZhciBzdG9yZSA9IGdsb2JhbFtTSEFSRURdIHx8IChnbG9iYWxbU0hBUkVEXSA9IHt9KTtcblxuKG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIHN0b3JlW2tleV0gfHwgKHN0b3JlW2tleV0gPSB2YWx1ZSAhPT0gdW5kZWZpbmVkID8gdmFsdWUgOiB7fSk7XG59KSgndmVyc2lvbnMnLCBbXSkucHVzaCh7XG4gIHZlcnNpb246IGNvcmUudmVyc2lvbixcbiAgbW9kZTogcmVxdWlyZSgnLi9fbGlicmFyeScpID8gJ3B1cmUnIDogJ2dsb2JhbCcsXG4gIGNvcHlyaWdodDogJ8KpIDIwMTggRGVuaXMgUHVzaGthcmV2ICh6bG9pcm9jay5ydSknXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2hhcmVkLmpzXG4vLyBtb2R1bGUgaWQgPSA4M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///83\n")},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(28);\nvar toLength = __webpack_require__(14);\nvar toAbsoluteIndex = __webpack_require__(55);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1pbmNsdWRlcy5qcz9hMmRlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbHNlIC0+IEFycmF5I2luZGV4T2Zcbi8vIHRydWUgIC0+IEFycmF5I2luY2x1ZGVzXG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKElTX0lOQ0xVREVTKSB7XG4gIHJldHVybiBmdW5jdGlvbiAoJHRoaXMsIGVsLCBmcm9tSW5kZXgpIHtcbiAgICB2YXIgTyA9IHRvSU9iamVjdCgkdGhpcyk7XG4gICAgdmFyIGxlbmd0aCA9IHRvTGVuZ3RoKE8ubGVuZ3RoKTtcbiAgICB2YXIgaW5kZXggPSB0b0Fic29sdXRlSW5kZXgoZnJvbUluZGV4LCBsZW5ndGgpO1xuICAgIHZhciB2YWx1ZTtcbiAgICAvLyBBcnJheSNpbmNsdWRlcyB1c2VzIFNhbWVWYWx1ZVplcm8gZXF1YWxpdHkgYWxnb3JpdGhtXG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgIGlmIChJU19JTkNMVURFUyAmJiBlbCAhPSBlbCkgd2hpbGUgKGxlbmd0aCA+IGluZGV4KSB7XG4gICAgICB2YWx1ZSA9IE9baW5kZXgrK107XG4gICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gICAgICBpZiAodmFsdWUgIT0gdmFsdWUpIHJldHVybiB0cnVlO1xuICAgIC8vIEFycmF5I2luZGV4T2YgaWdub3JlcyBob2xlcywgQXJyYXkjaW5jbHVkZXMgLSBub3RcbiAgICB9IGVsc2UgZm9yICg7bGVuZ3RoID4gaW5kZXg7IGluZGV4KyspIGlmIChJU19JTkNMVURFUyB8fCBpbmRleCBpbiBPKSB7XG4gICAgICBpZiAoT1tpbmRleF0gPT09IGVsKSByZXR1cm4gSVNfSU5DTFVERVMgfHwgaW5kZXggfHwgMDtcbiAgICB9IHJldHVybiAhSVNfSU5DTFVERVMgJiYgLTE7XG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1pbmNsdWRlcy5qc1xuLy8gbW9kdWxlIGlkID0gODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///84\n")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZ29wcy5qcz82MzUzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMuZiA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1nb3BzLmpzXG4vLyBtb2R1bGUgaWQgPSA4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///85\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(34);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1hcnJheS5qcz81Y2VkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMi4yIElzQXJyYXkoYXJndW1lbnQpXG52YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gaXNBcnJheShhcmcpIHtcbiAgcmV0dXJuIGNvZihhcmcpID09ICdBcnJheSc7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///86\n")},function(module,exports,__webpack_require__){eval("// 7.2.8 IsRegExp(argument)\nvar isObject = __webpack_require__(9);\nvar cof = __webpack_require__(34);\nvar MATCH = __webpack_require__(10)('match');\nmodule.exports = function (it) {\n var isRegExp;\n return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1yZWdleHAuanM/YmI0MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjIuOCBJc1JlZ0V4cChhcmd1bWVudClcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xudmFyIE1BVENIID0gcmVxdWlyZSgnLi9fd2tzJykoJ21hdGNoJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICB2YXIgaXNSZWdFeHA7XG4gIHJldHVybiBpc09iamVjdChpdCkgJiYgKChpc1JlZ0V4cCA9IGl0W01BVENIXSkgIT09IHVuZGVmaW5lZCA/ICEhaXNSZWdFeHAgOiBjb2YoaXQpID09ICdSZWdFeHAnKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2lzLXJlZ2V4cC5qc1xuLy8gbW9kdWxlIGlkID0gODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///87\n")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(10)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyLWRldGVjdC5qcz9hYTRjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIFNBRkVfQ0xPU0lORyA9IGZhbHNlO1xuXG50cnkge1xuICB2YXIgcml0ZXIgPSBbN11bSVRFUkFUT1JdKCk7XG4gIHJpdGVyWydyZXR1cm4nXSA9IGZ1bmN0aW9uICgpIHsgU0FGRV9DTE9TSU5HID0gdHJ1ZTsgfTtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4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3 get RegExp.prototype.flags\nvar anObject = __webpack_require__(5);\nmodule.exports = function () {\n var that = anObject(this);\n var result = '';\n if (that.global) result += 'g';\n if (that.ignoreCase) result += 'i';\n if (that.multiline) result += 'm';\n if (that.unicode) result += 'u';\n if (that.sticky) result += 'y';\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mbGFncy5qcz9kMjkxIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIxLjIuNS4zIGdldCBSZWdFeHAucHJvdG90eXBlLmZsYWdzXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKCkge1xuICB2YXIgdGhhdCA9IGFuT2JqZWN0KHRoaXMpO1xuICB2YXIgcmVzdWx0ID0gJyc7XG4gIGlmICh0aGF0Lmdsb2JhbCkgcmVzdWx0ICs9ICdnJztcbiAgaWYgKHRoYXQuaWdub3JlQ2FzZSkgcmVzdWx0ICs9ICdpJztcbiAgaWYgKHRoYXQubXVsdGlsaW5lKSByZXN1bHQgKz0gJ20nO1xuICBpZiAodGhhdC51bmljb2RlKSByZXN1bHQgKz0gJ3UnO1xuICBpZiAodGhhdC5zdGlja3kpIHJlc3VsdCArPSAneSc7XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gODlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///89\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar hide = __webpack_require__(23);\nvar redefine = __webpack_require__(24);\nvar fails = __webpack_require__(8);\nvar defined = __webpack_require__(37);\nvar wks = __webpack_require__(10);\n\nmodule.exports = function (KEY, length, exec) {\n var SYMBOL = wks(KEY);\n var fns = exec(defined, SYMBOL, ''[KEY]);\n var strfn = fns[0];\n var rxfn = fns[1];\n if (fails(function () {\n var O = {};\n O[SYMBOL] = function () { return 7; };\n return ''[KEY](O) != 7;\n })) {\n redefine(String.prototype, KEY, strfn);\n hide(RegExp.prototype, SYMBOL, length == 2\n // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)\n // 21.2.5.11 RegExp.prototype[@@split](string, limit)\n ? function (string, arg) { return rxfn.call(string, this, arg); }\n // 21.2.5.6 RegExp.prototype[@@match](string)\n // 21.2.5.9 RegExp.prototype[@@search](string)\n : function (string) { return rxfn.call(string, this); }\n );\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTAuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19maXgtcmUtd2tzLmpzPzU2MGQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBkZWZpbmVkID0gcmVxdWlyZSgnLi9fZGVmaW5lZCcpO1xudmFyIHdrcyA9IHJlcXVpcm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Ly8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZpeC1yZS13a3MuanNcbi8vIG1vZHVsZSBpZCA9IDkwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///90\n")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(5);\nvar aFunction = __webpack_require__(20);\nvar SPECIES = __webpack_require__(10)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTEuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zcGVjaWVzLWNvbnN0cnVjdG9yLmpzP2VjZWQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4zLjIwIFNwZWNpZXNDb25zdHJ1Y3RvcihPLCBkZWZhdWx0Q29uc3RydWN0b3IpXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgU1BFQ0lFUyA9IHJlcXVpcmUoJy4vX3drcycpKCdzcGVjaWVzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChPLCBEKSB7XG4gIHZhciBDID0gYW5PYmplY3QoTykuY29uc3RydWN0b3I7XG4gIHZhciBTO1xuICByZXR1cm4gQyA9PT0gdW5kZWZpbmVkIHx8IChTID0gYW5PYmplY3QoQylbU1BFQ0lFU10pID09IHVuZGVmaW5lZCA/IEQgOiBhRnVuY3Rpb24oUyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zcGVjaWVzLWNvbnN0cnVjdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///91\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTIuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL191c2VyLWFnZW50LmpzP2UzNWMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIG5hdmlnYXRvciA9IGdsb2JhbC5uYXZpZ2F0b3I7XG5cbm1vZHVsZS5leHBvcnRzID0gbmF2aWdhdG9yICYmIG5hdmlnYXRvci51c2VyQWdlbnQgfHwgJyc7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3VzZXItYWdlbnQuanNcbi8vIG1vZHVsZSBpZCA9IDkyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///92\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(24);\nvar redefineAll = __webpack_require__(61);\nvar meta = __webpack_require__(47);\nvar forOf = __webpack_require__(60);\nvar anInstance = __webpack_require__(59);\nvar isObject = __webpack_require__(9);\nvar fails = __webpack_require__(8);\nvar $iterDetect = __webpack_require__(88);\nvar setToStringTag = __webpack_require__(64);\nvar inheritIfRequired = __webpack_require__(113);\n\nmodule.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {\n var Base = global[NAME];\n var C = Base;\n var ADDER = IS_MAP ? 'set' : 'add';\n var proto = C && C.prototype;\n var O = {};\n var fixMethod = function (KEY) {\n var fn = proto[KEY];\n redefine(proto, KEY,\n KEY == 'delete' ? function (a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'has' ? function has(a) {\n return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'get' ? function get(a) {\n return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);\n } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }\n : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }\n );\n };\n if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {\n new C().entries().next();\n }))) {\n // create collection constructor\n C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);\n redefineAll(C.prototype, methods);\n meta.NEED = true;\n } else {\n var instance = new C();\n // early implementations not supports chaining\n var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;\n // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false\n var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });\n // most early implementations doesn't supports iterables, most modern - not close it correctly\n var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new\n // for early implementations -0 and +0 not the same\n var BUGGY_ZERO = !IS_WEAK && fails(function () {\n // V8 ~ Chromium 42- fails only with 5+ elements\n var $instance = new C();\n var index = 5;\n while (index--) $instance[ADDER](index, index);\n return !$instance.has(-0);\n });\n if (!ACCEPT_ITERABLES) {\n C = wrapper(function (target, iterable) {\n anInstance(target, C, NAME);\n var that = inheritIfRequired(new Base(), target, C);\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n return that;\n });\n C.prototype = proto;\n proto.constructor = C;\n }\n if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {\n fixMethod('delete');\n fixMethod('has');\n IS_MAP && fixMethod('get');\n }\n if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);\n // weak collections should not contains .clear method\n if (IS_WEAK && proto.clear) delete proto.clear;\n }\n\n setToStringTag(C, NAME);\n\n O[NAME] = C;\n $export($export.G + $export.W + $export.F * (C != Base), O);\n\n if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);\n\n return C;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTMuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jb2xsZWN0aW9uLmpzP2QxMTgiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyICRleH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X1dFQUspIGNvbW1vbi5zZXRTdHJvbmcoQywgTkFNRSwgSVNfTUFQKTtcblxuICByZXR1cm4gQztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2NvbGxlY3Rpb24uanNcbi8vIG1vZHVsZSBpZCA9IDkzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///93\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar hide = __webpack_require__(23);\nvar uid = __webpack_require__(53);\nvar TYPED = uid('typed_array');\nvar VIEW = uid('view');\nvar ABV = !!(global.ArrayBuffer && global.DataView);\nvar CONSTR = ABV;\nvar i = 0;\nvar l = 9;\nvar Typed;\n\nvar TypedArrayConstructors = (\n 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'\n).split(',');\n\nwhile (i < l) {\n if (Typed = global[TypedArrayConstructors[i++]]) {\n hide(Typed.prototype, TYPED, true);\n hide(Typed.prototype, VIEW, true);\n } else CONSTR = false;\n}\n\nmodule.exports = {\n ABV: ABV,\n CONSTR: CONSTR,\n TYPED: TYPED,\n VIEW: VIEW\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTQuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190eXBlZC5qcz9kM2I5Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBoaWRlID0gcmVxdWlyZSgnLi9faGlkZScpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xudmFyIFRZUEVEID0gdWlkKCd0eXBlZF9hcnJheScpO1xudmFyIFZJRVcgPSB1aWQoJ3ZpZXcnKTtcbnZhciBBQlYgPSAhIShnbG9iYWwuQXJyYXlCdWZmZXIgJiYgZ2xvYmFsLkRhdGFWaWV3KTtcbnZhciBDT05TVFIgPSBBQlY7XG52YXIgaSA9IDA7XG52YXIgbCA9IDk7XG52YXIgVHlwZWQ7XG5cbnZhciBUeXBlZEFycmF5Q29uc3RydWN0b3JzID0gKFxuICAnSW50OEFycmF5LFVpbnQ4QXJyYXksVWludDhDbGFtcGVkQXJyYXksSW50MTZBcnJheSxVaW50MTZBcnJheSxJbnQzMkFycmF5LFVpbnQzMkFycmF5LEZsb2F0MzJBcnJheSxGbG9hdDY0QXJyYXknXG4pLnNwbGl0KCcsJyk7XG5cbndoaWxlIChpIDwgbCkge1xuICBpZiAoVHlwZWQgPSBnbG9iYWxbVHlwZWRBcnJheUNvbnN0cnVjdG9yc1tpKytdXSkge1xuICAgIGhpZGUoVHlwZWQucHJvdG90eXBlLCBUWVBFRCwgdHJ1ZSk7XG4gICAgaGlkZShUeXBlZC5wcm90b3R5cGUsIFZJRVcsIHRydWUpO1xuICB9IGVsc2UgQ09OU1RSID0gZmFsc2U7XG59XG5cbm1vZHVsZS5leHBvcnRzID0ge1xuICBBQlY6IEFCVixcbiAgQ09OU1RSOiBDT05TVFIsXG4gIFRZUEVEOiBUWVBFRCxcbiAgVklFVzogVklFV1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdHlwZWQuanNcbi8vIG1vZHVsZSBpZCA9IDk0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///94\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// Forced replacement prototype accessors methods\nmodule.exports = __webpack_require__(48) || !__webpack_require__(8)(function () {\n var K = Math.random();\n // In FF throws only define methods\n // eslint-disable-next-line no-undef, no-useless-call\n __defineSetter__.call(null, K, function () { /* empty */ });\n delete __webpack_require__(7)[K];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTUuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtZm9yY2VkLXBhbS5qcz83NjZlIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEZvcmNlZCByZXBsYWNlbWVudCBwcm90b3R5cGUgYWNjZXNzb3JzIG1ldGhvZHNcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fbGlicmFyeScpIHx8ICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgdmFyIEsgPSBNYXRoLnJhbmRvbSgpO1xuICAvLyBJbiBGRiB0aHJvd3Mgb25seSBkZWZpbmUgbWV0aG9kc1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tdW5kZWYsIG5vLXVzZWxlc3MtY2FsbFxuICBfX2RlZmluZVNldHRlcl9fLmNhbGwobnVsbCwgSywgZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9KTtcbiAgZGVsZXRlIHJlcXVpcmUoJy4vX2dsb2JhbCcpW0tdO1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1mb3JjZWQtcGFtLmpzXG4vLyBtb2R1bGUgaWQgPSA5NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///95\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = __webpack_require__(0);\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { of: function of() {\n var length = arguments.length;\n var A = new Array(length);\n while (length--) A[length] = arguments[length];\n return new this(A);\n } });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTYuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtY29sbGVjdGlvbi1vZi5qcz9kMjNkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtc2V0bWFwLW9mZnJvbS9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKENPTExFQ1RJT04pIHtcbiAgJGV4cG9ydCgkZXhwb3J0LlMsIENPTExFQ1RJT04sIHsgb2Y6IGZ1bmN0aW9uIG9mKCkge1xuICAgIHZhciBsZW5ndGggPSBhcmd1bWVudHMubGVuZ3RoO1xuICAgIHZhciBBID0gbmV3IEFycmF5KGxlbmd0aCk7XG4gICAgd2hpbGUgKGxlbmd0aC0tKSBBW2xlbmd0aF0gPSBhcmd1bWVudHNbbGVuZ3RoXTtcbiAgICByZXR1cm4gbmV3IHRoaXMoQSk7XG4gIH0gfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtY29sbGVjdGlvbi1vZi5qc1xuLy8gbW9kdWxlIGlkID0gOTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///96\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-setmap-offrom/\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(20);\nvar ctx = __webpack_require__(33);\nvar forOf = __webpack_require__(60);\n\nmodule.exports = function (COLLECTION) {\n $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {\n var mapFn = arguments[1];\n var mapping, A, n, cb;\n aFunction(this);\n mapping = mapFn !== undefined;\n if (mapping) aFunction(mapFn);\n if (source == undefined) return new this();\n A = [];\n if (mapping) {\n n = 0;\n cb = ctx(mapFn, arguments[2], 2);\n forOf(source, false, function (nextItem) {\n A.push(cb(nextItem, n++));\n });\n } else {\n forOf(source, false, A.push, A);\n }\n return new this(A);\n } });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTcuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtY29sbGVjdGlvbi1mcm9tLmpzPzg4YWEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1zZXRtYXAtb2Zmcm9tL1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgZm9yT2YgPSByZXF1aXJlKCcuL19mb3Itb2YnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoQ09MTEVDVElPTikge1xuICAkZXhwb3J0KCRleHBvcnQuUywgQ09MTEVDVElPTiwgeyBmcm9tOiBmdW5jdGlvbiBmcm9tKH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DQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///97\n")},function(module,exports){eval("var id = 0;\nvar px = Math.random();\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTguanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qcz9kYzRhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpZCA9IDA7XG52YXIgcHggPSBNYXRoLnJhbmRvbSgpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiAnU3ltYm9sKCcuY29uY2F0KGtleSA9PT0gdW5kZWZpbmVkID8gJycgOiBrZXksICcpXycsICgrK2lkICsgcHgpLnRvU3RyaW5nKDM2KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3VpZC5qc1xuLy8gbW9kdWxlIGlkID0gOThcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///98\n")},function(module,exports){eval("module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTkuanMiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2EtZnVuY3Rpb24uanM/OTRlOSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAodHlwZW9mIGl0ICE9ICdmdW5jdGlvbicpIHRocm93IFR5cGVFcnJvcihpdCArICcgaXMgbm90IGEgZnVuY3Rpb24hJyk7XG4gIHJldHVybiBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fYS1mdW5jdGlvbi5qc1xuLy8gbW9kdWxlIGlkID0gOTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///99\n")},function(module,exports,__webpack_require__){eval("var def = __webpack_require__(45).f;\nvar has = __webpack_require__(62);\nvar TAG = __webpack_require__(22)('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtdG8tc3RyaW5nLXRhZy5qcz83YmE5Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkZWYgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIFRBRyA9IHJlcXVpcmUoJy4vX3drcycpKCd0b1N0cmluZ1RhZycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgdGFnLCBzdGF0KSB7XG4gIGlmIChpdCAmJiAhaGFzKGl0ID0gc3RhdCA/IGl0IDogaXQucHJvdG90eXBlLCBUQUcpKSBkZWYoaXQsIFRBRywgeyBjb25maWd1cmFibGU6IHRydWUsIHZhbHVlOiB0YWcgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC10by1zdHJpbmctdGFnLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///100\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(437);\nvar global = __webpack_require__(21);\nvar hide = __webpack_require__(63);\nvar Iterators = __webpack_require__(71);\nvar TO_STRING_TAG = __webpack_require__(22)('toStringTag');\n\nvar DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +\n 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +\n 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +\n 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +\n 'TextTrackList,TouchList').split(',');\n\nfor (var i = 0; i < DOMIterables.length; i++) {\n var NAME = DOMIterables[i];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NA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ZmZlckxpc3QsU3R5bGVTaGVldExpc3QsVGV4dFRyYWNrQ3VlTGlzdCwnICtcbiAgJ1RleHRUcmFja0xpc3QsVG91Y2hMaXN0Jykuc3BsaXQoJywnKTtcblxuZm9yICh2YXIgaSA9IDA7IGkgPCBET01JdGVyYWJsZXMubGVuZ3RoOyBpKyspIHtcbiAgdmFyIE5BTUUgPSBET01JdGVyYWJsZXNbaV07XG4gIHZhciBDb2xsZWN0aW9uID0gZ2xvYmFsW05BTUVdO1xuICB2YXIgcHJvdG8gPSBDb2xsZWN0aW9uICYmIENvbGxlY3Rpb24ucHJvdG90eXBlO1xuICBpZiAocHJvdG8gJiYgIXByb3RvW1RPX1NUUklOR19UQUddKSBoaWRlKHByb3RvLCBUT19TVFJJTkdfVEFHLCBOQU1FKTtcbiAgSXRlcmF0b3JzW05BTUVdID0gSXRlcmF0b3JzLkFycmF5O1xufVxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZS5qc1xuLy8gbW9kdWxlIGlkID0gMTAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///101\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nvar runtimeUtils = exports.runtimeUtils = {\n runtimeDescriptor: {},\n runtimeCapabilities: {\n constraints: {}\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL3J1bnRpbWVVdGlscy5qcz9iYWE0Il0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBsZXQgcnVudGltZVV0aWxzID0ge1xuICBydW50aW1lRGVzY3JpcHRvcjoge30sXG4gIHJ1bnRpbWVDYXBhYmlsaXRpZXM6IHtcbiAgICBjb25zdHJhaW50czoge31cbiAgfVxufTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcnVudGltZS9ydW50aW1lVXRpbHMuanMiXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFEQTtBQUZBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///102\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _getOwnPropertyDescriptor = __webpack_require__(483);\n\nvar _getOwnPropertyDescriptor2 = _interopRequireDefault(_getOwnPropertyDescriptor);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function get(object, property, receiver) {\n if (object === null) object = Function.prototype;\n var desc = (0, _getOwnPropertyDescriptor2.default)(object, property);\n\n if (desc === undefined) {\n var parent = (0, _getPrototypeOf2.default)(object);\n\n if (parent === null) {\n return undefined;\n } else {\n return get(parent, property, receiver);\n }\n } else if ("value" in desc) {\n return desc.value;\n } else {\n var getter = desc.get;\n\n if (getter === undefined) {\n return undefined;\n }\n\n return getter.call(receiver);\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1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dCk7XG5cbiAgICBpZiAocGFyZW50ID09PSBudWxsKSB7XG4gICAgICByZXR1cm4gdW5kZWZpbmVkO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gZ2V0KHBhcmVudCwgcHJvcGVydHksIHJlY2VpdmVyKTtcbiAgICB9XG4gIH0gZWxzZSBpZiAoXCJ2YWx1ZVwiIGluIGRlc2MpIHtcbiAgICByZXR1cm4gZGVzYy52YWx1ZTtcbiAgfSBlbHNlIHtcbiAgICB2YXIgZ2V0dGVyID0gZGVzYy5nZXQ7XG5cbiAgICBpZiAoZ2V0dGVyID09PSB1bmRlZmluZWQpIHtcbiAgICAgIHJldHVybiB1bmRlZmluZWQ7XG4gICAgfVxuXG4gICAgcmV0dXJuIGdldHRlci5jYWxsKHJlY2VpdmVyKTtcbiAgfVxufTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvZ2V0LmpzXG4vLyBtb2R1bGUgaWQgPSAxMDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///103\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('address-allocation'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log system\n\n\n// TODO: this could not be the best way to do a Singleton but at this moment it works;\n\nvar instance = void 0;\n\n/**\n * Class will ask to the message node for addresses\n */\n\nvar AddressAllocation = function () {\n /* private\n _url: URL\n _bus: MiniBus\n */\n\n /**\n * Create an Address Allocation\n * @param {URL.URL} url - url from who is sending the message\n * @param {MiniBus} bus - MiniBus used for address allocation\n */\n function AddressAllocation(url, bus, registry, subscriptionManager) {\n (0, _classCallCheck3.default)(this, AddressAllocation);\n\n\n if (!instance) {\n this._url = url + '/address-allocation';\n this._bus = bus;\n this._registry = registry;\n this._subscriptionManager = subscriptionManager;\n instance = this;\n } else {\n return instance;\n }\n }\n\n (0, _createClass3.default)(AddressAllocation, [{\n key: 'create',\n\n\n /**\n *\n * Ask for creation of a number of Hyperty addresses, to the domain message node.\n *\n * @param {Domain} domain - domain of the message node\n * @param {Number} number - number of address to be allocated\n * @param {Descriptor} info - descriptor to search for the hyperty (TODO:// this should be confirmed)\n * @see https://github.com/reTHINK-project/specs/blob/master/datamodel/core/hyperty-catalogue/readme.md#catalogue-data-model\n * @param {scheme} scheme - scheme of address to be created or reused, like: hyperty, comm, context, etc;\n * @param {boolean|URL.HypertyURL} reuseURL - reuseURL is used to reuse the hypertyURL previously registred;\n * @returns {Promise} this is Promise and returns an object with the address information\n *\n * @memberOf AddressAllocation\n */\n value: function create(domain, number, info, scheme, reuseURL) {\n\n // // console.log('typeof(reuseURL)', typeof(reuseURL), reuseURL);\n //debugger;\n if (reuseURL) {\n\n if (typeof reuseURL === 'boolean') {\n\n if (reuseURL) {\n return this._reuseAllocatedAddress(domain, number, info, scheme, reuseURL);\n } else {\n return this._allocateNewAddress(domain, scheme, number, info);\n }\n }\n\n if (typeof reuseURL === 'string' && (0, _utils.isURL)(reuseURL)) {\n //return this._reuseAllocatedAddress(domain, number, info, scheme, reuseURL);\n return new _promise2.default(function (resolve, reject) {\n var value = { newAddress: false, address: [reuseURL] };\n return resolve(value);\n });\n }\n } else {\n log.info('[AddressAllocation] - new address will be allocated');\n\n // if there is no URL saved request a new URL\n return this._allocateNewAddress(domain, scheme, number, info);\n }\n }\n }, {\n key: '_reuseAllocatedAddress',\n value: function _reuseAllocatedAddress(domain, number, info, scheme, reuseURL) {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n console.log('REUSETEST - _reuseAllocatedAddress', domain, number, info, scheme, reuseURL);\n _this2._registry.checkRegisteredURLs(info, reuseURL).then(function (urls) {\n console.log('REUSETEST - registeredurls', urls);\n if (urls) {\n log.info('[AddressAllocation - ' + scheme + '] - Reuse URL');\n var value = { newAddress: false, address: urls };\n resolve(value);\n } else {\n\n if (typeof reuseURL === 'string') {\n log.info('[AddressAllocation - reuseURL] - Object ' + reuseURL + ' not found');\n reject('URL Not Found');\n } else if (typeof reuseURL === 'boolean') {\n _this2._allocateNewAddress(domain, scheme, number, info).then(resolve).catch(reject);\n } else {\n reject('URL Not Found');\n }\n }\n });\n });\n }\n }, {\n key: '_allocateNewAddress',\n value: function _allocateNewAddress(domain, scheme, number, info) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var addresses = [];\n var i;\n\n for (i = 0; i < number; i++) {\n addresses.push(scheme + '://' + domain + '/' + (0, _utils.generateGUID)());\n }\n\n var result = { newAddress: true, address: addresses };\n\n if (scheme === 'hyperty') {\n if (info.hasOwnProperty('_configuration')) {\n var domainRouting = info._configuration.hasOwnProperty('domain_routing') ? info.configuration.domain_routing : true;\n if (domainRouting) {\n _this._subscriptionManager.createSubscription(domain, addresses, _this._url).then(function () {\n resolve(result);\n });\n } else resolve(result);\n } else resolve(result);\n } else resolve(result);\n\n /* let msg = {\n type: 'create', from: this._url, to: 'domain://msg-node.' + domain + '/address-allocation',\n body: {value: { number: number } }\n };\n \n if (scheme !== 'hyperty') msg.body.scheme = scheme;\n \n log.info('[AddressAllocation - ' + scheme + '] - Request new URL');\n \n this._bus.postMessage(msg, (reply) => {\n if (reply.body.code === 200) {\n let result = {newAddress: true, address: reply.body.value.allocated};\n resolve(result);\n } else {\n reject(reply.body.desc);\n }\n });*/\n });\n }\n\n /**\n * Send a request to the domain message node, to deallocate one or more addresses\n * @param {Domain} domain - Domain of the message node.\n * @param {addresses} addresses to request the deallocation\n * @returns {Promise} the response by the message node\n */\n\n }, {\n key: 'delete',\n value: function _delete(domain, addresses) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n resolve(200);\n\n /* let message = {\n type: 'delete', from: _this._url, to: 'domain://msg-node.' + domain + '/address-allocation',\n body: {childrenResources: addresses}\n };\n \n _this._bus.postMessage(message, (reply) => {\n if (reply.body.code === 200) {\n resolve(reply.body.code);\n } else {\n reject(reply.body.desc);\n }\n });*/\n });\n }\n }, {\n key: 'url',\n\n\n /**\n * get the URL value\n * @return {string} The url value;\n */\n get: function get() {\n return this._url;\n }\n }], [{\n key: 'instance',\n get: function get() {\n if (!instance) {\n throw new Error('The address allocation was not instantiated');\n }\n\n return instance;\n }\n }]);\n return AddressAllocation;\n}();\n\nexports.default = AddressAllocation;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9hbGxvY2F0aW9uL0FkZHJlc3NBbGxvY2F0aW9uLmpzPzFlNmEiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc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UNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7OztBQUVBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTtBQUVBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFHQTtBQUNBO0FBRUE7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBa0JBO0FBRUE7QUFDQTtBQUNBOzs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7QUFZQTtBQUVBOzs7OztBQWhLQTs7OztBQUlBO0FBQUE7QUFBQTs7O0FBWkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBcUtBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///104\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Crypto = __webpack_require__(527);\n\nvar _Crypto2 = _interopRequireDefault(_Crypto);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('CryptoManager'); // Log System\n\n/**\n* The Crypto Manager provides manages cryptographic features for the runtime including:\n* - Mutual Authentication between peers\n* - Crypto Keys\n* - e2e encryption and decription of communication between Hyperties and dta objects\n*\n*/\nvar CryptoManager = function () {\n\n /**\n * This is the constructor to initialise the CryptoManager, it does not require any input.\n * The init() must called in order to set mandatories attributes\n */\n\n function CryptoManager(storageManager) {\n (0, _classCallCheck3.default)(this, CryptoManager);\n\n this.storageManager = storageManager;\n this.userDefaultKeyRef = 'userAsymmetricKey';\n }\n\n (0, _createClass3.default)(CryptoManager, [{\n key: 'init',\n value: function init(runtimeURL, runtimeCapabilities, storageManager, dataObjectsStorage, registry, coreDiscovery, idm, runtimeFactory) {\n var _this = this;\n\n if (!runtimeURL) throw new Error('[] runtimeURL is missing.');\n if (!storageManager) throw new Error('storageManager is missing');\n if (!runtimeFactory) throw new Error('runtimeFactory is missing');\n\n _this._runtimeURL = runtimeURL;\n _this._cryptoManagerURL = _this._runtimeURL + '/cryptoManager';\n\n //_this._myURL = _this._runtimeURL + '/crypto';\n _this.storageManager = storageManager;\n _this.dataObjectsStorage = dataObjectsStorage;\n _this.runtimeCapabilities = runtimeCapabilities;\n\n _this._runtimeFactory = runtimeFactory;\n _this._domain = (0, _utils.divideURL)(_this._runtimeURL).domain;\n\n _this.crypto = new _Crypto2.default(_this._runtimeFactory);\n\n // hashTable to store all the crypto information between two hyperties\n _this.chatKeys = {};\n\n // hashTable to store the symmetric keys to be used in the chat group\n _this.dataObjectSessionKeys = {};\n\n //failsafe to enable/disable all the criptographic functions\n _this.isToUseEncryption = true;\n\n _this._registry = registry;\n _this._coreDiscovery = coreDiscovery;\n\n _this._idm = idm;\n }\n\n //******************* GET AND SET METHODS *******************\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n }, {\n key: 'loadSessionKeys',\n\n\n // to be used to initialise IDM with SessionKeys used in previous session\n\n value: function loadSessionKeys() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n if (sessionKeys) _this.dataObjectSessionKeys = sessionKeys;else _this.dataObjectSessionKeys = {};\n resolve();\n });\n });\n }\n }, {\n key: '_isFromRemoteSM',\n value: function _isFromRemoteSM(from) {\n var splitFrom = from.split('://');\n return splitFrom[0] === 'runtime' && from !== this._runtimeURL + '/sm';\n }\n }, {\n key: 'addCryptoGUIListeners',\n value: function addCryptoGUIListeners() {\n //TODO: Change the GUI invocation of this method\n var _this = this;\n\n _this._messageBus.addListener(_this._cryptoManagerURL, function (msg) {\n var funcName = msg.body.method;\n\n //let returnedValue;\n if (funcName === 'generateRSAKeyPair') {\n _this._crypto.getMyPublicKey().then(function (key) {\n var value = { type: 'execute', value: key, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if generateRSAKeyPair method postMessage error: ' + err);\n }\n });\n return;\n }\n });\n }\n\n //******************* ENCRYPTION METHODS *******************\n /**\n * Identifies the messages to be encrypted\n * @param {Message} message\n * @returns {boolean} returns true if the message requires encryption\n */\n\n }, {\n key: '_isToEncrypt',\n value: function _isToEncrypt(message) {\n var _this = this;\n log.log('[CryptoManager._isToEncrypt]', message);\n var isCreate = message.type === 'create';\n var isFromHyperty = message.from.includes('hyperty://');\n var isToHyperty = message.to.includes('hyperty://');\n var isToDataObject = (0, _utils.isDataObjectURL)(message.to);\n var reporter = _this.registry.getDataObjectReporter(message.to);\n\n var doMutualAuthentication = message.hasOwnProperty('body') && message.body.hasOwnProperty('mutual') ? message.body.mutual : message.hasOwnProperty('body') && message.body.hasOwnProperty('value') && message.body.value.hasOwnProperty('mutual') ? message.body.value.mutual : true;\n\n if (!doMutualAuthentication) return false;\n if (reporter !== null && (0, _utils.isLegacy)(reporter)) {\n return false;\n }\n\n //if is not to apply encryption, then returns resolve\n if (!this.isToUseEncryption && !(message.type === 'handshake')) {\n log.info('not handshake: encryption disabled');\n return false;\n }\n\n if (message.type === 'update') {\n log.info('update:encryption disabled');\n return false;\n }\n\n if ((0, _utils.isLegacy)(message.to)) return false;\n\n return isCreate && isFromHyperty && isToHyperty || isCreate && isFromHyperty && isToDataObject && doMutualAuthentication || message.type === 'handshake' || message.type === 'update' && doMutualAuthentication;\n }\n }, {\n key: '_isToDecrypt',\n value: function _isToDecrypt(message) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n // For sybscribe message let's start the mutualAuthentication\n var isSubscription = message.type === 'subscribe';\n var isFromRemoteSM = _this._isFromRemoteSM(message.from);\n var mutual = message.body.hasOwnProperty('value') && message.body.value.hasOwnProperty('mutual') ? message.body.value.mutual : message.body.hasOwnProperty('mutual') ? message.body.mutual : true;\n // let mutual = message.body.hasOwnProperty('mutual') ? message.body.mutual : false;\n\n if (isSubscription && isFromRemoteSM && mutual) {\n // if (isSubscription && isFromRemoteSM ) {\n log.log('[CryptoManager._isToDecrypt] _doMutualAuthenticationPhase1');\n console.log('[CryptoManager._isToDecrypt] ', message);\n var reporter = _this.registry.getDataObjectReporter(message.to);\n if (reporter !== null && (0, _utils.isLegacy)(reporter)) {\n return resolve(false);\n }\n\n _this._doMutualAuthenticationPhase1(message).then(function () {\n resolve(false);\n }, function (error) {\n reject(error);\n });\n\n // } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('value') && typeof message.body.value === 'string') {\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('value') && typeof message.body.value === 'string' && mutual) {\n log.log('[CryptoManager._isToDecrypt] true');\n resolve(true);\n } else {\n log.log('[CryptoManager._isToDecrypt] false');\n resolve(false);\n }\n }).catch(function (error) {\n log.error('[CryptoManager._isToDecrypt]', error);\n });\n }\n }, {\n key: 'encryptMessage',\n value: function encryptMessage(message) {\n //log.info('encryptMessage:message', message);\n var _this = this;\n\n log.log('encrypt message ');\n\n return new _promise2.default(function (resolve, reject) {\n\n var isHandShakeType = message.type === 'handshake';\n\n //if is not to apply encryption, then returns resolve\n if (!_this._isToEncrypt(message)) {\n // log.log('decryption disabled');\n return resolve(message);\n }\n\n var dataObjectURL = (0, _utils.parseMessageURL)(message.to);\n\n var isToDataObject = (0, _utils.isDataObjectURL)(dataObjectURL);\n var isToLegacyIdentity = (0, _utils.isLegacy)(message.to);\n var isFromHyperty = (0, _utils.divideURL)(message.from).type === 'hyperty';\n var isToHyperty = (0, _utils.divideURL)(message.to).type === 'hyperty';\n\n if (message.type === 'update') {\n log.log('encrypt message: message type update');\n return resolve(message);\n }\n\n if (isToLegacyIdentity) {\n resolve(message);\n } else if (isFromHyperty && isToHyperty) {\n var userURL = _this._registry.getHypertyOwner(message.from);\n if (userURL) {\n\n // check if exists any keys between two users\n var chatKeys = _this.chatKeys[message.from + '<->' + message.to];\n if (!chatKeys) {\n chatKeys = _this._newChatCrypto(message, userURL);\n\n //log.log('createChatKey encrypt', message.from + message.to);\n _this.chatKeys[message.from + '<->' + message.to] = chatKeys;\n message.body.handshakePhase = 'startHandShake';\n }\n\n if (chatKeys.authenticated && !isHandShakeType) {\n\n var iv = _this.crypto.generateIV();\n _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, (0, _utils.stringify)(message.body.value), iv).then(function (encryptedValue) {\n\n var filteredMessage = _this._filterMessageToHash(message, (0, _utils.stringify)(message.body.value) + (0, _utils.stringify)(iv), chatKeys.hypertyFrom.messageInfo);\n\n _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage).then(function (hash) {\n //log.log('result of hash ', hash);\n var value = { iv: (0, _utils.encode)(iv), value: (0, _utils.encode)(encryptedValue), hash: (0, _utils.encode)(hash) };\n message.body.value = (0, _utils.encode)(value);\n\n resolve(message);\n });\n });\n\n // if is a handshake message, just resolve it\n } else if (isHandShakeType) {\n resolve(message);\n\n // else, starts a new handshake protocol\n } else {\n _this._doHandShakePhase(message, chatKeys).then(function (value) {\n _this.chatKeys[message.from + '<->' + message.to] = value.chatKeys;\n\n _this._messageBus.postMessage(value.message);\n reject('encrypt handshake protocol phase ');\n });\n }\n } else {\n reject('In encryptMessage: Hyperty owner URL was not found');\n }\n\n //if from hyperty to a dataObjectURL\n } else if (isFromHyperty && isToDataObject) {\n\n //log.log('dataObject value to encrypt: ', message.body.value);\n //log.log('IdentityModule - encrypt from hyperty to dataobject ', message);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys || {});\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n _this.dataObjectsStorage.getDataObject(dataObjectURL).then(function (isHypertyReporter) {\n //if no key exists, create a new one if is the reporter of dataObject\n if (!dataObjectKey) {\n // if the hyperty is the reporter of the dataObject then generates a session key\n if (isHypertyReporter.reporter && isHypertyReporter.reporter === message.from) {\n\n var sessionKey = _this.crypto.generateRandom();\n _this.dataObjectSessionKeys[dataObjectURL] = { sessionKey: sessionKey, isToEncrypt: true };\n var dataObjectSessionKeysClone = (0, _utils.chatkeysToStringCloner)(_this.dataObjectSessionKeys);\n\n //TODO: check if this does not need to be stored\n _this.storageManager.set('dataObjectSessionKeys', 0, dataObjectSessionKeysClone).catch(function (err) {\n reject('On encryptMessage from method storageManager.set error: ' + err);\n });\n dataObjectKey = _this.dataObjectSessionKeys[dataObjectURL];\n }\n }\n\n //check if there is already a session key for the chat room\n if (dataObjectKey) {\n\n // and if is to apply encryption, encrypt the messages\n if (dataObjectKey.isToEncrypt) {\n var _iv = _this.crypto.generateIV();\n var stringifiedIV = (0, _utils.stringify)(_iv);\n var stringifiedMessageBody = (0, _utils.stringify)(message.body.value);\n\n _this.crypto.encryptAES(dataObjectKey.sessionKey, stringifiedMessageBody, _iv).then(function (encryptedValue) {\n delete message.body.identity.assertion; //TODO: Check why assertion is comming on the message!\n delete message.body.identity.expires; //TODO: Check why expires is comming on the message!\n var filteredMessage = _this._filterMessageToHash(message, stringifiedMessageBody + stringifiedIV);\n\n _this.crypto.hashHMAC(dataObjectKey.sessionKey, filteredMessage).then(function (hash) {\n // log.log('hash ', hash);\n\n var newValue = { value: (0, _utils.encode)(encryptedValue), iv: (0, _utils.encode)(_iv), hash: (0, _utils.encode)(hash) };\n\n message.body.value = (0, _utils.stringify)(newValue);\n resolve(message);\n });\n });\n\n // if not, just send the message\n } else {\n resolve(message);\n }\n\n // start the generation of a new session Key\n } else {\n reject('Data object key could not be defined: Failed to decrypt message ');\n }\n }).catch(function (err) {\n reject('On encryptMessage from method dataObjectsStorage.getDataObject error: ' + err);\n });\n }).catch(function (err) {\n reject('On encryptMessage from method storageManager.get error: ' + err);\n });\n }\n });\n }\n }, {\n key: 'encryptDataObject',\n value: function encryptDataObject(dataObject, sender) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n log.info('dataObject value to encrypt: ', dataObject);\n\n var dataObjectURL = (0, _utils.parseMessageURL)(sender);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys || {});\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n //check if there is already a session key for the chat room\n if (dataObjectKey) {\n\n // and if is to apply encryption, encrypt the messages\n if (dataObjectKey.isToEncrypt) {\n var iv = _this.crypto.generateIV();\n\n _this.crypto.encryptAES(dataObjectKey.sessionKey, (0, _utils.stringify)(dataObject), iv).then(function (encryptedValue) {\n var newValue = { value: (0, _utils.encode)(encryptedValue), iv: (0, _utils.encode)(iv) };\n\n //log.log('encrypted dataObject', newValue);\n return resolve(newValue);\n }).catch(function (err) {\n reject('On encryptDataObject from method encryptAES error: ' + err);\n });\n\n // if not, just send the message\n } else {\n log.info('The dataObject is not encrypted');\n return resolve(dataObject);\n }\n\n // start the generation of a new session Key\n } else {\n return reject('No dataObjectKey for this dataObjectURL:', dataObjectURL);\n }\n }).catch(function (err) {\n reject('On encryptDataObject from method storageManager.get error: ' + err);\n });\n });\n }\n }, {\n key: 'decryptMessage',\n value: function decryptMessage(message) {\n var _this = this;\n\n // log.log('decryptMessage:message', message);\n\n return new _promise2.default(function (resolve, reject) {\n var isHandShakeType = message.type === 'handshake';\n\n _this._isToDecrypt(message).then(function (isToDecrypt) {\n\n //if is not to apply encryption, then returns resolve\n if (!isToDecrypt) return resolve(message);\n\n var dataObjectURL = (0, _utils.parseMessageURL)(message.to);\n\n var isToDataObject = (0, _utils.isDataObjectURL)(dataObjectURL);\n var isFromHyperty = (0, _utils.divideURL)(message.from).type === 'hyperty';\n var isToHyperty = (0, _utils.divideURL)(message.to).type === 'hyperty';\n\n if (message.type === 'update') {\n return resolve(message);\n }\n\n //is is hyperty to hyperty communication\n if (isFromHyperty && isToHyperty) {\n // log.log('decrypt hyperty to hyperty');\n var userURL = _this._registry.getHypertyOwner(message.to);\n if (userURL) {\n\n var chatKeys = _this.chatKeys[message.to + '<->' + message.from];\n if (!chatKeys) {\n chatKeys = _this._newChatCrypto(message, userURL, 'decrypt');\n _this.chatKeys[message.to + '<->' + message.from] = chatKeys;\n }\n\n if (chatKeys.authenticated && !isHandShakeType) {\n var value = (0, _utils.decode)(message.body.value);\n var iv = (0, _utils.decodeToUint8Array)(value.iv);\n var data = (0, _utils.decodeToUint8Array)(value.value);\n var hash = (0, _utils.decodeToUint8Array)(value.hash);\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, data, iv).then(function (decryptedData) {\n // log.log('decrypted value ', decryptedData);\n message.body.value = decryptedData;\n\n var filteredMessage = _this._filterMessageToHash(message, decryptedData + iv);\n\n _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, hash).then(function (result) {\n //log.log('result of hash verification! ', result);\n message.body.assertedIdentity = true;\n resolve(message);\n });\n });\n } else if (isHandShakeType) {\n _this._doHandShakePhase(message, chatKeys).then(function (value) {\n\n //if it was started by doMutualAuthentication then ends the protocol\n if (value === 'handShakeEnd') {\n //reject('decrypt handshake protocol phase');\n\n // if was started by a message, then resend that message\n } else {\n _this.chatKeys[message.to + '<->' + message.from] = value.chatKeys;\n _this._messageBus.postMessage(value.message);\n\n //reject('decrypt handshake protocol phase ');\n }\n });\n } else {\n reject('wrong message do decrypt');\n }\n } else {\n reject('error on decrypt message');\n }\n\n //if from hyperty to a dataObjectURL\n } else if (isFromHyperty && isToDataObject) {\n // log.log('dataObject value to decrypt: ', message.body);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys || {});\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n if (dataObjectKey) {\n\n //check if is to apply encryption\n if (dataObjectKey.isToEncrypt) {\n var parsedValue = (0, _utils.parse)(message.body.value);\n var _iv2 = (0, _utils.decodeToUint8Array)(parsedValue.iv);\n var encryptedValue = (0, _utils.decodeToUint8Array)(parsedValue.value);\n var _hash = (0, _utils.decodeToUint8Array)(parsedValue.hash);\n\n _this.crypto.decryptAES(dataObjectKey.sessionKey, encryptedValue, _iv2).then(function (decryptedValue) {\n var parsedValue = (0, _utils.parse)(decryptedValue);\n\n // log.log('decrypted Value,', parsedValue);\n message.body.value = parsedValue;\n\n var filteredMessage = _this._filterMessageToHash(message, (0, _utils.stringify)(parsedValue) + (0, _utils.stringify)(_iv2));\n\n _this.crypto.verifyHMAC(dataObjectKey.sessionKey, filteredMessage, _hash).then(function (result) {\n log.log('Received message HMAC result', result);\n\n message.body.assertedIdentity = true;\n resolve(message);\n }).catch(function (err) {\n reject('Message HMAC is invalid: ' + err);\n });\n });\n\n //if not, just return the message\n } else {\n message.body.assertedIdentity = true;\n resolve(message);\n }\n } else {\n message.body.assertedIdentity = true;\n resolve(message);\n\n //reject('no sessionKey for chat room found');\n }\n });\n } else {\n reject('wrong message to decrypt');\n }\n });\n });\n }\n }, {\n key: 'decryptDataObject',\n value: function decryptDataObject(dataObject, sender) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //if is not to apply encryption, then returns resolve\n if (!_this.isToUseEncryption) {\n // log.log('decryption disabled');\n return resolve(dataObject);\n }\n\n var dataObjectURL = (0, _utils.parseMessageURL)(sender);\n\n // log.log('dataObject value to decrypt: ', dataObject);\n\n _this.storageManager.get('dataObjectSessionKeys').then(function (sessionKeys) {\n sessionKeys = (0, _utils.chatkeysToArrayCloner)(sessionKeys);\n var dataObjectKey = sessionKeys ? sessionKeys[dataObjectURL] : null;\n\n if (dataObjectKey) {\n\n //check if is to apply encryption\n if (dataObjectKey.isToEncrypt) {\n var iv = (0, _utils.decodeToUint8Array)(dataObject.iv);\n var encryptedValue = (0, _utils.decodeToUint8Array)(dataObject.value);\n\n _this.crypto.decryptAES(dataObjectKey.sessionKey, encryptedValue, iv).then(function (decryptedValue) {\n var parsedValue = (0, _utils.parse)(decryptedValue);\n var newValue = { value: parsedValue, iv: (0, _utils.encode)(iv) };\n\n // log.log('decrypted dataObject,', newValue);\n\n return resolve(newValue);\n }).catch(function (err) {\n reject('On decryptDataObject from method encryptAES error: ' + err);\n });\n\n //if not, just return the dataObject\n } else {\n // log.log('The dataObject is not encrypted');\n return resolve(dataObject);\n }\n } else {\n return reject('No dataObjectKey for this dataObjectURL:', dataObjectURL);\n }\n });\n });\n }\n }, {\n key: '_doMutualAuthenticationPhase1',\n value: function _doMutualAuthenticationPhase1(message) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n var to = message.to.split('/');\n\n //let subsIndex = to.indexOf('subscription');\n //let isDataObjectSubscription = subsIndex !== -1;\n to.pop();\n var dataObjectURL = to[0] + '//' + to[2] + '/' + to[3];\n _this._doMutualAuthenticationPhase2(dataObjectURL, message.body.subscriber).then(function () {\n _this._registry.registerSubscriber(dataObjectURL, message.body.subscriber);\n resolve();\n }, function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: '_doMutualAuthenticationPhase2',\n value: function _doMutualAuthenticationPhase2(sender, receiver) {\n log.info('doMutualAuthentication:sender ', sender);\n log.info('doMutualAuthentication:receiver ', receiver);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var dataObjectURL = void 0;\n\n // check if the sender is a dataObject and if so stores that value\n var reporterURL = _this._registry.getReporterURLSynchonous(sender);\n if (reporterURL) {\n dataObjectURL = sender;\n sender = reporterURL;\n }\n\n var msg = {\n to: receiver,\n from: sender,\n callback: undefined,\n body: { handshakePhase: 'startHandShake', ignore: 'ignoreMessage' }\n };\n\n if (!sender || !receiver) {\n return reject('sender or receiver missing on doMutualAuthentication');\n }\n\n var chatKeys = _this.chatKeys[sender + '<->' + receiver];\n var userURL = _this._registry.getHypertyOwner(sender);\n\n if (userURL) {\n\n if (!chatKeys) {\n // callback to resolve when finish the mutual authentication\n var resolved = function resolved(value) {\n // log.log('callback value:', value);\n resolve(value);\n };\n msg.callback = resolved;\n msg.dataObjectURL = dataObjectURL;\n\n chatKeys = _this._newChatCrypto(msg, userURL);\n _this.chatKeys[sender + '<->' + receiver] = chatKeys;\n }\n\n if (chatKeys.authenticated) {\n\n var startSessionKeyExchange = {\n to: sender,\n from: receiver\n };\n chatKeys.dataObjectURL = dataObjectURL;\n _this._sendReporterSessionKey(startSessionKeyExchange, chatKeys).then(function (value) {\n\n _this._messageBus.postMessage(value.message);\n resolve('exchange of chat sessionKey initiated');\n }).catch(function (err) {\n reject('On doMutualAuthentication from method _sendReporterSessionKey error: ' + err);\n });\n } else {\n _this._doHandShakePhase(msg, chatKeys);\n }\n } else {\n reject('Mutual authentication error: Hyperty owner could not be resolved');\n }\n });\n }\n\n /**\n * returns the reporter associated to the dataObject URL\n * @param {String} dataObjectURL dataObject url\n * @return {String} reporter dataObject url reporter\n */\n /* _getHypertyFromDataObject(dataObjectURL) {\n log.info('_getHypertyFromDataObject:dataObjectURL', dataObjectURL);\n let _this = this;\n return new Promise(function(resolve, reject) {\n let splitedURL = divideURL(dataObjectURL);\n let domain = splitedURL.domain;\n let finalURL = _this._parseMessageURL(dataObjectURL);\n // check if is the creator of the hyperty\n let reporterURL = _this.registry.getReporterURLSynchonous(finalURL);\n log.info('_getHypertyFromDataObject:reporterURL', reporterURL);\n if (reporterURL) {\n resolve(reporterURL);\n } else {\n // check if there is already an association from an hypertyURL to the dataObject\n let storedReporterURL = _this.dataObjectsIdentity[finalURL];\n log.info('_getHypertyFromDataObject:storedReporterURL', storedReporterURL);\n if (storedReporterURL) {\n resolve(storedReporterURL);\n } else {\n // check if there is any hyperty that subscribed the dataObjectURL\n let subscriberHyperty = _this.registry.getDataObjectSubscriberHyperty(dataObjectURL);\n log.info('_getHypertyFromDataObject:subscriberHyperty', subscriberHyperty);\n if (subscriberHyperty) {\n resolve(subscriberHyperty);\n } else {\n // search in domain registry for the hyperty associated to the dataObject\n // search in case is a subscriber who wants to know the reporter\n _this._coreDiscovery.discoverDataObjectPerURL(finalURL, domain).then(dataObject => {\n log.info('_getHypertyFromDataObject:dataObject', dataObject);\n _this.dataObjectsIdentity[finalURL] = dataObject.reporter;\n log.info('_getHypertyFromDataObject:dataObject.reporter', dataObject.reporter);\n resolve(dataObject.reporter);\n }, err => {\n reject(err);\n });\n }\n }\n }\n });\n }*/\n\n }, {\n key: '_sendReporterSessionKey',\n value: function _sendReporterSessionKey(message, chatKeys) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var sessionKeyBundle = _this.dataObjectSessionKeys[chatKeys.dataObjectURL];\n var reporterSessionKeyMsg = void 0;\n var valueToEncrypt = void 0;\n var sessionKey = void 0;\n var iv = void 0;\n var value = {};\n\n //if there is not yet a session Key, generates a new one\n if (!sessionKeyBundle) {\n sessionKey = _this.crypto.generateRandom();\n _this.dataObjectSessionKeys[chatKeys.dataObjectURL] = { sessionKey: sessionKey, isToEncrypt: true };\n\n var dataObjectSessionKeysClone = (0, _utils.chatkeysToStringCloner)(_this.dataObjectSessionKeys);\n\n _this.storageManager.set('dataObjectSessionKeys', 0, dataObjectSessionKeysClone).catch(function (err) {\n reject('On _sendReporterSessionKey from method storageManager.set(dataObjectSessionKeys...) error: ' + err);\n });\n } else {\n sessionKey = sessionKeyBundle.sessionKey;\n }\n\n try {\n valueToEncrypt = (0, _utils.encode)({ value: (0, _utils.encode)(sessionKey), dataObjectURL: chatKeys.dataObjectURL });\n } catch (err) {\n return reject('On _sendReporterSessionKey from method storageManager.set error valueToEncrypt: ' + err);\n }\n\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, valueToEncrypt, iv).then(function (encryptedValue) {\n\n reporterSessionKeyMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'reporterSessionKey',\n value: (0, _utils.encode)(encryptedValue)\n }\n };\n\n var filteredMessage = _this._filterMessageToHash(reporterSessionKeyMsg, valueToEncrypt + iv, chatKeys.hypertyFrom.messageInfo);\n\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage);\n }).then(function (hashedMessage) {\n var valueWithHash = (0, _utils.encode)({ value: reporterSessionKeyMsg.body.value, hash: (0, _utils.encode)(hashedMessage), iv: value.iv });\n\n reporterSessionKeyMsg.body.value = valueWithHash;\n\n resolve({ message: reporterSessionKeyMsg, chatKeys: chatKeys });\n }).catch(function (err) {\n reject('On _sendReporterSessionKey from chained promises encryptAES error: ' + err);\n });\n });\n }\n\n /**\n * Function that resolve and create the domainURL in case it is provided one. If not, resolve the default domainURL\n * @param {String} idpDomain idpDomain (Optional)\n */\n\n }, {\n key: '_resolveDomain',\n value: function _resolveDomain(idpDomain) {\n if (!idpDomain) {\n return 'domain-idp://google.com';\n } else {\n return 'domain-idp://' + idpDomain;\n }\n }\n }, {\n key: '_doHandShakePhase',\n value: function _doHandShakePhase(message, chatKeys) {\n // log('_doHandShakePhase:dataObject', message);\n //\tlog('_doHandShakePhase:chatKeys', chatKeys);\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var handshakeType = message.body.handshakePhase;\n var iv = void 0;\n var hash = void 0;\n var value = {};\n var filteredMessage = void 0;\n var privateKeyHolder = void 0;\n\n log.info('handshake phase: ', handshakeType);\n\n switch (handshakeType) {\n\n case 'startHandShake':\n {\n chatKeys.keys.fromRandom = _this.crypto.generateRandom();\n var startHandShakeMsg = {\n type: 'handshake',\n to: message.to,\n from: message.from,\n body: {\n handshakePhase: 'senderHello',\n value: (0, _utils.encode)(chatKeys.keys.fromRandom)\n }\n };\n chatKeys.handshakeHistory.senderHello = _this._filterMessageToHash(startHandShakeMsg, undefined, chatKeys.hypertyFrom.messageInfo);\n\n // check if was the encrypt function or the mutual authentication that request the\n // start of the handShakePhase.\n\n if (chatKeys.initialMessage) {\n resolve({ message: startHandShakeMsg, chatKeys: chatKeys });\n } else {\n _this.chatKeys[message.from + '<->' + message.to] = chatKeys;\n _this._messageBus.postMessage(startHandShakeMsg);\n }\n\n break;\n }\n case 'senderHello':\n {\n\n log.log('senderHello');\n chatKeys.handshakeHistory.senderHello = _this._filterMessageToHash(message);\n chatKeys.keys.fromRandom = (0, _utils.decodeToUint8Array)(message.body.value);\n chatKeys.keys.toRandom = _this.crypto.generateRandom();\n\n var senderHelloMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverHello',\n value: (0, _utils.encode)(chatKeys.keys.toRandom)\n }\n };\n chatKeys.handshakeHistory.receiverHello = _this._filterMessageToHash(senderHelloMsg, undefined, chatKeys.hypertyFrom.messageInfo);\n resolve({ message: senderHelloMsg, chatKeys: chatKeys });\n\n break;\n }\n case 'receiverHello':\n {\n\n log.log('receiverHello');\n _this.getMyPrivateKey().then(function (privateKey) {\n privateKeyHolder = privateKey;\n\n chatKeys.handshakeHistory.receiverHello = _this._filterMessageToHash(message);\n\n return _this._idm.validateAssertion(message.body.identity.assertion, undefined, message.body.identity.idp.domain);\n }).then(function (value) {\n\n //TODO remove later this verification as soon as all the IdP proxy are updated in the example\n var encodedpublicKey = typeof value.contents === 'string' ? value.contents : value.contents.nonce;\n\n var receiverPublicKey = (0, _utils.parseToUint8Array)(encodedpublicKey);\n var premasterSecret = _this.crypto.generatePMS();\n var toRandom = message.body.value;\n chatKeys.hypertyTo.assertion = message.body.identity.assertion;\n chatKeys.hypertyTo.publicKey = receiverPublicKey;\n chatKeys.hypertyTo.userID = message.body.identity.userProfile.userURL;\n chatKeys.keys.toRandom = (0, _utils.decodeToUint8Array)(toRandom);\n chatKeys.keys.premasterKey = premasterSecret;\n\n var concatKey = _this.crypto.concatPMSwithRandoms(premasterSecret, chatKeys.keys.toRandom, chatKeys.keys.fromRandom);\n\n return _this.crypto.generateMasterSecret(concatKey, 'messageHistoric' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n //generate the master key\n }).then(function (masterKey) {\n chatKeys.keys.masterKey = masterKey;\n\n return _this.crypto.generateKeys(masterKey, 'key expansion' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n //generate the symmetric and hash keys\n }).then(function (keys) {\n\n chatKeys.keys.hypertyToSessionKey = new Uint8Array(keys[0]);\n chatKeys.keys.hypertyFromSessionKey = new Uint8Array(keys[1]);\n chatKeys.keys.hypertyToHashKey = new Uint8Array(keys[2]);\n chatKeys.keys.hypertyFromHashKey = new Uint8Array(keys[3]);\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n\n var messageStructure = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'senderCertificate'\n }\n };\n\n // hash the value and the iv\n filteredMessage = _this._filterMessageToHash(messageStructure, 'ok' + iv, chatKeys.hypertyFrom.messageInfo);\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage);\n }).then(function (hash) {\n value.hash = (0, _utils.encode)(hash);\n\n //encrypt the data\n return _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, 'ok', iv);\n }).then(function (encryptedData) {\n value.symetricEncryption = (0, _utils.encode)(encryptedData);\n\n return _this.crypto.encryptRSA(chatKeys.hypertyTo.publicKey, chatKeys.keys.premasterKey);\n }).then(function (encryptedValue) {\n value.assymetricEncryption = (0, _utils.encode)(encryptedValue);\n\n var messageStructure = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'senderCertificate'\n }\n };\n\n var messageToHash = _this._filterMessageToHash(messageStructure, chatKeys.keys.premasterKey, chatKeys.hypertyFrom.messageInfo);\n return _this.crypto.signRSA(privateKeyHolder, (0, _utils.encode)(chatKeys.handshakeHistory) + (0, _utils.encode)(messageToHash));\n }).then(function (signature) {\n\n value.signature = (0, _utils.encode)(signature);\n\n var receiverHelloMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'senderCertificate',\n value: (0, _utils.encode)(value)\n }\n };\n chatKeys.handshakeHistory.senderCertificate = _this._filterMessageToHash(receiverHelloMsg, 'ok' + iv, chatKeys.hypertyFrom.messageInfo);\n\n resolve({ message: receiverHelloMsg, chatKeys: chatKeys });\n }, function (error) {\n return reject(error);\n });\n\n break;\n }\n case 'senderCertificate':\n {\n\n log.log('senderCertificate');\n\n var receivedValue = (0, _utils.decode)(message.body.value);\n\n _this.getMyPrivateKey().then(function (privateKey) {\n privateKeyHolder = privateKey;\n\n return _this._idm.validateAssertion(message.body.identity.assertion, undefined, message.body.identity.idp.domain);\n }).then(function (value) {\n var encryptedPMS = (0, _utils.decodeToUint8Array)(receivedValue.assymetricEncryption);\n\n //TODO remove later this verification as soon as all the IdP proxy are updated in the example\n var encodedpublicKey = typeof value.contents === 'string' ? value.contents : value.contents.nonce;\n\n var senderPublicKey = (0, _utils.parseToUint8Array)(encodedpublicKey);\n chatKeys.hypertyTo.assertion = message.body.identity.assertion;\n chatKeys.hypertyTo.publicKey = senderPublicKey;\n chatKeys.hypertyTo.userID = message.body.identity.userProfile.userURL;\n\n return _this.crypto.decryptRSA(privateKeyHolder, encryptedPMS);\n }, function (error) {\n // log.log(error);\n reject('Error during authentication of identity: ', error.message);\n\n //obtain the PremasterKey using the private key\n }).then(function (pms) {\n\n chatKeys.keys.premasterKey = new Uint8Array(pms);\n\n var signature = (0, _utils.decodeToUint8Array)(receivedValue.signature);\n\n var receivedmsgToHash = _this._filterMessageToHash(message, chatKeys.keys.premasterKey);\n\n return _this.crypto.verifyRSA(chatKeys.hypertyTo.publicKey, (0, _utils.encode)(chatKeys.handshakeHistory) + (0, _utils.encode)(receivedmsgToHash), signature);\n\n // validates the signature received\n }).then(function (signValidationResult) {\n\n //log.log('SenderCertificate - signature validation result ', signValidationResult);\n var concatKey = _this.crypto.concatPMSwithRandoms(chatKeys.keys.premasterKey, chatKeys.keys.toRandom, chatKeys.keys.fromRandom);\n\n return _this.crypto.generateMasterSecret(concatKey, 'messageHistoric' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n // generates the master keys from the Premaster key and the randoms\n }).then(function (masterKey) {\n chatKeys.keys.masterKey = masterKey;\n\n return _this.crypto.generateKeys(masterKey, 'key expansion' + chatKeys.keys.toRandom + chatKeys.keys.fromRandom);\n\n // generates the symmetric keys to be used in the symmetric encryption\n }).then(function (keys) {\n chatKeys.keys.hypertyFromSessionKey = new Uint8Array(keys[0]);\n chatKeys.keys.hypertyToSessionKey = new Uint8Array(keys[1]);\n chatKeys.keys.hypertyFromHashKey = new Uint8Array(keys[2]);\n chatKeys.keys.hypertyToHashKey = new Uint8Array(keys[3]);\n iv = (0, _utils.decodeToUint8Array)(receivedValue.iv);\n var data = (0, _utils.decodeToUint8Array)(receivedValue.symetricEncryption);\n\n return _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, data, iv);\n }).then(function (decryptedData) {\n // log.log('decryptedData', decryptedData);\n\n chatKeys.handshakeHistory.senderCertificate = _this._filterMessageToHash(message, decryptedData + iv);\n\n var hashReceived = (0, _utils.decodeToUint8Array)(receivedValue.hash);\n\n filteredMessage = _this._filterMessageToHash(message, decryptedData + iv);\n\n return _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, hashReceived);\n }).then(function (verifiedHash) {\n\n // log.log('result of hash verification ', verifiedHash);\n var receiverFinishedMessage = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverFinishedMessage'\n }\n };\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n\n filteredMessage = _this._filterMessageToHash(receiverFinishedMessage, 'ok!' + iv, chatKeys.hypertyFrom.messageInfo);\n\n //log.log('TIAGO: doHandShakePhase verifiedHash');\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, filteredMessage);\n }).then(function (hash) {\n\n value.hash = (0, _utils.encode)(hash);\n return _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, 'ok!', iv);\n }).then(function (encryptedValue) {\n value.value = (0, _utils.encode)(encryptedValue);\n var receiverFinishedMessage = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverFinishedMessage',\n value: (0, _utils.encode)(value)\n }\n };\n\n chatKeys.handshakeHistory.receiverFinishedMessage = _this._filterMessageToHash(receiverFinishedMessage, 'ok!' + iv, chatKeys.hypertyFrom.messageInfo);\n chatKeys.authenticated = true;\n resolve({ message: receiverFinishedMessage, chatKeys: chatKeys });\n }).catch(function (err) {\n reject('On _doHandShakePhase from senderCertificate error: ' + err);\n });\n\n break;\n }\n case 'receiverFinishedMessage':\n {\n\n chatKeys.authenticated = true;\n\n value = (0, _utils.decode)(message.body.value);\n\n iv = (0, _utils.decodeToUint8Array)(value.iv);\n var data = (0, _utils.decodeToUint8Array)(value.value);\n hash = (0, _utils.decodeToUint8Array)(value.hash);\n\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, data, iv).then(function (decryptedData) {\n // log.log('decryptedData', decryptedData);\n chatKeys.handshakeHistory.receiverFinishedMessage = _this._filterMessageToHash(message, decryptedData + iv);\n\n var filteredMessage = _this._filterMessageToHash(message, decryptedData + iv);\n _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, hash).then(function (result) {\n\n // check if there was an initial message that was blocked and send it\n if (chatKeys.initialMessage) {\n\n var initialMessage = {\n type: 'create',\n to: message.from,\n from: message.to,\n body: {\n value: chatKeys.initialMessage.body.value\n }\n };\n\n resolve({ message: initialMessage, chatKeys: chatKeys });\n\n //sends the sessionKey to the subscriber hyperty\n } else {\n _this._sendReporterSessionKey(message, chatKeys).then(function (value) {\n\n resolve(value);\n }).catch(function (err) {\n reject('On _doHandShakePhase from receiverFinishedMessage error: ' + err);\n });\n }\n });\n });\n\n break;\n }\n\n case 'reporterSessionKey':\n {\n\n log.log('reporterSessionKey');\n\n var valueIVandHash = (0, _utils.decode)(message.body.value);\n hash = (0, _utils.decodeToUint8Array)(valueIVandHash.hash);\n iv = (0, _utils.decodeToUint8Array)(valueIVandHash.iv);\n var encryptedValue = (0, _utils.decodeToUint8Array)(valueIVandHash.value);\n var parsedValue = void 0;\n var sessionKey = void 0;\n var dataObjectURL = void 0;\n var receiverAcknowledgeMsg = void 0;\n\n //log.log('[IdentityModule reporterSessionKey] - decryptAES: ', chatKeys.keys.hypertyToSessionKey, encryptedValue, iv);\n\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, encryptedValue, iv).then(function (decryptedValue) {\n\n parsedValue = (0, _utils.decode)(decryptedValue);\n sessionKey = (0, _utils.decodeToUint8Array)(parsedValue.value);\n dataObjectURL = parsedValue.dataObjectURL;\n\n var messageToHash = _this._filterMessageToHash(message, decryptedValue + iv);\n\n return _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, messageToHash, hash);\n }).then(function (hashResult) {\n\n // log.log('hash successfully validated ', hashResult);\n\n _this.dataObjectSessionKeys[dataObjectURL] = { sessionKey: sessionKey, isToEncrypt: true };\n var dataObjectSessionKeysClone = (0, _utils.chatkeysToStringCloner)(_this.dataObjectSessionKeys);\n _this.storageManager.set('dataObjectSessionKeys', 0, dataObjectSessionKeysClone).catch(function (err) {\n reject('On _sendReporterSessionKey from method reporterSessionKey error: ' + err);\n });\n\n iv = _this.crypto.generateIV();\n value.iv = (0, _utils.encode)(iv);\n\n return _this.crypto.encryptAES(chatKeys.keys.hypertyFromSessionKey, 'ok!!', iv);\n }).then(function (encryptedValue) {\n\n receiverAcknowledgeMsg = {\n type: 'handshake',\n to: message.from,\n from: message.to,\n body: {\n handshakePhase: 'receiverAcknowledge'\n }\n };\n\n value.value = (0, _utils.encode)(encryptedValue);\n var messageToHash = _this._filterMessageToHash(receiverAcknowledgeMsg, 'ok!!' + iv, chatKeys.hypertyFrom.messageInfo);\n\n return _this.crypto.hashHMAC(chatKeys.keys.hypertyFromHashKey, messageToHash);\n }).then(function (hashedMessage) {\n var finalValue = (0, _utils.encode)({ value: value.value, hash: (0, _utils.encode)(hashedMessage), iv: value.iv });\n\n receiverAcknowledgeMsg.body.value = finalValue;\n resolve({ message: receiverAcknowledgeMsg, chatKeys: chatKeys });\n }).catch(function (err) {\n reject('On _doHandShakePhase from reporterSessionKey error: ' + err);\n });\n\n break;\n }\n\n case 'receiverAcknowledge':\n {\n\n log.log('receiverAcknowledge');\n\n var receivedvalueIVandHash = (0, _utils.decode)(message.body.value);\n var receivedHash = (0, _utils.decodeToUint8Array)(receivedvalueIVandHash.hash);\n iv = (0, _utils.decodeToUint8Array)(receivedvalueIVandHash.iv);\n var receivedEncryptedValue = (0, _utils.decodeToUint8Array)(receivedvalueIVandHash.value);\n\n _this.crypto.decryptAES(chatKeys.keys.hypertyToSessionKey, receivedEncryptedValue, iv).then(function (decryptedValue) {\n\n var filteredMessage = _this._filterMessageToHash(message, decryptedValue + iv);\n return _this.crypto.verifyHMAC(chatKeys.keys.hypertyToHashKey, filteredMessage, receivedHash);\n }).then(function (hashResult) {\n // log.log('hashResult ', hashResult);\n\n var callback = chatKeys.callback;\n\n if (callback) {\n callback('handShakeEnd');\n }\n resolve('handShakeEnd');\n }).catch(function (err) {\n reject('On _doHandShakePhase from receiverAcknowledge error: ' + err);\n });\n\n break;\n }\n\n default:\n reject(message);\n }\n });\n }\n\n /**\n * filter the messages to hash, by removing some fields not generated by the runtime core\n * @param {Message} message message\n * @param {String} decryptedValue (Optional) value from body.value in case it originally comes encrypted\n * @param {JSON} identity(Optional) add the hyperty identity associated in case is not added to the initial message\n * @return {Message} new message filtered\n */\n\n }, {\n key: '_filterMessageToHash',\n value: function _filterMessageToHash(message, decryptedValue, identity) {\n\n return {\n type: message.type,\n from: message.from,\n to: message.to,\n body: {\n identity: identity || message.body.identity,\n value: decryptedValue || message.body.value,\n handshakePhase: message.body.handshakePhase\n }\n };\n }\n\n /**\n * generates the initial structure for the keys between two users\n * @param {JSON} message initial message that triggers the mutual authentication\n * @param {String} userURL userURL\n * @param {boolean} receiver(Optional) indicates if is the sender or the receiver that creates a new chat crypto\n * @return {JSON} newChatCrypto new JSON structure for the chat crypto\n */\n\n }, {\n key: '_newChatCrypto',\n value: function _newChatCrypto(message, userURL, receiver) {\n var _this = this;\n\n //check whether is the sender or the receiver to create a new chatCrypto\n //to mantain consistency on the keys if the receiver create a new chatCrypto,\n //then invert the fields\n var from = receiver ? message.to : message.from;\n var to = receiver ? message.from : message.to;\n\n var userInfo = _this._idm.getIdentity(userURL);\n\n var newChatCrypto = {\n hypertyFrom: {\n hyperty: from,\n userID: userInfo.userProfile.userURL,\n\n //privateKey: \"getMyPublicKey\",\n //publicKey: \"getMyPrivateKey\",\n assertion: userInfo.assertion,\n messageInfo: userInfo\n },\n hypertyTo: {\n hyperty: to,\n userID: undefined,\n publicKey: undefined,\n assertion: undefined\n },\n keys: {\n hypertyToSessionKey: undefined,\n hypertyFromSessionKey: undefined,\n hypertyToHashKey: undefined,\n hypertyFromHashKey: undefined,\n toRandom: undefined,\n fromRandom: undefined,\n premasterKey: undefined,\n masterKey: undefined\n },\n handshakeHistory: {\n senderHello: undefined,\n receiverHello: undefined,\n senderCertificate: undefined,\n receiverFinishedMessage: undefined\n },\n initialMessage: message.body.ignore ? undefined : message,\n callback: message.callback,\n authenticated: false,\n dataObjectURL: message.dataObjectURL\n };\n\n return newChatCrypto;\n }\n\n /**\n * Retrieves a public keys given a user refrence. If no key is found,\n generates a new key asymmetric key and retrieves the public keys.\n * @param {userRef} String user reference for the key pair\n * @return {Array} public key\n */\n\n }, {\n key: 'getMyPublicKey',\n value: function getMyPublicKey() {\n var userRef = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.userDefaultKeyRef;\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.get(userRef).then(function (storedKeyPair) {\n if (storedKeyPair) {\n return resolve(storedKeyPair.public);\n }\n _this._generateAndStoreNewAsymetricKey(userRef).then(function (generatedKeyPair) {\n resolve(generatedKeyPair.public);\n }).catch(function (err) {\n log.error('[getMyPublicKey:_generateAndStoreNewAsymetricKey:err]: ' + err.message);\n reject(err);\n });\n }).catch(function (err) {\n log.error('[getMyPublicKey:storageManager:err]: ' + err.message);\n reject(err);\n });\n });\n }\n\n /**\n * Retrieves a private keys given a user refrence. If no key is found,\n generates a new key asymmetric key and retrieves the private key.\n * @param {userRef} String user reference for the key pair\n * @return {Array} private key\n **/\n\n }, {\n key: 'getMyPrivateKey',\n value: function getMyPrivateKey() {\n var userRef = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.userDefaultKeyRef;\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.get(userRef).then(function (storedKeyPair) {\n if (storedKeyPair) {\n return resolve(storedKeyPair.private);\n }\n _this._generateAndStoreNewAsymetricKey(userRef).then(function (generatedKeyPair) {\n resolve(generatedKeyPair.private);\n }).catch(function (err) {\n log.error('[getMyPrivateKey:_generateAndStoreNewAsymetricKey:err]: ' + err.message);\n reject(err);\n });\n }).catch(function (err) {\n log.error('[getMyPrivateKey:storageManager:err]: ' + err.message);\n reject(err);\n });\n });\n }\n\n /**\n * Generates a new key pair, stores and retrives the key pair.\n * @param {userRef} String user reference for the key pair\n * @return {Array} private key\n **/\n\n }, {\n key: '_generateAndStoreNewAsymetricKey',\n value: function _generateAndStoreNewAsymetricKey(userRef) {\n var _this = this;\n var keyPair = undefined;\n return new _promise2.default(function (resolve, reject) {\n _this.crypto.generateRSAKeyPair().then(function (generatedKeyPair) {\n log.log('_generateAndStoreNewAsymetricKey:userAsymmetricKeyGenerated', generatedKeyPair);\n keyPair = generatedKeyPair;\n return _this.storageManager.set(userRef, 0, generatedKeyPair);\n }).then(function (storedReference) {\n log.log('_generateAndStoreNewAsymetricKey:userAsymmetricKeySuccess', storedReference);\n resolve(keyPair);\n }).catch(function (err) {\n log.error('[_generateAndStoreNewAsymetricKey:err]: ' + err.message);\n reject(err);\n });\n });\n }\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n\n _this.addCryptoGUIListeners();\n }\n\n /**\n * return the coreDiscovery component\n */\n\n }, {\n key: 'coreDiscovery',\n get: function get() {\n var _this = this;\n return _this._coreDiscovery;\n }\n\n /**\n * return user's public key\n */\n\n /* getMyPublicKey() {\n // to be implemented\n return new Promise((resolve)=> {\n resolve('mypublickey');\n });\n }\n */\n /**\n * Set the coreDiscovery component\n * @param {coreDiscovery} coreDiscovery\n */\n ,\n set: function set(coreDiscovery) {\n var _this = this;\n _this._coreDiscovery = coreDiscovery;\n }\n\n /**\n * return the registry in this idModule\n * @param {registry} registry\n */\n\n }, {\n key: 'registry',\n get: function get() {\n var _this = this;\n return _this._registry;\n }\n\n /**\n * Set the registry in this idModule\n * @param {registry} reg\n */\n ,\n set: function set(registry) {\n var _this = this;\n _this._registry = registry;\n }\n }]);\n return CryptoManager;\n}();\n\n/*\nconst nodeJSKeyPairPopulate = { public: [48, 130, 1, 34, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 3, 130, 1, 15, 0, 48, 130, 1, 10, 2, 130, 1, 1, 0, 228, 43, 101, 12, 121, 7, 157, 71, 81, 58, 219, 32, 10, 108, 193, 179, 212, 116, 255, 59, 217, 32, 161, 201, 53, 171, 226, 199, 137, 202, 171, 60, 82, 53, 125, 62, 177, 126, 165, 24, 141, 30, 15, 226, 59, 107, 34, 7, 13, 149, 112, 125, 10, 230, 191, 156, 164, 177, 10, 185, 13, 66, 3, 217, 166, 244, 90, 119, 111, 27, 145, 104, 71, 189, 166, 226, 255, 133, 83, 151, 231, 101, 151, 89, 22, 19, 65, 154, 10, 53, 208, 218, 252, 219, 37, 50, 212, 86, 145, 107, 132, 90, 233, 202, 227, 108, 114, 141, 29, 73, 187, 31, 13, 234, 0, 232, 24, 191, 35, 149, 179, 138, 214, 159, 245, 162, 148, 221, 118, 17, 105, 89, 151, 146, 209, 55, 236, 61, 143, 233, 228, 10, 115, 8, 81, 197, 45, 123, 187, 223, 176, 254, 165, 69, 143, 29, 100, 114, 17, 130, 226, 223, 33, 11, 240, 81, 61, 172, 191, 157, 246, 202, 87, 131, 221, 88, 48, 127, 159, 119, 160, 152, 117, 61, 253, 174, 65, 214, 203, 218, 63, 50, 78, 160, 181, 221, 211, 128, 70, 178, 191, 170, 0, 13, 122, 173, 12, 203, 252, 4, 184, 225, 252, 7, 62, 96, 116, 15, 216, 158, 55, 85, 48, 16, 9, 206, 119, 74, 112, 243, 136, 84, 184, 223, 254, 101, 91, 61, 10, 91, 85, 192, 147, 144, 57, 29, 66, 238, 199, 244, 193, 194, 150, 232, 200, 107, 2, 3, 1, 0, 1],\n private: [48, 130, 4, 191, 2, 1, 0, 48, 13, 6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0, 4, 130, 4, 169, 48, 130, 4, 165, 2, 1, 0, 2, 130, 1, 1, 0, 228, 43, 101, 12, 121, 7, 157, 71, 81, 58, 219, 32, 10, 108, 193, 179, 212, 116, 255, 59, 217, 32, 161, 201, 53, 171, 226, 199, 137, 202, 171, 60, 82, 53, 125, 62, 177, 126, 165, 24, 141, 30, 15, 226, 59, 107, 34, 7, 13, 149, 112, 125, 10, 230, 191, 156, 164, 177, 10, 185, 13, 66, 3, 217, 166, 244, 90, 119, 111, 27, 145, 104, 71, 189, 166, 226, 255, 133, 83, 151, 231, 101, 151, 89, 22, 19, 65, 154, 10, 53, 208, 218, 252, 219, 37, 50, 212, 86, 145, 107, 132, 90, 233, 202, 227, 108, 114, 141, 29, 73, 187, 31, 13, 234, 0, 232, 24, 191, 35, 149, 179, 138, 214, 159, 245, 162, 148, 221, 118, 17, 105, 89, 151, 146, 209, 55, 236, 61, 143, 233, 228, 10, 115, 8, 81, 197, 45, 123, 187, 223, 176, 254, 165, 69, 143, 29, 100, 114, 17, 130, 226, 223, 33, 11, 240, 81, 61, 172, 191, 157, 246, 202, 87, 131, 221, 88, 48, 127, 159, 119, 160, 152, 117, 61, 253, 174, 65, 214, 203, 218, 63, 50, 78, 160, 181, 221, 211, 128, 70, 178, 191, 170, 0, 13, 122, 173, 12, 203, 252, 4, 184, 225, 252, 7, 62, 96, 116, 15, 216, 158, 55, 85, 48, 16, 9, 206, 119, 74, 112, 243, 136, 84, 184, 223, 254, 101, 91, 61, 10, 91, 85, 192, 147, 144, 57, 29, 66, 238, 199, 244, 193, 194, 150, 232, 200, 107, 2, 3, 1, 0, 1, 2, 130, 1, 0, 103, 244, 137, 118, 116, 82, 14, 203, 102, 107, 253, 88, 12, 199, 222, 60, 243, 136, 86, 157, 74, 224, 190, 53, 113, 57, 157, 250, 49, 130, 96, 31, 252, 136, 152, 70, 143, 17, 215, 96, 103, 51, 18, 35, 141, 212, 210, 205, 9, 216, 83, 70, 245, 71, 138, 119, 112, 229, 164, 176, 9, 37, 81, 161, 193, 154, 68, 249, 115, 106, 201, 6, 12, 225, 144, 126, 141, 210, 141, 242, 128, 159, 221, 163, 222, 21, 233, 230, 167, 206, 59, 24, 250, 233, 81, 122, 102, 26, 6, 233, 72, 133, 47, 77, 155, 238, 86, 6, 139, 24, 131, 163, 179, 112, 48, 247, 142, 6, 207, 204, 173, 223, 140, 199, 150, 95, 123, 152, 202, 155, 131, 238, 62, 96, 133, 4, 217, 51, 121, 30, 38, 178, 189, 216, 44, 35, 241, 93, 7, 62, 90, 111, 216, 66, 209, 243, 128, 234, 141, 84, 135, 181, 13, 38, 220, 114, 245, 240, 178, 95, 220, 206, 11, 186, 234, 213, 66, 121, 83, 68, 89, 75, 46, 183, 145, 183, 147, 160, 215, 118, 198, 125, 181, 146, 30, 251, 58, 87, 47, 209, 237, 97, 24, 47, 179, 6, 110, 242, 99, 150, 226, 148, 198, 174, 146, 101, 213, 87, 178, 10, 223, 105, 18, 56, 53, 22, 212, 158, 170, 176, 51, 86, 145, 125, 124, 44, 9, 85, 19, 144, 246, 170, 78, 124, 30, 32, 12, 166, 174, 139, 77, 63, 173, 82, 10, 153, 2, 129, 129, 0, 248, 18, 143, 246, 137, 136, 145, 219, 178, 39, 27, 94, 64, 90, 47, 163, 114, 60, 63, 187, 131, 143, 244, 16, 42, 128, 231, 117, 92, 98, 219, 155, 62, 107, 252, 17, 245, 45, 160, 225, 103, 142, 72, 36, 193, 150, 235, 214, 175, 62, 212, 56, 45, 9, 0, 60, 114, 107, 134, 228, 204, 131, 131, 214, 94, 201, 148, 159, 99, 139, 181, 13, 119, 38, 30, 107, 166, 165, 203, 43, 34, 20, 207, 171, 32, 58, 167, 62, 196, 153, 103, 204, 213, 247, 48, 111, 227, 59, 95, 97, 194, 187, 53, 10, 247, 108, 58, 86, 28, 29, 113, 8, 110, 171, 220, 245, 11, 82, 233, 223, 91, 68, 166, 117, 174, 187, 62, 77, 2, 129, 129, 0, 235, 118, 2, 105, 239, 212, 30, 104, 157, 41, 109, 11, 248, 152, 22, 236, 97, 40, 153, 131, 228, 5, 86, 187, 113, 126, 144, 76, 141, 79, 110, 250, 146, 152, 49, 58, 156, 201, 176, 92, 189, 209, 30, 112, 108, 175, 204, 204, 247, 164, 46, 129, 239, 98, 127, 49, 145, 218, 63, 193, 124, 174, 18, 98, 201, 99, 154, 162, 138, 78, 159, 253, 3, 248, 3, 209, 36, 239, 193, 155, 193, 5, 19, 236, 37, 78, 118, 135, 250, 199, 7, 141, 248, 120, 36, 136, 93, 98, 174, 60, 18, 215, 93, 174, 107, 141, 116, 145, 167, 221, 210, 169, 247, 67, 254, 222, 161, 134, 63, 221, 90, 87, 42, 99, 227, 81, 173, 151, 2, 129, 129, 0, 133, 23, 168, 103, 83, 232, 146, 160, 181, 23, 40, 38, 204, 13, 214, 203, 49, 41, 195, 227, 189, 181, 8, 243, 119, 106, 75, 67, 250, 250, 10, 234, 98, 118, 26, 250, 35, 121, 132, 124, 10, 76, 26, 198, 165, 154, 108, 19, 117, 88, 23, 17, 192, 143, 184, 177, 181, 141, 157, 4, 185, 248, 193, 77, 204, 243, 7, 170, 240, 4, 111, 113, 183, 0, 27, 136, 20, 19, 149, 74, 33, 241, 218, 108, 236, 80, 171, 148, 16, 116, 97, 109, 83, 74, 88, 145, 94, 239, 102, 192, 19, 114, 207, 5, 128, 51, 111, 164, 237, 86, 154, 99, 52, 197, 62, 57, 182, 6, 152, 245, 61, 137, 58, 105, 159, 2, 84, 109, 2, 129, 129, 0, 226, 67, 111, 132, 95, 91, 101, 177, 63, 189, 44, 53, 193, 184, 92, 230, 223, 98, 133, 74, 209, 86, 52, 7, 65, 195, 206, 100, 81, 178, 144, 65, 167, 151, 42, 79, 89, 149, 18, 173, 188, 21, 244, 251, 49, 230, 41, 150, 153, 46, 35, 38, 231, 99, 174, 56, 115, 32, 215, 253, 85, 147, 108, 197, 147, 34, 236, 216, 222, 177, 57, 90, 136, 114, 207, 48, 46, 31, 90, 220, 18, 58, 143, 239, 111, 214, 27, 95, 6, 36, 53, 229, 62, 108, 45, 39, 1, 30, 47, 178, 56, 164, 206, 56, 42, 208, 46, 193, 61, 31, 147, 45, 147, 23, 187, 22, 50, 255, 111, 229, 132, 199, 152, 75, 142, 136, 209, 151, 2, 129, 129, 0, 165, 56, 232, 76, 55, 57, 240, 159, 92, 207, 220, 143, 130, 30, 57, 234, 251, 172, 171, 180, 54, 159, 229, 96, 246, 73, 112, 146, 75, 157, 242, 201, 161, 218, 37, 176, 35, 170, 50, 90, 148, 102, 191, 199, 239, 174, 78, 72, 67, 85, 199, 45, 149, 145, 132, 161, 212, 33, 157, 75, 216, 79, 39, 233, 18, 210, 255, 26, 72, 229, 239, 44, 12, 147, 158, 176, 192, 95, 126, 32, 175, 23, 226, 131, 139, 197, 175, 193, 62, 8, 151, 252, 68, 154, 94, 89, 189, 125, 90, 30, 36, 175, 73, 230, 194, 13, 233, 247, 123, 60, 241, 47, 171, 51, 189, 112, 111, 213, 141, 89, 70, 249, 236, 63, 236, 110, 115, 208]};\n*/\n\nexports.default = new CryptoManager();\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jcnlwdG9NYW5hZ2VyL0NyeXB0b01hbmFnZXIuanM/ZDliYyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBMb2cgU3lzdGVtXG5pbXBvcnQgKiBhcyBsb2dnZXIgZnJvbSAnbG9nbGV2ZWwnO1xubGV0IGxvZyA9IGxvZ2dlci5nZXRMb2dnZXIoJ0NyeXB0b01hbmFnZXInKTtcblxuaW1wb3J0IHtkaXZpZGVVUkwsIGlzRGF0YU9iamVjdFVSTCwgaXNMZWdhY3ksIGNoYXRrZXlzVG9TdHJpbmdDbG9uZXIsIGNoYXRrZXlzVG9BcnJheUNsb25lciwgcGFyc2VNZXNzYWdlVVJMLFxuICBwYXJzZSwgc3RyaW5naWZ5LCBlbmNvZGUsIGRlY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c2Vzc2lvbktleSwgZmlsdGVyZWRNZXNzYWdlLCBoYXNoKS50aGVuKHJlc3VsdCA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxvZy5sb2coJ1JlY2VpdmVkIG1lc3NhZ2UgSE1BQyByZXN1bHQnLCByZXN1bHQpO1xuXG4gICAgICAgICAgICAgICAgICAgIG1lc3NhZ2UuYm9keS5hc3NlcnRlZElkZW50aXR5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZShtZXNzYWdlKTtcbiAgICAgICAgICAgICAgICAgIH0pLmNhdGNoKGVyciA9PiB7IHJlamVjdCgnTWVzc2FnZSBITUFDIGlzIGludmFsaWQ6ICcgKyBlcnIpOyB9KTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgIC8vaWYgbm90LCBqdXN0IHJldHVybiB0aGUgbWVzc2FnZVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIG1lc3NhZ2UuYm9keS5hc3NlcnRlZElkZW50aXR5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKG1lc3NhZ2UpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIG1lc3NhZ2UuYm9keS5hc3NlcnRlZElkZW50aXR5ID0gdHJ1ZTtcbiAgICAgICAgICAgICAgcmVzb2x2ZShtZXNzYWdlKTtcblxuICAgICAgICAgICAgICAvL3JlamVjdCgnbm8gc2Vzc2lvbktleSBmb3IgY2hhdCByb29tIGZvdW5kJyk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZWplY3QoJ3dyb25nIG1lc3NhZ2UgdG8gZGVjcnlwdCcpO1xuICAgICAgICB9XG4gICAgICB9KTtcblxuICAgIH0pO1xuICB9XG5cbiAgZGVjcnlwdERhdGFPYmplY3QoZGF0YU9i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ICB2YWx1ZS5hc3N5bWV0cmljRW5jcnlwdGlvbiA9IGVuY29kZShlbmNyeXB0ZWRWYWx1ZSk7XG5cbiAgICAgICAgICAgIGxldCBtZXNzYWdlU3RydWN0dXJlID0ge1xuICAgICAgICAgICAgICB0eXBlOiAnaGFuZHNoYWtlJyxcbiAgICAgICAgICAgICAgdG86IG1lc3NhZ2UuZnJvbSxcbiAgICAgICAgICAgICAgZnJvbTogbWVzc2FnZS50byxcbiAgICAgICAgICAgICAgYm9keToge1xuICAgICAgICAgICAgICAgIGhhbmRzaGFrZVBoYXNlOiAnc2VuZGVyQ2VydGlmaWNhdGUnXG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGxldCBtZXNzYWdlVG9IYXNoID0gX3RoaXMuX2ZpbHRlck1lc3NhZ2VUb0hhc2gobWVzc2FnZVN0cnVjdHVyZSwgY2hhdEtleXMua2V5cy5wcmVtYXN0ZXJLZXksIGNoYXRLZXlzLmh5cGVydHlGcm9tLm1lc3NhZ2VJbmZvKTtcbiAgICAgICAgICAgIHJldHVybiBfdGhpcy5jcnlwdG8uc2lnblJTQShwcml2YXRlS2V5SG9sZGVyLCBlbmNvZGUoY2hhdEtleXMuaGFuZHNoYWtlSGlzdG9yeSkgKyBlbmNvZGUobWVzc2FnZVRvSGFzaCkpO1xuICAgICAgICAgIH0pLnRoZW4oc2lnbmF0dXJlID0+IHtcblxuICAgICAgICAgICAgdmFsdWUuc2lnbmF0dXJlID0gZW5jb2RlKHNpZ25hdHVyZSk7XG5cbiAgICAgICAgICAgIGxldCByZWNlaXZlckhlbGxvTXNnID0ge1xuICAgICAgICAgICAgICB0eXBlOiAnaGFuZHNoYWtlJyxcbiAgICAgICAgICAgICAgdG86IG1lc3NhZ2UuZnJvbSxcbiAgICAgICAgICAgICAgZnJvbTogbWVzc2FnZS50byxcbiAgICAgICAgICAgICAgYm9keToge1xuICAgICAgICAgICAgICAgIGhhbmRzaGFrZVBoYXNlO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hbE1lc3NhZ2UpIHtcblxuICAgICAgICAgICAgICAgIGxldCBpbml0aWFsTWVzc2FnZSA9IHtcbiAgICAgICAgICAgICAgICAgIHR5cGU6ICdjcmVhdGUnLFxuICAgICAgICAgICAgICAgICAgdG86IG1lc3NhZ2UuZnJvbSxcbiAgICAgICAgICAgICAgICAgIGZyb206IG1lc3NhZ2UudG8sXG4gICAgICAgICAgICAgICAgICBib2R5OiB7XG4gICAgICAgICAgICAgICAgICAgIHZhbHVlOiBjaGF0S2V5cy5pbml0aWFsTWVzc2FnZS5ib2R5LnZhbHVlXG4gICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHJlc29sdmUoe21lc3NhZ2U6IGluaXRpYWxNZXNzYWdlLCBjaGF0S2V5czogY2hhdEtleXN9KTtcblxuICAgICAgICAgICAgICAgIC8vc2VuZHMgdGhlIHNlc3Npb25LZXkgdG8gdGhlIHN1YnNjcmliZXIgaHlwZXJ0eVxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIF90aGlzLl9zZW5kUmVwb3J0ZXJTZXNzaW9uS2V5KG1lc3NhZ2UsIGNoYXRLZXlzKS50aGVuKHZhbHVlID0+IHtcblxuICAgICAgICAgICAgICAgICAgcmVzb2x2ZSh2YWx1ZSk7XG4gICAgICAgICAgICAgICAgfSkuY2F0Y2goZXJyID0+IHtcbiAgICAgICAgICAgICAgICAgIHJlamVjdCgnT24gX2RvSGFuZFNoYWtlUGhhc2UgZnJvbSByZWNlaXZlckZpbmlzaGVkTWVzc2FnZSBlcnJvcjogJyArIGVycik7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgYnJlYWs7XG4gICAgICAgIH1cblxuICAgICAgICBjYXNlICdyZXBvcnRlclNlc3Npb25LZXknOiB7XG5cbiAgICAgICAgICBsb2cubG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tleTogXCJnZXRNeVB1YmxpY0tleVwiLFxuICAgICAgICAgIC8vcHVibGljS2V5OiBcImdldE15UHJpdmF0ZUtleVwiLFxuICAgICAgICAgIGFzc2VydGlvbjogdXNlckluZm8uYXNzZXJ0aW9uLFxuICAgICAgICAgIG1lc3NhZ2VJbmZvOiB1c2VySW5mb1xuICAgICAgICB9LFxuICAgICAgICBoeXBlcnR5VG86XG4gICAgICAgIHtcbiAgICAgICAgICBoeXBlcnR5OiB0byxcbiAgICAgICAgICB1c2VySUQ6IHVuZGVmaW5lZCxcbiAgICAgICAgICBwdWJsaWNLZXk6IHVuZGVmaW5lZCxcbiAgICAgICAgICBhc3NlcnRpb246IHVuZGVmaW5lZFxuICAgICAgICB9LFxuICAgICAgICBrZXlzOlxuICAgICAgICB7XG4gICAgICAgICAgaHlwZXJ0eVRvU2Vzc2lvbktleTogdW5kZWZpbmVkLFxuICAgICAgICAgIGh5cGVydHlGcm9tU2Vzc2lvbktleTogdW5kZWZpbmVkLFxuICAgICAgICAgIGh5cGVydHlUb0hhc2hLZXk6IHVuZGVmaW5lZCxcbiAgICAgICAgICBoeXBlcnR5RnJvbUhhc2hLZXk6IHVuZGVmaW5lZCxcbiAgICAgICAgICB0b1JhbmRvbTogdW5kZWZpbmVkLFxuICAgICAgICAgIGZyb21SYW5kb206IHVuZGVmaW5lZCxcbiAgICAgICAgICBwcmVtYXN0ZXJLZXk6IHVuZGVmaW5lZCxcbiAgICAgICAgICBtYXN0ZXJLZXk6IHVuZGVmaW5lZFxuICAgICAgICB9LFxuICAgICAgICBoYW5kc2hha2VIaXN0b3J5OiB7XG4gICAgICAgICAgc2VuZGVySGVsbG86IHVuZGVmaW5lZCxcbiAgICAgICAgICByZWNlaXZlckhlbGxvOiB1bmRlZmluZWQsXG4gICAgICAgICAgc2VuZGVyQ2VydGlmaWNhdGU6IHVuZGVmaW5lZCxcbiAgICAgICAgICByZWNlaXZlckZpbmlzaGVkTWVzc2FnZTogdW5kZWZpbmVkXG4gIC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UNBO0FBdENBO0FBQ0E7QUF3Q0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7OztBQU1BO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7OztBQU1BO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBNTBDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7O0FBSUE7Ozs7Ozs7QUFTQTs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBa3hDQTs7Ozs7QUFLQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///105\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar document = __webpack_require__(7).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZG9tLWNyZWF0ZS5qcz84ZTFjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGRvY3VtZW50ID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuZG9jdW1lbnQ7XG4vLyB0eXBlb2YgZG9jdW1lbnQuY3JlYXRlRWxlbWVudCBpcyAnb2JqZWN0JyBpbiBvbGQgSUVcbnZhciBpcyA9IGlzT2JqZWN0KGRvY3VtZW50KSAmJiBpc09iamVjdChkb2N1bWVudC5jcmVhdGVFbGVtZW50KTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpcyA/IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoaXQpIDoge307XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19kb20tY3JlYXRlLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///106\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar core = __webpack_require__(32);\nvar LIBRARY = __webpack_require__(48);\nvar wksExt = __webpack_require__(156);\nvar defineProperty = __webpack_require__(13).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fd2tzLWRlZmluZS5qcz9kZTBmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIExJQlJBUlkgPSByZXF1aXJlKCcuL19saWJyYXJ5Jyk7XG52YXIgd2tzRXh0ID0gcmVxdWlyZSgnLi9fd2tzLWV4dCcpO1xudmFyIGRlZmluZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG5hbWUpIHtcbiAgdmFyICRTeW1ib2wgPSBjb3JlLlN5bWJvbCB8fCAoY29yZS5TeW1ib2wgPSBMSUJSQVJZID8ge30gOiBnbG9iYWwuU3ltYm9sIHx8IHt9KTtcbiAgaWYgKG5hbWUuY2hhckF0KDApICE9ICdfJyAmJiAhKG5hbWUgaW4gJFN5bWJvbCkpIGRlZmluZVByb3BlcnR5KCRTeW1ib2wsIG5hbWUsIHsgdmFsdWU6IHdrc0V4dC5mKG5hbWUpIH0pO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fd2tzLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMTA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///107\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(83)('keys');\nvar uid = __webpack_require__(53);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2hhcmVkLWtleS5qcz85OTkzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBzaGFyZWQgPSByZXF1aXJlKCcuL19zaGFyZWQnKSgna2V5cycpO1xudmFyIHVpZCA9IHJlcXVpcmUoJy4vX3VpZCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoa2V5KSB7XG4gIHJldHVybiBzaGFyZWRba2V5XSB8fCAoc2hhcmVkW2tleV0gPSB1aWQoa2V5KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zaGFyZWQta2V5LmpzXG4vLyBtb2R1bGUgaWQgPSAxMDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///108\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZW51bS1idWcta2V5cy5qcz80MGE1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIElFIDgtIGRvbid0IGVudW0gYnVnIGtleXNcbm1vZHVsZS5leHBvcnRzID0gKFxuICAnY29uc3RydWN0b3IsaGFzT3duUHJvcGVydHksaXNQcm90b3R5cGVPZixwcm9wZXJ0eUlzRW51bWVyYWJsZSx0b0xvY2FsZVN0cmluZyx0b1N0cmluZyx2YWx1ZU9mJ1xuKS5zcGxpdCgnLCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAxMDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///109\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(7).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faHRtbC5qcz83NzRlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkb2N1bWVudCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmRvY3VtZW50O1xubW9kdWxlLmV4cG9ydHMgPSBkb2N1bWVudCAmJiBkb2N1bWVudC5kb2N1bWVudEVsZW1lbnQ7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2h0bWwuanNcbi8vIG1vZHVsZSBpZCA9IDExMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///110\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(9);\nvar anObject = __webpack_require__(5);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(33)(Function.call, __webpack_require__(29).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2V0LXByb3RvLmpzPzgyZjAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gV29ya3Mgd2l0aCBfX3Byb3RvX18gb25seS4gT2xkIHY4IGNhbid0IHdvcmsgd2l0aCBudWxsIHByb3RvIG9iamVjdHMuXG4vKiBlc2xpbnQtZGlzYWJsZSBuby1wcm90byAqL1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXI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ZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zZXQtcHJvdG8uanNcbi8vIG1vZHVsZSBpZCA9IDExMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///111\n")},function(module,exports){eval("module.exports = '\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003' +\n '\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXdzLmpzPzVkZGIiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSAnXFx4MDlcXHgwQVxceDBCXFx4MENcXHgwRFxceDIwXFx4QTBcXHUxNjgwXFx1MTgwRVxcdTIwMDBcXHUyMDAxXFx1MjAwMlxcdTIwMDMnICtcbiAgJ1xcdTIwMDRcXHUyMDA1XFx1MjAwNlxcdTIwMDdcXHUyMDA4XFx1MjAwOVxcdTIwMEFcXHUyMDJGXFx1MjA1RlxcdTMwMDBcXHUyMDI4XFx1MjAyOVxcdUZFRkYnO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19zdHJpbmctd3MuanNcbi8vIG1vZHVsZSBpZCA9IDExMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///112\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar setPrototypeOf = __webpack_require__(111).set;\nmodule.exports = function (that, target, C) {\n var S = target.constructor;\n var P;\n if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {\n setPrototypeOf(that, P);\n } return that;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faW5oZXJpdC1pZi1yZXF1aXJlZC5qcz85MjI3Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIHNldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fc2V0LXByb3RvJykuc2V0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGhhdCwgdGFyZ2V0LCBDKSB7XG4gIHZhciBTID0gdGFyZ2V0LmNvbnN0cnVjdG9yO1xuICB2YXIgUDtcbiAgaWYgKFMgIT09IEMgJiYgdHlwZW9mIFMgPT0gJ2Z1bmN0aW9uJyAmJiAoUCA9IFMucHJvdG90eXBlKSAhPT0gQy5wcm90b3R5cGUgJiYgaXNPYmplY3QoUCkgJiYgc2V0UHJvdG90eXBlT2YpIHtcbiAgICBzZXRQcm90b3R5cGVPZih0aGF0LCBQKTtcbiAgfSByZXR1cm4gdGhhdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2luaGVyaXQtaWYtcmVxdWlyZWQuanNcbi8vIG1vZHVsZSBpZCA9IDExM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///113\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar toInteger = __webpack_require__(38);\nvar defined = __webpack_require__(37);\n\nmodule.exports = function repeat(count) {\n var str = String(defined(this));\n var res = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError(\"Count can't be negative\");\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;\n return res;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXJlcGVhdC5qcz9jNDA3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiByZXBlYXQoY291bnQpIHtcbiAgdmFyIHN0ciA9IFN0cmluZyhkZWZpbmVkKHRoaXMpKTtcbiAgdmFyIHJlcyA9ICcnO1xuICB2YXIgbiA9IHRvSW50ZWdlcihjb3VudCk7XG4gIGlmIChuIDwgMCB8fCBuID09IEluZmluaXR5KSB0aHJvdyBSYW5nZUVycm9yKFwiQ291bnQgY2FuJ3QgYmUgbmVnYXRpdmVcIik7XG4gIGZvciAoO24gPiAwOyAobiA+Pj49IDEpICYmIChzdHIgKz0gc3RyKSkgaWYgKG4gJiAxKSByZXMgKz0gc3RyO1xuICByZXR1cm4gcmVzO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLXJlcGVhdC5qc1xuLy8gbW9kdWxlIGlkID0gMTE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///114\n")},function(module,exports){eval("// 20.2.2.28 Math.sign(x)\nmodule.exports = Math.sign || function sign(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zaWduLmpzPzczMDkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjI4IE1hdGguc2lnbih4KVxubW9kdWxlLmV4cG9ydHMgPSBNYXRoLnNpZ24gfHwgZnVuY3Rpb24gc2lnbih4KSB7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgcmV0dXJuICh4ID0gK3gpID09IDAgfHwgeCAhPSB4ID8geCA6IHggPCAwID8gLTEgOiAxO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zaWduLmpzXG4vLyBtb2R1bGUgaWQgPSAxMTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///115\n")},function(module,exports){eval("// 20.2.2.14 Math.expm1(x)\nvar $expm1 = Math.expm1;\nmodule.exports = (!$expm1\n // Old FF bug\n || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168\n // Tor Browser bug\n || $expm1(-2e-17) != -2e-17\n) ? function expm1(x) {\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;\n} : $expm1;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1leHBtMS5qcz9jN2JmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xNCBNYXRoLmV4cG0xKHgpXG52YXIgJGV4cG0xID0gTWF0aC5leHBtMTtcbm1vZHVsZS5leHBvcnRzID0gKCEkZXhwbTFcbiAgLy8gT2xkIEZGIGJ1Z1xuICB8fCAkZXhwbTEoMTApID4gMjIwMjUuNDY1Nzk0ODA2NzE5IHx8ICRleHBtMSgxMCkgPCAyMjAyNS40NjU3OTQ4MDY3MTY1MTY4XG4gIC8vIFRvciBCcm93c2VyIGJ1Z1xuICB8fCAkZXhwbTEoLTJlLTE3KSAhPSAtMmUtMTdcbikgPyBmdW5jdGlvbiBleHBtMSh4KSB7XG4gIHJldHVybiAoeCA9ICt4KSA9PSAwID8geCA6IHggPiAtMWUtNiAmJiB4IDwgMWUtNiA/IHggKyB4ICogeCAvIDIgOiBNYXRoLmV4cCh4KSAtIDE7XG59IDogJGV4cG0xO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tYXRoLWV4cG0xLmpzXG4vLyBtb2R1bGUgaWQgPSAxMTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///116\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(38);\nvar defined = __webpack_require__(37);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWF0LmpzP2UzZGEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHRvSW50ZWdlciA9IHJlcXVpcmUoJy4vX3RvLWludGVnZXInKTtcbnZhci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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///117\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(48);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(24);\nvar hide = __webpack_require__(23);\nvar Iterators = __webpack_require__(66);\nvar $iterCreate = __webpack_require__(119);\nvar setToStringTag = __webpack_require__(64);\nvar getPrototypeOf = __webpack_require__(30);\nvar ITERATOR = __webpack_require__(10)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1kZWZpbmUuanM/YjljZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgTElCUkFSWSA9IHJlcXVpcmUoJy4vX2xpYnJhcnknKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIGhpZGUgPSByZXF1aXJlKCcuL19oaWRlJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG52YXIgJGl0ZXJDcmVhdGUgPSByZXF1aXJlKCcuL19pdGVyLWNyZWF0ZScpO1xudmFyIHNldFRvU3RyaW5nVGFnID0gcmVxdWlyZSgnLi9fc2V0LXRvLXN0cmluZy10YWcnKTtcbnZhciBnZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcbnZhciBJV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VNfQlVHKSwgTkFNRSwgbWV0aG9kcyk7XG4gIH1cbiAgcmV0dXJuIG1ldGhvZHM7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pdGVyLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMTE4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///118\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(56);\nvar descriptor = __webpack_require__(52);\nvar setToStringTag = __webpack_require__(64);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(23)(IteratorPrototype, __webpack_require__(10)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1jcmVhdGUuanM/MjExMiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgY3JlYXRlID0gcmVxdWlyZSgnLi9fb2JqZWN0LWNyZWF0ZScpO1xudmFyIGRlc2NyaXB0b3IgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG52YXIgc2V0VG9TdHJpbmdUYWcgPSByZXF1aXJlKCcuL19zZXQtdG8tc3RyaW5nLXRhZycpO1xudmFyIEl0ZXJhdG9yUHJvdG90eXBlID0ge307XG5cbi8vIDI1LjEuMi4xLjEgJUl0ZXJhdG9yUHJvdG90eXBlJVtAQGl0ZXJhdG9yXSgpXG5yZXF1aXJlKCcuL19oaWRlJykoSXRlcmF0b3JQcm90b3R5cGUsIHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpLCBmdW5jdGlvbiAoKSB7IHJldHVybiB0aGlzOyB9KTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoQ29uc3RydWN0b3IsIE5BTUUsIG5leHQpIHtcbiAgQ29uc3RydWN0b3IucHJvdG90eXBlID0gY3JlYXRlKEl0ZXJhdG9yUHJvdG90eXBlLCB7IG5leHQ6IGRlc2NyaXB0b3IoMSwgbmV4dCkgfSk7XG4gIHNldFRvU3RyaW5nVGFnKENvbnN0cnVjdG9yLCBOQU1FICsgJyBJdGVyYXRvcicpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDExOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///119\n")},function(module,exports,__webpack_require__){eval("// helper for String#{startsWith, endsWith, includes}\nvar isRegExp = __webpack_require__(87);\nvar defined = __webpack_require__(37);\n\nmodule.exports = function (that, searchString, NAME) {\n if (isRegExp(searchString)) throw TypeError('String#' + NAME + \" doesn't accept regex!\");\n return String(defined(that));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc3RyaW5nLWNvbnRleHQuanM/OTJhYSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBoZWxwZXIgZm9yIFN0cmluZyN7c3RhcnRzV2l0aCwgZW5kc1dpdGgsIGluY2x1ZGVzfVxudmFyIGlzUmVnRXhwID0gcmVxdWlyZSgnLi9faXMtcmVnZXhwJyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGhhdCwgc2VhcmNoU3RyaW5nLCBOQU1FKSB7XG4gIGlmIChpc1JlZ0V4cChzZWFyY2hTdHJpbmcpKSB0aHJvdyBUeXBlRXJyb3IoJ1N0cmluZyMnICsgTkFNRSArIFwiIGRvZXNuJ3QgYWNjZXB0IHJlZ2V4IVwiKTtcbiAgcmV0dXJuIFN0cmluZyhkZWZpbmVkKHRoYXQpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3N0cmluZy1jb250ZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAxMjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///120\n")},function(module,exports,__webpack_require__){eval("var MATCH = __webpack_require__(10)('match');\nmodule.exports = function (KEY) {\n var re = /./;\n try {\n '/./'[KEY](re);\n } catch (e) {\n try {\n re[MATCH] = false;\n return !'/./'[KEY](re);\n } catch (f) { /* empty */ }\n } return true;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZmFpbHMtaXMtcmVnZXhwLmpzP2Q0NDQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIE1BVENIID0gcmVxdWlyZSgnLi9fd2tzJykoJ21hdGNoJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVkpIHtcbiAgdmFyIHJlID0gLy4vO1xuICB0cnkge1xuICAgICcvLi8nW0tFWV0ocmUpO1xuICB9IGNhdGNoIChlKSB7XG4gICAgdHJ5IHtcbiAgICAgIHJlW01BVENIXSA9IGZhbHNlO1xuICAgICAgcmV0dXJuICEnLy4vJ1tLRVldKHJlKTtcbiAgICB9IGNhdGNoIChmKSB7IC8qIGVtcHR5ICovIH1cbiAgfSByZXR1cm4gdHJ1ZTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZhaWxzLWlzLXJlZ2V4cC5qc1xuLy8gbW9kdWxlIGlkID0gMTIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///121\n")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(66);\nvar ITERATOR = __webpack_require__(10)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXMtYXJyYXktaXRlci5qcz9mNmY2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGNoZWNrIG9uIGRlZmF1bHQgQXJyYXkgaXRlcmF0b3JcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEFycmF5UHJvdG8gPSBBcnJheS5wcm90b3R5cGU7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHJldHVybiBpdCAhPT0gdW5kZWZpbmVkICYmIChJdGVyYXRvcnMuQXJyYXkgPT09IGl0IHx8IEFycmF5UHJvdG9bSVRFUkFUT1JdID09PSBpdCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1hcnJheS1pdGVyLmpzXG4vLyBtb2R1bGUgaWQgPSAxMjJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///122\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $defineProperty = __webpack_require__(13);\nvar createDesc = __webpack_require__(52);\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY3JlYXRlLXByb3BlcnR5LmpzPzZkMjMiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGNyZWF0ZURlc2MgPSByZXF1aXJlKCcuL19wcm9wZXJ0eS1kZXNjJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG9iamVjdCwgaW5kZXgsIHZhbHVlKSB7XG4gIGlmIChpbmRleCBpbiBvYmplY3QpICRkZWZpbmVQcm9wZXJ0eS5mKG9iamVjdCwgaW5kZXgsIGNyZWF0ZURlc2MoMCwgdmFsdWUpKTtcbiAgZWxzZSBvYmplY3RbaW5kZXhdID0gdmFsdWU7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19jcmVhdGUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDEyM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///123\n")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(75);\nvar ITERATOR = __webpack_require__(10)('iterator');\nvar Iterators = __webpack_require__(66);\nmodule.exports = __webpack_require__(32).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QuanM/NDg3NyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY2xhc3NvZiA9IHJlcXVpcmUoJy4vX2NsYXNzb2YnKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19jb3JlJykuZ2V0SXRlcmF0b3JNZXRob2QgPSBmdW5jdGlvbiAoaXQpIHtcbiAgaWYgKGl0ICE9IHVuZGVmaW5lZCkgcmV0dXJuIGl0W0lURVJBVE9SXVxuICAgIHx8IGl0WydAQGl0ZXJhdG9yJ11cbiAgICB8fCBJdGVyYXRvcnNbY2xhc3NvZihpdCldO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QuanNcbi8vIG1vZHVsZSBpZCA9IDEyNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///124\n")},function(module,exports,__webpack_require__){eval("// 9.4.2.3 ArraySpeciesCreate(originalArray, length)\nvar speciesConstructor = __webpack_require__(318);\n\nmodule.exports = function (original, length) {\n return new (speciesConstructor(original))(length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktc3BlY2llcy1jcmVhdGUuanM/YTY1NCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA5LjQuMi4zIEFycmF5U3BlY2llc0NyZWF0ZShvcmlnaW5hbEFycmF5LCBsZW5ndGgpXG52YXIgc3BlY2llc0NvbnN0cnVjdG9yID0gcmVxdWlyZSgnLi9fYXJyYXktc3BlY2llcy1jb25zdHJ1Y3RvcicpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvcmlnaW5hbCwgbGVuZ3RoKSB7XG4gIHJldHVybiBuZXcgKHNwZWNpZXNDb25zdHJ1Y3RvcihvcmlnaW5hbCkpKGxlbmd0aCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1zcGVjaWVzLWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTI1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///125\n")},function(module,exports,__webpack_require__){"use strict";eval("// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\n\nvar toObject = __webpack_require__(19);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\nmodule.exports = function fill(value /* , start = 0, end = @length */) {\n var O = toObject(this);\n var length = toLength(O.length);\n var aLen = arguments.length;\n var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);\n var end = aLen > 2 ? arguments[2] : undefined;\n var endPos = end === undefined ? length : toAbsoluteIndex(end, length);\n while (endPos > index) O[index++] = value;\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktZmlsbC5qcz9jYzI2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIyLjEuMy42IEFycmF5LnByb3RvdHlwZS5maWxsKHZhbHVlLCBzdGFydCA9IDAsIGVuZCA9IHRoaXMubGVuZ3RoKVxuJ3VzZSBzdHJpY3QnO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBmaWxsKHZhbHVlIC8qICwgc3RhcnQgPSAwLCBlbmQgPSBAbGVuZ3RoICovKSB7XG4gIHZhciBPID0gdG9PYmplY3QodGhpcyk7XG4gIHZhciBsZW5ndGggPSB0b0xlbmd0aChPLmxlbmd0aCk7XG4gIHZhciBhTGVuID0gYXJndW1lbnRzLmxlbmd0aDtcbiAgdmFyIGluZGV4ID0gdG9BYnNvbHV0ZUluZGV4KGFMZW4gPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkLCBsZW5ndGgpO1xuICB2YXIgZW5kID0gYUxlbiA+IDIgPyBhcmd1bWVudHNbMl0gOiB1bmRlZmluZWQ7XG4gIHZhciBlbmRQb3MgPSBlbmQgPT09IHVuZGVmaW5lZCA/IGxlbmd0aCA6IHRvQWJzb2x1dGVJbmRleChlbmQsIGxlbmd0aCk7XG4gIHdoaWxlIChlbmRQb3MgPiBpbmRleCkgT1tpbmRleCsrXSA9IHZhbHVlO1xuICByZXR1cm4gTztcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2FycmF5LWZpbGwuanNcbi8vIG1vZHVsZSBpZCA9IDEyNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///126\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(49);\nvar step = __webpack_require__(172);\nvar Iterators = __webpack_require__(66);\nvar toIObject = __webpack_require__(28);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(118)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaXRlcmF0b3IuanM/NWEwNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgYWRkVG9VbnNjb3BhYmxlcyA9IHJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpO1xudmFyIHN0ZXAgPSByZXF1aXJlKCcuL19pdGVyLXN0ZXAnKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG5cbi8vIDIyLjEuMy40IEFycmF5LnByb3RvdHlwZS5lbnRyaWVzKClcbi8vIDIyLjEuMy4xMyBBcnJheS5wcm90b3R5cGUua2V5cygpXG4vLyAyMi4xLjMuMjkgQXJyYXkucHJvdG90eXBlLnZhbHVlcygpXG4vLyAyMi4xLjMuMzAgQXJyYXkucHJvdG90eXBlW0BAaXR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Ly8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gMTI3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///127\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(33);\nvar invoke = __webpack_require__(162);\nvar html = __webpack_require__(110);\nvar cel = __webpack_require__(106);\nvar global = __webpack_require__(7);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(34)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdGFzay5qcz80OWU4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBpbnZva2UgPSByZXF1aXJlKCcuL19pbnZva2UnKTtcbnZhciBodG1sID0gcmVxdWlyZSgnLi9faHRtbCcpO1xudmFyIGNlbCA9IHJlcXVpcmUoJy4vX2RvbS1jcmVhdGUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBwcm9jZXNzID0gZ2xvYmFsLnByb2Nlc3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2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdGFzay5qc1xuLy8gbW9kdWxlIGlkID0gMTI4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///128\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar macrotask = __webpack_require__(128).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(34)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWljcm90YXNrLmpzPzgzN2UiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIG1hY3JvdGFzayA9IHJlcXVpcmUoJy4vX3Rhc2snKS5zZXQ7XG52YXIgT2JzZXJ2ZXIgPSBnbG9iYWwuTXV0YXRpb25PYnNlcnZlciB8fCBnbG9iYWwuV2ViS2l0TXV0YXRpb25PYnNlcnZlcjtcbnZhciBwcm9jZXNzID0gZ2xvYmFsLnByb2Nlc3M7XG52YXIgUHJvbWlzZSA9IGdsb2JhbC5Qcm9taXNlO1xudmFyIGlzTm9kZSA9IHJlcXVpcmUoJy4v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\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbmV3LXByb21pc2UtY2FwYWJpbGl0eS5qcz9jM2EwIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDI1LjQuMS41IE5ld1Byb21pc2VDYXBhYmlsaXR5KEMpXG52YXIgYUZ1bmN0aW9uID0gcmVxdWlyZSgnLi9fYS1mdW5jdGlvbicpO1xuXG5mdW5jdGlvbiBQcm9taXNlQ2FwYWJpbGl0eShDKSB7XG4gIHZhciByZXNvbHZlLCByZWplY3Q7XG4gIHRoaXMucHJvbWlzZSA9IG5ldyBDKGZ1bmN0aW9uICgkJHJlc29sdmUsICQkcmVqZWN0KSB7XG4gICAgaWYgKHJlc29sdmUgIT09IHVuZGVmaW5lZCB8fCByZWplY3QgIT09IHVuZGVmaW5lZCkgdGhyb3cgVHlwZUVycm9yKCdCYWQgUHJvbWlzZSBjb25zdHJ1Y3RvcicpO1xuICAgIHJlc29sdmUgPSAkJHJlc29sdmU7XG4gICAgcmVqZWN0ID0gJCRyZWplY3Q7XG4gIH0pO1xuICB0aGlzLnJlc29sdmUgPSBhRnVuY3Rpb24ocmVzb2x2ZSk7XG4gIHRoaXMucmVqZWN0ID0gYUZ1bmN0aW9uKHJlamVjdCk7XG59XG5cbm1vZHVsZS5leHBvcnRzLmYgPSBmdW5jdGlvbiAoQykge1xuICByZXR1cm4gbmV3IFByb21pc2VDYXBhYmlsaXR5KEMpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbmV3LXByb21pc2UtY2FwYWJpbGl0eS5qc1xuLy8gbW9kdWxlIGlkID0gMTMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///130\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar DESCRIPTORS = __webpack_require__(12);\nvar LIBRARY = __webpack_require__(48);\nvar $typed = __webpack_require__(94);\nvar hide = __webpack_require__(23);\nvar redefineAll = __webpack_require__(61);\nvar fails = __webpack_require__(8);\nvar anInstance = __webpack_require__(59);\nvar toInteger = __webpack_require__(38);\nvar toLength = __webpack_require__(14);\nvar toIndex = __webpack_require__(181);\nvar gOPN = __webpack_require__(57).f;\nvar dP = __webpack_require__(13).f;\nvar arrayFill = __webpack_require__(126);\nvar setToStringTag = __webpack_require__(64);\nvar ARRAY_BUFFER = 'ArrayBuffer';\nvar DATA_VIEW = 'DataView';\nvar PROTOTYPE = 'prototype';\nvar WRONG_LENGTH = 'Wrong length!';\nvar WRONG_INDEX = 'Wrong index!';\nvar $ArrayBuffer = global[ARRAY_BUFFER];\nvar $DataView = global[DATA_VIEW];\nvar Math = global.Math;\nvar RangeError = global.RangeError;\n// eslint-disable-next-line no-shadow-restricted-names\nvar Infinity = global.Infinity;\nvar BaseBuffer = $ArrayBuffer;\nvar abs = Math.abs;\nvar pow = Math.pow;\nvar floor = Math.floor;\nvar log = Math.log;\nvar LN2 = Math.LN2;\nvar BUFFER = 'buffer';\nvar BYTE_LENGTH = 'byteLength';\nvar BYTE_OFFSET = 'byteOffset';\nvar $BUFFER = DESCRIPTORS ? '_b' : BUFFER;\nvar $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;\nvar $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;\n\n// IEEE754 conversions based on https://github.com/feross/ieee754\nfunction packIEEE754(value, mLen, nBytes) {\n var buffer = new Array(nBytes);\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;\n var i = 0;\n var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;\n var e, m, c;\n value = abs(value);\n // eslint-disable-next-line no-self-compare\n if (value != value || value === Infinity) {\n // eslint-disable-next-line no-self-compare\n m = value != value ? 1 : 0;\n e = eMax;\n } else {\n e = floor(log(value) / LN2);\n if (value * (c = pow(2, -e)) < 1) {\n e--;\n c *= 2;\n }\n if (e + eBias >= 1) {\n value += rt / c;\n } else {\n value += rt * pow(2, 1 - eBias);\n }\n if (value * c >= 2) {\n e++;\n c /= 2;\n }\n if (e + eBias >= eMax) {\n m = 0;\n e = eMax;\n } else if (e + eBias >= 1) {\n m = (value * c - 1) * pow(2, mLen);\n e = e + eBias;\n } else {\n m = value * pow(2, eBias - 1) * pow(2, mLen);\n e = 0;\n }\n }\n for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);\n e = e << mLen | m;\n eLen += mLen;\n for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);\n buffer[--i] |= s * 128;\n return buffer;\n}\nfunction unpackIEEE754(buffer, mLen, nBytes) {\n var eLen = nBytes * 8 - mLen - 1;\n var eMax = (1 << eLen) - 1;\n var eBias = eMax >> 1;\n var nBits = eLen - 7;\n var i = nBytes - 1;\n var s = buffer[i--];\n var e = s & 127;\n var m;\n s >>= 7;\n for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);\n m = e & (1 << -nBits) - 1;\n e >>= -nBits;\n nBits += mLen;\n for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);\n if (e === 0) {\n e = 1 - eBias;\n } else if (e === eMax) {\n return m ? NaN : s ? -Infinity : Infinity;\n } else {\n m = m + pow(2, mLen);\n e = e - eBias;\n } return (s ? -1 : 1) * m * pow(2, e - mLen);\n}\n\nfunction unpackI32(bytes) {\n return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];\n}\nfunction packI8(it) {\n return [it & 0xff];\n}\nfunction packI16(it) {\n return [it & 0xff, it >> 8 & 0xff];\n}\nfunction packI32(it) {\n return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];\n}\nfunction packF64(it) {\n return packIEEE754(it, 52, 8);\n}\nfunction packF32(it) {\n return packIEEE754(it, 23, 4);\n}\n\nfunction addGetter(C, key, internal) {\n dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });\n}\n\nfunction get(view, bytes, index, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = store.slice(start, start + bytes);\n return isLittleEndian ? pack : pack.reverse();\n}\nfunction set(view, bytes, index, conversion, value, isLittleEndian) {\n var numIndex = +index;\n var intIndex = toIndex(numIndex);\n if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);\n var store = view[$BUFFER]._b;\n var start = intIndex + view[$OFFSET];\n var pack = conversion(+value);\n for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];\n}\n\nif (!$typed.ABV) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer, ARRAY_BUFFER);\n var byteLength = toIndex(length);\n this._b = arrayFill.call(new Array(byteLength), 0);\n this[$LENGTH] = byteLength;\n };\n\n $DataView = function DataView(buffer, byteOffset, byteLength) {\n anInstance(this, $DataView, DATA_VIEW);\n anInstance(buffer, $ArrayBuffer, DATA_VIEW);\n var bufferLength = buffer[$LENGTH];\n var offset = toInteger(byteOffset);\n if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');\n byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);\n if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);\n this[$BUFFER] = buffer;\n this[$OFFSET] = offset;\n this[$LENGTH] = byteLength;\n };\n\n if (DESCRIPTORS) {\n addGetter($ArrayBuffer, BYTE_LENGTH, '_l');\n addGetter($DataView, BUFFER, '_b');\n addGetter($DataView, BYTE_LENGTH, '_l');\n addGetter($DataView, BYTE_OFFSET, '_o');\n }\n\n redefineAll($DataView[PROTOTYPE], {\n getInt8: function getInt8(byteOffset) {\n return get(this, 1, byteOffset)[0] << 24 >> 24;\n },\n getUint8: function getUint8(byteOffset) {\n return get(this, 1, byteOffset)[0];\n },\n getInt16: function getInt16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return (bytes[1] << 8 | bytes[0]) << 16 >> 16;\n },\n getUint16: function getUint16(byteOffset /* , littleEndian */) {\n var bytes = get(this, 2, byteOffset, arguments[1]);\n return bytes[1] << 8 | bytes[0];\n },\n getInt32: function getInt32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1]));\n },\n getUint32: function getUint32(byteOffset /* , littleEndian */) {\n return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;\n },\n getFloat32: function getFloat32(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);\n },\n getFloat64: function getFloat64(byteOffset /* , littleEndian */) {\n return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);\n },\n setInt8: function setInt8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setUint8: function setUint8(byteOffset, value) {\n set(this, 1, byteOffset, packI8, value);\n },\n setInt16: function setInt16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setUint16: function setUint16(byteOffset, value /* , littleEndian */) {\n set(this, 2, byteOffset, packI16, value, arguments[2]);\n },\n setInt32: function setInt32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setUint32: function setUint32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packI32, value, arguments[2]);\n },\n setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {\n set(this, 4, byteOffset, packF32, value, arguments[2]);\n },\n setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {\n set(this, 8, byteOffset, packF64, value, arguments[2]);\n }\n });\n} else {\n if (!fails(function () {\n $ArrayBuffer(1);\n }) || !fails(function () {\n new $ArrayBuffer(-1); // eslint-disable-line no-new\n }) || fails(function () {\n new $ArrayBuffer(); // eslint-disable-line no-new\n new $ArrayBuffer(1.5); // eslint-disable-line no-new\n new $ArrayBuffer(NaN); // eslint-disable-line no-new\n return $ArrayBuffer.name != ARRAY_BUFFER;\n })) {\n $ArrayBuffer = function ArrayBuffer(length) {\n anInstance(this, $ArrayBuffer);\n return new BaseBuffer(toIndex(length));\n };\n var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];\n for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {\n if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);\n }\n if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;\n }\n // iOS Safari 7.x bug\n var view = new $DataView(new $ArrayBuffer(2));\n var $setInt8 = $DataView[PROTOTYPE].setInt8;\n view.setInt8(0, 2147483648);\n view.setInt8(1, 2147483649);\n if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {\n setInt8: function setInt8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n },\n setUint8: function setUint8(byteOffset, value) {\n $setInt8.call(this, byteOffset, value << 24 >> 24);\n }\n }, true);\n}\nsetToStringTag($ArrayBuffer, ARRAY_BUFFER);\nsetToStringTag($DataView, DATA_VIEW);\nhide($DataView[PROTOTYPE], $typed.VIEW, true);\nexports[ARRAY_BUFFER] = $ArrayBuffer;\nexports[DATA_VIEW] = $DataView;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdHlwZWQtYnVmZmVyLmpzPzJlYjciXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyICR0eXBlZCA9IHJlcXVpcmUoJy4vX3R5cGVkJyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBhbkluc3RhbmNlID0gcmVxdWlyZSgnLi9fYW4taW5zdGFuY2UnKTtcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciB0b0luZGV4ID0gcmVxdWlyZSgnLi9fd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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///131\n")},function(module,exports){eval('// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError("Can\'t call method on " + it);\n return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZWZpbmVkLmpzP2U3NjgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4yLjEgUmVxdWlyZU9iamVjdENvZXJjaWJsZShhcmd1bWVudClcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIGlmIChpdCA9PSB1bmRlZmluZWQpIHRocm93IFR5cGVFcnJvcihcIkNhbid0IGNhbGwgbWV0aG9kIG9uICBcIiArIGl0KTtcbiAgcmV0dXJuIGl0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kZWZpbmVkLmpzXG4vLyBtb2R1bGUgaWQgPSAxMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///132\n')},function(module,exports,__webpack_require__){eval("// 7.1.15 ToLength\nvar toInteger = __webpack_require__(134);\nvar min = Math.min;\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1sZW5ndGguanM/NDExMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMTUgVG9MZW5ndGhcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXQgPiAwID8gbWluKHRvSW50ZWdlcihpdCksIDB4MWZmZmZmZmZmZmZmZmYpIDogMDsgLy8gcG93KDIsIDUzKSAtIDEgPT0gOTAwNzE5OTI1NDc0MDk5MVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1sZW5ndGguanNcbi8vIG1vZHVsZSBpZCA9IDEzM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///133\n")},function(module,exports){eval("// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1pbnRlZ2VyLmpzPzUyZTEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4xLjQgVG9JbnRlZ2VyXG52YXIgY2VpbCA9IE1hdGguY2VpbDtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICByZXR1cm4gaXNOYU4oaXQgPSAraXQpID8gMCA6IChpdCA+IDAgPyBmbG9vciA6IGNlaWwpKGl0KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8taW50ZWdlci5qc1xuLy8gbW9kdWxlIGlkID0gMTM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///134\n")},function(module,exports,__webpack_require__){eval("var shared = __webpack_require__(136)('keys');\nvar uid = __webpack_require__(98);\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQta2V5LmpzPzZiMWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIHNoYXJlZCA9IHJlcXVpcmUoJy4vX3NoYXJlZCcpKCdrZXlzJyk7XG52YXIgdWlkID0gcmVxdWlyZSgnLi9fdWlkJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChrZXkpIHtcbiAgcmV0dXJuIHNoYXJlZFtrZXldIHx8IChzaGFyZWRba2V5XSA9IHVpZChrZXkpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fc2hhcmVkLWtleS5qc1xuLy8gbW9kdWxlIGlkID0gMTM1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///135\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(11);\nvar global = __webpack_require__(21);\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: __webpack_require__(78) ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQuanM/N2JjMCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBTSEFSRUQgPSAnX19jb3JlLWpzX3NoYXJlZF9fJztcbnZhciBzdG9yZSA9IGdsb2JhbFtTSEFSRURdIHx8IChnbG9iYWxbU0hBUkVEXSA9IHt9KTtcblxuKG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGtleSwgdmFsdWUpIHtcbiAgcmV0dXJuIHN0b3JlW2tleV0gfHwgKHN0b3JlW2tleV0gPSB2YWx1ZSAhPT0gdW5kZWZpbmVkID8gdmFsdWUgOiB7fSk7XG59KSgndmVyc2lvbnMnLCBbXSkucHVzaCh7XG4gIHZlcnNpb246IGNvcmUudmVyc2lvbixcbiAgbW9kZTogcmVxdWlyZSgnLi9fbGlicmFyeScpID8gJ3B1cmUnIDogJ2dsb2JhbCcsXG4gIGNvcHlyaWdodDogJ8KpIDIwMTggRGVuaXMgUHVzaGthcmV2ICh6bG9pcm9jay5ydSknXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zaGFyZWQuanNcbi8vIG1vZHVsZSBpZCA9IDEzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///136\n")},function(module,exports){eval("// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWJ1Zy1rZXlzLmpzP2M2NzciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gSUUgOC0gZG9uJ3QgZW51bSBidWcga2V5c1xubW9kdWxlLmV4cG9ydHMgPSAoXG4gICdjb25zdHJ1Y3RvcixoYXNPd25Qcm9wZXJ0eSxpc1Byb3RvdHlwZU9mLHByb3BlcnR5SXNFbnVtZXJhYmxlLHRvTG9jYWxlU3RyaW5nLHRvU3RyaW5nLHZhbHVlT2YnXG4pLnNwbGl0KCcsJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZW51bS1idWcta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMTM3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///137\n")},function(module,exports,__webpack_require__){eval("// most Object methods by ES6 should accept primitives\nvar $export = __webpack_require__(26);\nvar core = __webpack_require__(11);\nvar fails = __webpack_require__(70);\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qtc2FwLmpzP2JhYTUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gbW9zdCBPYmplY3QgbWV0aG9kcyBieSBFUzYgc2hvdWxkIGFjY2VwdCBwcmltaXRpdmVzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoS0VZLCBleGVjKSB7XG4gIHZhciBmbiA9IChjb3JlLk9iamVjdCB8fCB7fSlbS0VZXSB8fCBPYmplY3RbS0VZXTtcbiAgdmFyIGV4cCA9IHt9O1xuICBleHBbS0VZXSA9IGV4ZWMoZm4pO1xuICAkZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIGZhaWxzKGZ1bmN0aW9uICgpIHsgZm4oMSk7IH0pLCAnT2JqZWN0JywgZXhwKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LXNhcC5qc1xuLy8gbW9kdWxlIGlkID0gMTM4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///138\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(46);\nvar document = __webpack_require__(21).document;\n// typeof document.createElement is 'object' in old IE\nvar is = isObject(document) && isObject(document.createElement);\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19kb20tY3JlYXRlLmpzPzM4ZGQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZG9jdW1lbnQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5kb2N1bWVudDtcbi8vIHR5cGVvZiBkb2N1bWVudC5jcmVhdGVFbGVtZW50IGlzICdvYmplY3QnIGluIG9sZCBJRVxudmFyIGlzID0gaXNPYmplY3QoZG9jdW1lbnQpICYmIGlzT2JqZWN0KGRvY3VtZW50LmNyZWF0ZUVsZW1lbnQpO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGlzID8gZG9jdW1lbnQuY3JlYXRlRWxlbWVudChpdCkgOiB7fTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fZG9tLWNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTM5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///139\n")},function(module,exports,__webpack_require__){eval("// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = __webpack_require__(46);\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1wcmltaXRpdmUuanM/MzI2MyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyA3LjEuMSBUb1ByaW1pdGl2ZShpbnB1dCBbLCBQcmVmZXJyZWRUeXBlXSlcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuLy8gaW5zdGVhZCBvZiB0aGUgRVM2IHNwZWMgdmVyc2lvbiwgd2UgZGlkbid0IGltcGxlbWVudCBAQHRvUHJpbWl0aXZlIGNhc2Vcbi8vIGFuZCB0aGUgc2Vjb25kIGFyZ3VtZW50IC0gZmxhZyAtIHByZWZlcnJlZCB0eXBlIGlzIGEgc3RyaW5nXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgUykge1xuICBpZiAoIWlzT2JqZWN0KGl0KSkgcmV0dXJuIGl0O1xuICB2YXIgZm4sIHZhbDtcbiAgaWYgKFMgJiYgdHlwZW9mIChmbiA9IGl0LnRvU3RyaW5nKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIGlmICh0eXBlb2YgKGZuID0gaXQudmFsdWVPZikgPT0gJ2Z1bmN0aW9uJyAmJiAhaXNPYmplY3QodmFsID0gZm4uY2FsbChpdCkpKSByZXR1cm4gdmFsO1xuICBpZiAoIVMgJiYgdHlwZW9mIChmbiA9IGl0LnRvU3RyaW5nKSA9PSAnZnVuY3Rpb24nICYmICFpc09iamVjdCh2YWwgPSBmbi5jYWxsKGl0KSkpIHJldHVybiB2YWw7XG4gIHRocm93IFR5cGVFcnJvcihcIkNhbid0IGNvbnZlcnQgb2JqZWN0IHRvIHByaW1pdGl2ZSB2YWx1ZVwiKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdG8tcHJpbWl0aXZlLmpzXG4vLyBtb2R1bGUgaWQgPSAxNDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///140\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = __webpack_require__(41);\nvar dPs = __webpack_require__(436);\nvar enumBugKeys = __webpack_require__(137);\nvar IE_PROTO = __webpack_require__(135)('IE_PROTO');\nvar Empty = function () { /* empty */ };\nvar PROTOTYPE = 'prototype';\n\n// Create object with fake `null` prototype: use iframe Object with cleared prototype\nvar createDict = function () {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = __webpack_require__(139)('iframe');\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n __webpack_require__(195).appendChild(iframe);\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n createDict = iframeDocument.F;\n while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];\n return createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null;\n // add \"__proto__\" for Object.getPrototypeOf polyfill\n result[IE_PROTO] = O;\n } else result = createDict();\n return Properties === undefined ? result : dPs(result, Properties);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtY3JlYXRlLmpzPzYyODYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjIgLyAxNS4yLjMuNSBPYmplY3QuY3JlYXRlKE8gWywgUHJvcGVydGllc10pXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBkUHMgPSByZXF1aXJlKCcuL19vYmplY3QtZHBzJyk7XG52YXIgZW51bUJ1Z0tleXMgPSByZXF1aXJlKCcuL19lbnVtLWJ1Zy1rZXlzJyk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG52YXIgRW1wdHkgPSBmdW5jdGlvbiAoKSB7IC8qI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FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///141\n")},function(module,exports,__webpack_require__){eval("// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = __webpack_require__(77);\nvar TAG = __webpack_require__(22)('toStringTag');\n// ES3 wrong here\nvar ARG = cof(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (e) { /* empty */ }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T\n // builtinTag case\n : ARG ? cof(O)\n // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jbGFzc29mLmpzPzQ1OGYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZ2V0dGluZyB0YWcgZnJvbSAxOS4xLjMuNiBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nKClcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbnZhciBUQUcgPSByZXF1aXJlKCcuL193a3MnKSgndG9TdHJpbmdUYWcnKTtcbi8vIEVTMyB3cm9uZyBoZXJlXG52YXIgQVJHID0gY29mKGZ1bmN0aW9uICgpIHsgcmV0dXJuIGFyZ3VtZW50czsgfSgpKSA9PSAnQXJndW1lbnRzJztcblxuLy8gZmFsbGJhY2sgZm9yIElFMTEgU2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},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(142);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar Iterators = __webpack_require__(71);\nmodule.exports = __webpack_require__(11).getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR]\n || it['@@iterator']\n || Iterators[classof(it)];\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuZ2V0LWl0ZXJhdG9yLW1ldGhvZC5qcz9kZGZiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjbGFzc29mID0gcmVxdWlyZSgnLi9fY2xhc3NvZicpO1xudmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgSXRlcmF0b3JzID0gcmVxdWlyZSgnLi9faXRlcmF0b3JzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4vX2NvcmUnKS5nZXRJdGVyYXRvck1ldGhvZCA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoaXQgIT0gdW5kZWZpbmVkKSByZXR1cm4gaXRbSVRFUkFUT1JdXG4gICAgfHwgaXRbJ0BAaXRlcmF0b3InXVxuICAgIHx8IEl0ZXJhdG9yc1tjbGFzc29mKGl0KV07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kLmpzXG4vLyBtb2R1bGUgaWQgPSAxNDNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///143\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 25.4.1.5 NewPromiseCapability(C)\nvar aFunction = __webpack_require__(99);\n\nfunction PromiseCapability(C) {\n var resolve, reject;\n this.promise = new C(function ($$resolve, $$reject) {\n if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');\n resolve = $$resolve;\n reject = $$reject;\n });\n this.resolve = aFunction(resolve);\n this.reject = aFunction(reject);\n}\n\nmodule.exports.f = function (C) {\n return new PromiseCapability(C);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19uZXctcHJvbWlzZS1jYXBhYmlsaXR5LmpzP2E4MDQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gMjUuNC4xLjUgTmV3UHJvbWlzZUNhcGFiaWxpdHkoQylcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG5cbmZ1bmN0aW9uIFByb21pc2VDYXBhYmlsaXR5KEMpIHtcbiAgdmFyIHJlc29sdmUsIHJlamVjdDtcbiAgdGhpcy5wcm9taXNlID0gbmV3IEMoZnVuY3Rpb24gKCQkcmVzb2x2ZSwgJCRyZWplY3QpIHtcbiAgICBpZiAocmVzb2x2ZSAhPT0gdW5kZWZpbmVkIHx8IHJlamVjdCAhPT0gdW5kZWZpbmVkKSB0aHJvdyBUeXBlRXJyb3IoJ0JhZCBQcm9taXNlIGNvbnN0cnVjdG9yJyk7XG4gICAgcmVzb2x2ZSA9ICQkcmVzb2x2ZTtcbiAgICByZWplY3QgPSAkJHJlamVjdDtcbiAgfSk7XG4gIHRoaXMucmVzb2x2ZSA9IGFGdW5jdGlvbihyZXNvbHZlKTtcbiAgdGhpcy5yZWplY3QgPSBhRnVuY3Rpb24ocmVqZWN0KTtcbn1cblxubW9kdWxlLmV4cG9ydHMuZiA9IGZ1bmN0aW9uIChDKSB7XG4gIHJldHVybiBuZXcgUHJvbWlzZUNhcGFiaWxpdHkoQyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX25ldy1wcm9taXNlLWNhcGFiaWxpdHkuanNcbi8vIG1vZHVsZSBpZCA9IDE0NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///144\n")},function(module,exports){eval("exports.f = Object.getOwnPropertySymbols;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wcy5qcz9kNjQ0Il0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMuZiA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHM7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcHMuanNcbi8vIG1vZHVsZSBpZCA9IDE0NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///145\n")},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(22);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZXh0LmpzPzJhMWUiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0cy5mID0gcmVxdWlyZSgnLi9fd2tzJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fd2tzLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gMTQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///146\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar core = __webpack_require__(11);\nvar LIBRARY = __webpack_require__(78);\nvar wksExt = __webpack_require__(146);\nvar defineProperty = __webpack_require__(45).f;\nmodule.exports = function (name) {\n var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});\n if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL193a3MtZGVmaW5lLmpzPzcyYjkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgTElCUkFSWSA9IHJlcXVpcmUoJy4vX2xpYnJhcnknKTtcbnZhciB3a3NFeHQgPSByZXF1aXJlKCcuL193a3MtZXh0Jyk7XG52YXIgZGVmaW5lUHJvcGVydHkgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAobmFtZSkge1xuICB2YXIgJFN5bWJvbCA9IGNvcmUuU3ltYm9sIHx8IChjb3JlLlN5bWJvbCA9IExJQlJBUlkgPyB7fSA6IGdsb2JhbC5TeW1ib2wgfHwge30pO1xuICBpZiAobmFtZS5jaGFyQXQoMCkgIT0gJ18nICYmICEobmFtZSBpbiAkU3ltYm9sKSkgZGVmaW5lUHJvcGVydHkoJFN5bWJvbCwgbmFtZSwgeyB2YWx1ZTogd2tzRXh0LmYobmFtZSkgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3drcy1kZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDE0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///147\n")},function(module,exports,__webpack_require__){eval("var pIE = __webpack_require__(81);\nvar createDesc = __webpack_require__(79);\nvar toIObject = __webpack_require__(50);\nvar toPrimitive = __webpack_require__(140);\nvar has = __webpack_require__(62);\nvar IE8_DOM_DEFINE = __webpack_require__(191);\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nexports.f = __webpack_require__(51) ? gOPD : function getOwnPropertyDescriptor(O, P) {\n O = toIObject(O);\n P = toPrimitive(P, true);\n if (IE8_DOM_DEFINE) try {\n return gOPD(O, P);\n } catch (e) { /* empty */ }\n if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wZC5qcz8yY2E2Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciBJRThfRE9NX0RFRklORSA9IHJlcXVpcmUoJy4vX2llOC1kb20tZGVmaW5lJyk7XG52YXIgZ09QRCA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I7XG5cbmV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgPyBnT1BEIDogZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIFApIHtcbiAgTyA9IHRvSU9iamVjdChPKTtcbiAgUCA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICBpZiAoSUU4X0RPTV9ERUZJTkUpIHRyeSB7XG4gICAgcmV0dXJuIGdPUEQoTywgUCk7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICBpZiAoaGFzKE8sIFApKSByZXR1cm4gY3JlYXRlRGVzYyghcElFLmYuY2FsbChPLCBQKSwgT1tQXSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1nb3BkLmpzXG4vLyBtb2R1bGUgaWQgPSAxNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///148\n")},function(module,exports){eval('// proxy-observe v0.0.18\r\n// Copyright (c) 2015, 2016 Simon Y. Blackwell, AnyWhichWay\r\n// MIT License - http://opensource.org/licenses/mit-license.php\r\n(function() {\r\n\t"use strict";\r\n\t// Creates and returns a Proxy wrapping a target so that all changes can be trapped and forwarded to\r\n\t// a callback. The callback takes an array of changes just like the traditional original Chrome Object.observe\r\n\t// {object:,name:,type:add|update|delete|reconfigure|preventExtensions|setPrototype,oldValue:}\r\n\t// The acceptlist can be add|update|delete|reconfigure|preventExtensions|setPrototype.\r\n\t// v 0.0.10 to support pausing and restarting observation two additional constructor arguments are available to Object.observe:\r\n\t// pausable - create the Observer so it can be paused\r\n\t// pause - create observer in paused state\r\n\t// if pausable is true then an additional method deliver(ignorePrevious) is available to start delivery\r\n\t// to pause delivery set a property called pause on the function deliver to true\r\n\t// pausable is optional to reduce the chance of shadowing a property or method on any existing code called deliver\r\n\tif(!Object.observe && typeof(Proxy)==="function") {\r\n\t\tfunction Observer(target,callback,acceptlist,pausable,pause,delay) {\r\n\t \tvar me = this, proxy;\r\n\t \tfunction deliver(ignorePrevious,delay) {\r\n\t \t\tdeliver.delay = delay;\r\n\t \t\tif(!deliver.pause) {\r\n\t \t\tif(me.changeset.length>0) {\r\n\t \t\t\tif(!ignorePrevious) {\r\n\t\t \t \t\tvar changes = me.changeset.filter(function(change) { return !acceptlist || acceptlist.indexOf(change.type)>=0; });\r\n\t\t \t\t\tif(changes.length>0) {\r\n\t\t \t\t\t\tcallback(changes);\r\n\t\t \t\t\t}\r\n\t \t\t\t}\r\n\t \t\t\tme.changeset = [];\r\n\t \t\t}\r\n\t \t\t}\r\n\t \t}\r\n\t \tdeliver.pause = pause;\r\n\t \tdeliver.delay = delay;\r\n\t\t me.get = function(target, property) {\r\n\t\t \tif(property==="__observer__") {\r\n\t\t \t\treturn me;\r\n\t\t \t}\r\n\t\t \tif(property==="unobserve") {\r\n\t\t \t\treturn function() {\r\n\t\t \t\t\tObject.unobserve(target);\r\n\t\t \t\t\treturn target;\r\n\t\t \t\t};\r\n\t\t \t}\r\n\t\t \tif(property==="deliver") {\r\n\t\t \t\treturn deliver;\r\n\t\t \t}\r\n\t\t \treturn target[property];\r\n\t\t }\r\n\t \tme.target = target;\r\n\t \tme.changeset = [];\r\n\t \tif(!me.target.__observerCallbacks__) {\r\n\t \t\t// __observerCallbacks__ is used as an index to get at the proxy which is the observer, so we can unobserve\r\n\t \t\tObject.defineProperty(target,"__observerCallbacks__",{enumerable:false,configurable:true,writable:false,value:[]});\r\n\t \t\tObject.defineProperty(target,"__observers__",{enumerable:false,configurable:true,writable:false,value:[]});\r\n\t \t}\r\n\t \tme.target.__observerCallbacks__.push(callback);\r\n\t \tme.target.__observers__.push(this);\r\n\t \tproxy = new Proxy(target,me);\r\n\t \tdeliver(false,delay);\r\n\t \treturn proxy;\r\n\t }\r\n\t\tObserver.prototype.deliver = function() {\r\n\t\t\treturn this.get(null,"deliver");\r\n\t\t}\r\n\t Observer.prototype.set = function(target, property, value) { // , receiver\r\n\t \tvar oldvalue = target[property];\r\n\t \tvar type = (oldvalue===undefined ? "add" : "update");\r\n\t \ttarget[property] = value;\r\n\t \tif(target.__observers__.indexOf(this)>=0 && (!this.acceptlist || this.acceptlist.indexOf(type)>=0)) {\r\n\t \tvar change = {object:target,name:property,type:type},\r\n\t \t\tstart = this.changeset.length === 0,\r\n\t \t\tdeliver = this.deliver();\r\n\t \tif(type==="update") {\r\n\t \t\tchange.oldValue = oldvalue;\r\n\t \t}\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.deleteProperty = function(target, property) {\r\n\t \tvar oldvalue = target[property];\r\n\t \t//if(typeof(oldvalue)!=="undefined") {\r\n\t\t \tdelete target[property];\r\n\t\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("delete")>=0) {\r\n\t\t \tvar change = {object:target,name:property,type:"delete",oldValue:oldvalue},\r\n\t\t \t\tstart = this.changeset.length === 0,\r\n\t\t \t\tdeliver = this.deliver();\r\n\t\t \tthis.changeset.push(change);\r\n\t\t \tif(start) {\r\n\t\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t\t \t}\r\n\t\t \t}\r\n\t \t//}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.defineProperty = function(target, property, descriptor) {\r\n\t \tObject.defineProperty(target, property, descriptor);\r\n\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("reconfigure")>=0) {\r\n\t \tvar change = {object:target,name:property,type:"reconfigure"},\r\n \t\t\tstart = this.changeset.length === 0,\r\n \t\t\tdeliver = this.deliver();\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.setPrototypeOf = function(target, prototype) {\r\n\t \tvar oldvalue = Object.getPrototypeOf(target);\r\n\t \tObject.setPrototypeOf(target, prototype);\r\n\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("setPrototype")>=0) {\r\n\t \tvar change = {object:target,name:"__proto__",type:"setPrototype",oldValue:oldvalue},\r\n \t\t\t\tstart = this.changeset.length === 0,\r\n \t\t\t\tdeliver = this.deliver();\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Observer.prototype.preventExtensions = function(target) {\r\n\t Object.preventExtensions(target);\r\n\t \tif(target.__observers__.indexOf(this)>=0 && !this.acceptlist || this.acceptlist.indexOf("preventExtensions")>=0) {\r\n\t \tvar change = {object:target,type:"preventExtensions"},\r\n\t\t\t\t\tstart = this.changeset.length === 0,\r\n\t\t\t\t\tdeliver = this.deliver();\r\n\t \tthis.changeset.push(change);\r\n\t \tif(start) {\r\n\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t}\r\n\t \t}\r\n\t \treturn true;\r\n\t };\r\n\t Object.observe = function(object,callback,acceptlist,pausable,pause,delay) {\r\n\t \treturn new Observer(object,callback,acceptlist,pausable,pause,delay);\r\n\t };\r\n\t Object.unobserve = function(object,callback) {\r\n\t \tif(object.__observerCallbacks__) {\r\n\t \t\tif(!callback) {\r\n\t \t\t\tobject.__observerCallbacks__.splice(0,object.__observerCallbacks__.length);\r\n\t \t\t\tobject.__observers__.splice(0,object.__observers__.length);\r\n\t \t\t\treturn;\r\n\t \t\t}\r\n\t \t\tobject.__observerCallbacks__.forEach(function(observercallback,i) {\r\n\t \t\t\tif(callback===observercallback) {\r\n\t \t\t\t\tobject.__observerCallbacks__.splice(i,1);\r\n\t \t\t\t\tdelete object.__observers__[i].callback;\r\n\t \t\t\t\tobject.__observers__.splice(i,1);\r\n\t \t\t\t}\r\n\t \t\t});\r\n\t \t}\r\n\t };\r\n\t Array.observe = function(object,callback,acceptlist,pausable,pause,delay) {\r\n\t \tif(!(object instanceof Array) && !Array.isArray(object)) {\r\n\t \t\tthrow new TypeError("First argument to Array.observer is not an Array");\r\n\t \t}\r\n \tacceptlist = acceptlist || ["add", "update", "delete", "splice"];\r\n\t \tvar arrayproxy = new Proxy(object,{get: function(target,property) {\r\n\t \t\tif(property==="unobserve") {\r\n\t\t \t\treturn function(callback) {\r\n\t\t \t\t\tif(callback) {\r\n\t\t \t\t\t\treturn Object.unobserve(target,callback);\r\n\t\t \t\t\t}\r\n\t\t \t\t\treturn target.unobserve();\r\n\t\t \t\t};\r\n\t\t \t}\r\n\t \t\tif(property==="splice") {\r\n\t \t\t\treturn function(start,end) {\r\n\t \t\t\t\tif(typeof(start)!=="number" || typeof(end)!=="number") {\r\n\t \t\t\t\t\tthrow new TypeError("First two arguments to Array splice are not number, number");\r\n\t \t\t\t\t}\r\n\t \t \t\tvar removed = this.slice(start,start+end),\r\n\t \t \t\t\taddedCount = (arguments.length > 1 ? arguments.length-2 : 0),\r\n\t \t \t\t\tchange = {object:object,type:"splice",index:start,removed:removed,addedCount:addedCount};\r\n\t \t \t\ttarget.splice.apply(target,arguments);\r\n\t \t \t\tif(acceptlist.indexOf("splice")>=0) {\r\n\t \t \t\t\tvar start = proxy.__observer__.changeset.length === 0,\r\n\t \t \t\t\tdeliver = proxy.__observer__.deliver();\r\n\t \t \t\t\tproxy.__observer__.changeset.push(change);\r\n\t \t \t\t\tif(start) {\r\n\t \t\t \t\tdeliver(false,(typeof(deliver.delay)==="number" ? deliver.delay : 10));\r\n\t \t\t \t}\r\n\t \t \t\t}\r\n\t \t \t}\r\n\t \t\t}\r\n\t \t\tif(property==="push") {\r\n\t \t\t\t return function(item) {\r\n\t \t\t \treturn this.splice(this.length,0,item);\r\n\t \t\t }\r\n\t \t\t}\r\n\t \t\tif(property==="pop") {\r\n\t \t\t\t return function() {\r\n\t \t\t \treturn this.splice(this.length-1,1);\r\n\t \t\t }\r\n\t \t\t}\r\n\t \t\tif(property==="unshift") {\r\n\t \t\t\t return function(item) {\r\n \t\t \t\treturn this.splice(0,0,item);\r\n \t\t \t}\r\n\t \t\t}\r\n\t \t\tif(property==="shift") {\r\n\t \t\t\treturn function() {\r\n\t \t \t\treturn this.splice(0,1);\r\n\t \t \t}\r\n\t \t\t}\r\n\t \t\treturn target[property];\r\n\t \t}});\r\n\t \tvar proxy = Object.observe(arrayproxy,function(changeset) { \r\n\t \t\tvar changes = changeset.filter(function(change) { return change.name!=="length" && change.name!=="add" && (!acceptlist || acceptlist.indexOf(change.type)>=0); });\r\n\t \t\tif(changes.length>0) {\r\n\t \t\t\tcallback(changes);\r\n\t \t\t}\r\n\t \t},acceptlist,pausable,pause,delay);\r\n\t \treturn proxy;\r\n\t };\r\n\t Array.unobserve = function(object,callback) {\r\n\t\t return object.unobserve(callback);\r\n\t }\r\n\t}\r\n\tObject.deepObserve = function(object,callback,parts) {\r\n\r\n\t\tparts = (parts ? parts : []);\r\n\r\n\t\tvar toTypeName = function(obj) {\r\n\t\t\treturn ({}).toString.call(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase()\r\n\t\t}\r\n\r\n\t\tfunction reobserve(value, parts) {\r\n\t\t\tvar keys = Object.keys(value);\r\n\t\t\tkeys.forEach(function(key) {\r\n\t\t\t\tif((toTypeName(value[key]) === \'object\' || toTypeName(value[key]) === \'array\') && !value[key].hasOwnProperty(\'__observers__\')) {\r\n\t\t\t\t\tvar newparts = parts.slice(0);\r\n\t\t\t\t\tnewparts.push(key);\r\n\t\t\t\t\tvalue[key] = Object.deepObserve(value[key],callback,newparts);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treobserve(object, parts);\r\n\r\n\t\tvar observed = Object.observe(object,function(changeset) {\r\n\t\t\tvar changes = [];\r\n\t\t\tfunction recurse(name,rootObject,oldObject,newObject,path) {\r\n\t\t\t\tif(newObject instanceof Object) {\r\n\t\t\t\t\tvar newkeys = Object.keys(newObject);\r\n\t\t\t\t\tnewkeys.forEach(function(key) {\r\n\t\t\t\t\t\tif(!oldObject || (oldObject[key]!==newObject[key])) {\r\n\t\t\t\t\t\t\tvar oldvalue = (oldObject && oldObject[key]!==undefined ? oldObject[key] : undefined),\r\n\t\t\t\t\t\t\t\tchange = (oldvalue===undefined ? "add" : "update"),\r\n\t\t\t\t\t\t\t\tkeypath = path + "." + key;\r\n\r\n\t\t\t\t\t\t\tchanges.push({name:name,object:rootObject,type:change,oldValue:oldvalue,newValue:newObject[key],keypath:keypath});\r\n\t\t\t\t\t\t\trecurse(name,rootObject,oldvalue,newObject[key],keypath);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t} else if(oldObject instanceof Object) {\r\n\t\t\t\t\tvar oldkeys = Object.keys(oldObject);\r\n\t\t\t\t\toldkeys.forEach(function(key) {\r\n\t\t\t\t\t\tvar change = (newObject===null ? "update" : "delete"),\r\n\t\t\t\t\t\t\tkeypath = path + "." + key;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tchanges.push({name:name,object:rootObject,type:change,oldValue:oldObject[key],newValue:newObject,keypath:keypath});\r\n\t\t\t\t\t\trecurse(name,rootObject,oldObject[key],undefined,keypath);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tchangeset.forEach(function(change) {\r\n\t\t\t\tvar keypath = (parts.length>0 ? parts.join(".") + "." : "") + change.name;\r\n\r\n\t\t\t\tif (change.type === "update" || change.type === "add") { \r\n\t\t\t\t\treobserve(change.object, parts);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tchanges.push({name:change.name,object:change.object,type:change.type,oldValue:change.oldValue,newValue:change.object[change.name],keypath:keypath});\r\n\t\t\t\trecurse(change.name,change.object,change.oldValue,change.object[change.name],keypath);\r\n\t\t\t});\r\n\t\t\tcallback(changes);\r\n\t\t});\r\n\t\treturn observed;\r\n\t};\r\n})();\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL3Byb3h5LW9ic2VydmUvaW5kZXguanM/MTIwYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAgICAgcHJveHktb2JzZXJ2ZSB2MC4wLjE4XHJcbi8vICAgICBDb3B5cmlnaHQgKGMpIDIwMTUsIDIwMTYgU2ltb24gWS4gQmxhY2t3ZWxsLCBBbnlXaGljaFdheVxyXG4vLyAgICAgTUlUIExpY2Vuc2UgLSBodHRwOi8vb3BlbnNvdXJjZS5vcmcvbGljZW5zZXMvbWl0LWxpY2Vuc2UucGhwXHJcbihmdW5jdGlvbigpIHtcclxuXHRcInVzZSBzdHJpY3RcIjtcclxuXHQvLyBDcmVhdGVzIGFuZCByZXR1cm5zIGEgUHJveHkgd3JhcHBpbmcgYSB0YXJnZXQgc28gdGhhdCBhbGwgY2hhbmdlcyBjYW4gYmUgdHJhcHBlZCBhbmQgZm9yd2FyZGVkIHRvXHJcblx0Ly8gYSBjYWxsYmFjay4gVGhlIGNhbGxiYWNrIHRha2VzIGFuIGFycmF5IG9mIGNoYW5nZXMganVzdCBsaWtlIHRoZSB0cmFkaXRpb25hbCBvcmlnaW5hbCBDaHJvbWUgT2JqZWN0Lm9ic2VydmVcclxuXHQvLyB7b2JqZWN0OjxvYmplY3QgY2hhbmdlZD4sbmFtZTo8ZmllbGQgY2hhbmdlZD4sdHlwZTphZGR8dXBkYXRlfGRlbGV0ZXxyZWNvbmZpZ3VyZXxwcmV2ZW50RXh0ZW5zaW9uc3xzZXRQcm90b3R5cGUsb2xkVmFsd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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///149\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('RegistrationStatus'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* The RegistrationStatus lib allows to monitor registration status of an Hyperty or Data Object\n*\n*/\nvar RegistrationStatus = function () {\n\n /**\n * @param {URL} url URL address of the entity to be monitored\n * @param {URL} runtimeURL the current URL of the Runtime Instance used\n * @param {HypertyURL} owner the URL of the Hyperty instance that is using this lib\n * @param {MiniBus} owner the URL of the Hyperty instance that is using this lib\n *\n */\n\n function RegistrationStatus(url, runtimeURL, owner, msgBus) {\n (0, _classCallCheck3.default)(this, RegistrationStatus);\n\n this._registryObjectURL = url;\n this._runtimeURL = runtimeURL;\n this._domain = (0, _utils.divideURL)(runtimeURL).domain;\n this._discoveredObjectURL = owner;\n this._messageBus = msgBus;\n this._subscriptionSet = false;\n this._subscribers = {\n live: {},\n disconnected: {}\n };\n }\n\n (0, _createClass3.default)(RegistrationStatus, [{\n key: 'onLive',\n value: function onLive(subscriber, callback) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._subscriptionSet) {\n _this._subscribe().then(function () {\n _this._subscribers.live[subscriber] = callback;\n resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n _this._subscribers.live[subscriber] = callback;\n resolve();\n }\n });\n }\n }, {\n key: 'onDisconnected',\n value: function onDisconnected(subscriber, callback) {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this2._subscriptionSet) {\n _this2._subscribe().then(function () {\n _this2._subscribers.disconnected[subscriber] = callback;\n resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n _this2._subscribers.disconnected[subscriber] = callback;\n resolve();\n }\n });\n }\n }, {\n key: '_subscribe',\n value: function _subscribe() {\n var _this3 = this;\n\n var msg = {\n type: 'subscribe',\n from: this._discoveredObjectURL,\n to: this._runtimeURL + '/subscriptions',\n body: {\n resources: [this._registryObjectURL + '/registration']\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3._messageBus.postMessage(msg, function (reply) {\n log.log('[DiscoveredObject.subscribe] ' + _this3._registryObjectURL + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n _this3._generateListener(_this3._registryObjectURL + '/registration');\n _this3._subscriptionSet = true;\n resolve();\n } else {\n log.error('Error subscribing ', _this3._registryObjectURL);\n reject('Error subscribing ' + _this3._registryObjectURL);\n }\n });\n });\n }\n }, {\n key: '_generateListener',\n value: function _generateListener(notificationURL) {\n var _this4 = this;\n\n this._messageBus.addListener(notificationURL, function (msg) {\n log.log('[DiscoveredObject.notification] ' + _this4._registryObjectURL + ': ', msg);\n _this4._processNotification(msg);\n });\n }\n }, {\n key: '_processNotification',\n value: function _processNotification(msg) {\n var _this5 = this;\n\n var status = msg.body.value;\n\n setTimeout(function () {\n\n // Hack to give time for onLive Hyperties to get ready. To be removed when Hyperty State machaine is implemented\n (0, _keys2.default)(_this5._subscribers[status]).forEach(function (subscriber) {\n return _this5._subscribers[status][subscriber]();\n });\n }, 5000);\n }\n }, {\n key: '_unsubscribe',\n value: function _unsubscribe() {\n var _this6 = this;\n\n var msg = {\n type: 'unsubscribe',\n from: this._discoveredObjectURL,\n to: this._runtimeURL + '/subscriptions',\n body: {\n resource: this._registryObjectURL + '/registration'\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this6._messageBus.postMessage(msg, function (reply) {\n log.log('[DiscoveredObject.unsubscribe] ' + _this6._registryObjectURL + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n resolve();\n } else {\n log.error('Error unsubscribing ', _this6._registryObjectURL);\n reject('Error unsubscribing ' + _this6._registryObjectURL);\n }\n });\n });\n }\n }, {\n key: 'unsubscribeLive',\n value: function unsubscribeLive(subscriber) {\n var _this7 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (subscriber in _this7._subscribers.live) {\n\n //TODO: unsubscribe outside this condition\n delete _this7._subscribers.live[subscriber];\n }\n\n if (_this7._areSubscriptionsEmpty()) {\n _this7._unsubscribe().then(function () {\n return resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n resolve();\n }\n\n /* } else {\n reject(`${subscriber} doesn't subscribe onLive for ${this._registryObjectURL}`);\n }*/\n });\n }\n }, {\n key: 'unsubscribeDisconnected',\n value: function unsubscribeDisconnected(subscriber) {\n var _this8 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (subscriber in _this8._subscribers.disconnected) {\n delete _this8._subscribers.disconnected[subscriber];\n\n if (_this8._areSubscriptionsEmpty()) {\n _this8._unsubscribe().then(function () {\n return resolve();\n }).catch(function (err) {\n return reject(err);\n });\n } else {\n resolve();\n }\n } else {\n reject(subscriber + ' doesn\\'t subscribe onDisconnected for ' + _this8._registryObjectURL);\n }\n });\n }\n }, {\n key: '_areSubscriptionsEmpty',\n value: function _areSubscriptionsEmpty() {\n return (0, _keys2.default)(this._subscribers.live).length === 0 && (0, _keys2.default)(this._subscribers.disconnected).length === 0;\n }\n }]);\n return RegistrationStatus;\n}();\n\nexports.default = RegistrationStatus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvUmVnaXN0cmF0aW9uU3RhdHVzLmpzPzIyMjAiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub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0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFFQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///150\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar runtimeConfiguration = exports.runtimeConfiguration = {\n\n // TODO this should be changed with the definition used for indexeddb\n // look at: https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore\n // Now we are using the definition for Dexie; (http://dexie.org/docs/Version/Version.stores())\n storageSchemas: {\n capabilities: {\n capabilities: 'key,version,value'\n },\n subscriptions: {\n subscriptions: 'key,version,value'\n },\n runtime: {\n 'runtime:URL': 'key,version,value',\n 'p2pHandler:URL': 'key,version,value'\n },\n registry: {\n 'registry:DataObjectURLs': 'key,version,value',\n 'registry:HypertyURLs': 'key,version,value'\n },\n cryptoManager: {\n userAsymmetricKey: 'key,version,value',\n dataObjectSessionKeys: 'key,version,value'\n },\n identity: {\n accessTokens: 'key,version,value',\n identities: 'userURL, userProfile.email, userProfile.userURL, userProfile.name'\n },\n runtimeCatalogue: {\n runtimeCatalogue: '&cguid, accessControlPolicy, constraints, dataObjects, hypertyType, objectName, sourcePackage, version'\n },\n policy: {\n 'rethink:activePolicy': 'key,version,value',\n 'rethink:groups': 'key,version,value',\n 'rethink:userPolicies': 'key,version,value',\n 'rethink:spPolicies': 'key,version,value'\n },\n syncherManager: {\n 'syncherManager:ObjectURLs': 'key,version,value',\n 'remotes': 'key,version,value'\n },\n hypertyResources: {\n hypertyResources: '&resourceURL, name, contentUrl, content, created, reporter, resourceType'\n }\n },\n\n runtimeURLS: {\n registry: {\n prefix: 'hyperty-runtime://',\n suffix: 'registry'\n },\n identityModule: {\n prefix: 'hyperty-runtime://',\n suffix: '/idm'\n },\n runtimeUA: {\n prefix: 'hyperty-runtime://',\n suffix: '/ua'\n },\n catalogue: {\n prefix: 'hyperty-runtime://',\n suffix: '/catalogue'\n },\n graphConnector: {\n prefix: 'hyperty-runtime://',\n suffix: '/graph'\n },\n syncManager: {\n prefix: 'hyperty-runtime://',\n suffix: '/sm'\n }\n },\n catalogueURLs: {\n protocolstub: {\n prefix: 'hyperty-catalogue://catalogue.',\n suffix: '/.well-known/protocolstub/',\n fallback: 'hyperty-catalogue://catalogue.%domain%/.well-known/protocolstub/'\n },\n idpProxy: {\n prefix: 'hyperty-catalogue://catalogue.',\n suffix: '/.well-known/idp-proxy/',\n fallback: 'hyperty-catalogue://catalogue.%domain%/.well-known/idp-proxy/'\n }\n },\n msgNodeURL: {\n prefix: 'domain://msg-node.',\n suffix: '',\n hypertyAddressAllocation: '/hyperty-address-allocation',\n objectAddressAllocation: '/object-address-allocation',\n subscriptionManagement: '/sm'\n },\n domainRegistryURL: {\n prefix: 'domain://registry.',\n suffix: ''\n },\n globalRegistryURL: 'global://registry.',\n remoteStorage: 'https://hysmart.rethink.ptinovacao.pt/backup/'\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL3J1bnRpbWVDb25maWd1cmF0aW9uLmpzPzZiMWIiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IHJ1bnRpbWVDb25maWd1cmF0aW9uID0ge1xuXG4gIC8vIFRPRE8gdGhpcyBzaG91bGQgYmUgY2hhbmdlZCB3aXRoIHRoZSBkZWZpbml0aW9uIHVzZWQgZm9yIGluZGV4ZWRkYlxuICAvLyBsb29rIGF0OiBodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZy9lbi1VUy9kb2NzL1dlYi9BUEkvSURCT2JqZWN0U3RvcmVcbiAgLy8gTm93IHdlIGFyZSB1c2luZyB0aGU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UFJQTtBQUNBO0FBQ0E7QUFGQTtBQXJCQTtBQTBCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBTkE7QUFZQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFMQTtBQU9BO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFDQTtBQWhHQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///151\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Operators = function () {\n function Operators() {\n (0, _classCallCheck3.default)(this, Operators);\n }\n\n (0, _createClass3.default)(Operators, [{\n key: 'and',\n value: function and(params) {\n return params[0] && params[1];\n }\n }, {\n key: 'between',\n value: function between(params) {\n var start = parseInt(params[0][0]);\n var end = parseInt(params[0][1]);\n var now = params[1];\n\n if (end < start) {\n now = now < start ? now += 2400 : now;\n end += 2400;\n }\n\n return now > start && now < end;\n }\n }, {\n key: 'equals',\n value: function equals(params) {\n return String(params[0]) === '*' || String(params[0]) === String(params[1]);\n }\n }, {\n key: 'greaterThan',\n value: function greaterThan(params) {\n return params[1] > params[0];\n }\n }, {\n key: 'in',\n value: function _in(params) {\n return params[0].indexOf(params[1]) > -1;\n }\n }, {\n key: 'lessThan',\n value: function lessThan(params) {\n return params[1] < params[0];\n }\n }, {\n key: 'not',\n value: function not(params) {\n return !params[0];\n }\n }, {\n key: 'or',\n value: function or(params) {\n return params[0] || params[1];\n }\n }]);\n return Operators;\n}();\n\nexports.default = Operators;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvT3BlcmF0b3JzLmpzPzFjNDIiXSwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgT3BlcmF0b3JzIHtcblxuICBhbmQocGFyYW1zKSB7XG4gICAgcmV0dXJuIHBhcmFtc1swXSAmJiBwYXJhbXNbMV07XG4gIH1cblxuICBiZXR3ZWVuKHBhcmFtcykge1xuICAgIGxldCBzdGFydCA9IHBhcnNlSW50KHBhcmFtc1swXVswXSk7XG4gICAgbGV0IGVuZCA9IHBhcnNlSW50KHBhcmFtc1swXVsxXSk7XG4gICAgbGV0IG5vdyA9IHBhcmFtc1sxXTtcblxuICAgIGlmIChlbmQgPCBzdGFydCkge1xuICAgICAgbm93ID0gKG5vdyA8IHN0YXJ0KSA/IG5vdyArPSAyNDAwIDogbm93O1xuICAgICAgZW5kICs9IDI0MDA7XG4gICAgfVxuXG4gICAgcmV0dXJuIChub3cgPiBzdGFydCAmJiBub3cgPCBlbmQpO1xuICB9XG5cbiAgZXF1YWxzKHBhcmFtcykge1xuICAgIHJldHVybiBTdHJpbmcocGFyYW1zWzBdKSA9PT0gJyonIHx8IFN0cmluZyhwYXJhbXNbMF0pID09PSBTdHJpbmcocGFyYW1zWzFdKTtcbiAgfVxuXG4gIGdyZWF0ZXJUaGFuKHBhcmFtcykge1xuICAgIHJldHVybiBwYXJhbXNbMV0gPiBwYXJhbXNbMF07XG4gIH1cblxuICBpbihwYXJhbXMpIHtcbiAgICByZXR1cm4gcGFyYW1zWzBdLmluZGV4T2YocGFyYW1zWzFdKSA+IC0xO1xuICB9XG5cbiAgbGVzc1RoYW4ocGFyYW1zKSB7XG4gICAgcmV0dXJuIHBhcmFtc1sxXSA8IHBhcmFtc1swXTtcbiAgfVxuXG4gIG5vdChwYXJhbXMpIHtcbiAgICByZXR1cm4gIXBhcmFtc1swXTtcbiAgfVxuXG4gIG9yKHBhcmFtcykge1xuICAgIHJldHVybiBwYXJhbXNbMF0gfHwgcGFyYW1zWzFdO1xuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgT3BlcmF0b3JzO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvT3BlcmF0b3JzLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUE7Ozs7Ozs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///152\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(152);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a condition and evaluate its applicability.\n*/\nvar Condition = function () {\n\n /**\n * Creates a new Condition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function Condition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, Condition);\n\n this.attribute = attribute;\n this.operator = operator;\n this.params = params;\n this.operators = new _Operators2.default();\n }\n\n /**\n * Verifies if the condition is applicable to the message. First, the system value that corresponds to the attribute is retrieved; then, that value is compared with the parameter specified in the condition by executing the operator implementation. If the operator is 'in' and the name of a group is given, then the array holding the members of the group is retrieved before the comparison.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(Condition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n context[this.attribute] = { message: message };\n var value = context[this.attribute];\n var tempParam = void 0;\n\n if (this.operator === 'in') {\n if (!Array.isArray(this.params)) {\n tempParam = context.getGroup(this.params, message.to);\n return this.operators[this.operator]([tempParam, value]);\n }\n }\n\n return this.operators[this.operator]([this.params, value]);\n }\n }]);\n return Condition;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = Condition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9Db25kaXRpb24uanM/MmUzMyJdLCJzb3Vy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vcGVyYXRvcl0oW3RoaXMucGFyYW1zLCB2YWx1ZV0pO1xuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ29uZGl0aW9uO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvY29uZGl0aW9ucy9Db25kaXRpb24uanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBdUJBO0FBQ0E7Ozs7O0FBQ0E7Ozs7QUFJQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBL0RBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQW1FQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///153\n")},function(module,exports){eval('var g;\r\n\r\n// This works in non-strict mode\r\ng = (function() {\r\n\treturn this;\r\n})();\r\n\r\ntry {\r\n\t// This works if eval is allowed (see CSP)\r\n\tg = g || Function("return this")() || (1,eval)("this");\r\n} catch(e) {\r\n\t// This works if the window reference is available\r\n\tif(typeof window === "object")\r\n\t\tg = window;\r\n}\r\n\r\n// g can still be undefined, but nothing to do about it...\r\n// We return undefined, instead of nothing here, so it\'s\r\n// easier to handle this case. if(!global) { ...}\r\n\r\nmodule.exports = g;\r\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLyh3ZWJwYWNrKS9idWlsZGluL2dsb2JhbC5qcz8zNjk4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBnO1xyXG5cclx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jZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///154\n')},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(12) && !__webpack_require__(8)(function () {\n return Object.defineProperty(__webpack_require__(106)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faWU4LWRvbS1kZWZpbmUuanM/YzU5NiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9ICFyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICFyZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIE9iamVjdC5kZWZpbmVQcm9wZXJ0eShyZXF1aXJlKCcuL19kb20tY3JlYXRlJykoJ2RpdicpLCAnYScsIHsgZ2V0OiBmdW5jdGlvbiAoKSB7IHJldHVybiA3OyB9IH0pLmEgIT0gNztcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qc1xuLy8gbW9kdWxlIGlkID0gMTU1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///155\n")},function(module,exports,__webpack_require__){eval("exports.f = __webpack_require__(10);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fd2tzLWV4dC5qcz8zM2M1Il0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydHMuZiA9IHJlcXVpcmUoJy4vX3drcycpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL193a3MtZXh0LmpzXG4vLyBtb2R1bGUgaWQgPSAxNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///156\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(27);\nvar toIObject = __webpack_require__(28);\nvar arrayIndexOf = __webpack_require__(84)(false);\nvar IE_PROTO = __webpack_require__(108)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanM/NDVlMSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIGFycmF5SW5kZXhPZiA9IHJlcXVpcmUoJy4vX2FycmF5LWluY2x1ZGVzJykoZmFsc2UpO1xudmFyIElFX1BST1RPID0gcmVxdWlyZSgnLi9fc2hhcmVkLWtleScpKCdJRV9QUk9UTycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvYmplY3QsIG5hbWVzKSB7XG4gIHZhciBPID0gdG9JT2JqZWN0KG9iamVjdCk7XG4gIHZhciBpID0gMDtcbiAgdmFyIHJlc3VsdCA9IFtdO1xuICB2YXIga2V5O1xuICBmb3IgKGtleSBpbiBPKSBpZiAoa2V5ICE9IElFX1BST1RPKSBoYXMoTywga2V5KSAmJiByZXN1bHQucHVzaChrZXkpO1xuICAvLyBEb24ndCBlbnVtIGJ1ZyAmIGhpZGRlbiBrZXlzXG4gIHdoaWxlIChuYW1lcy5sZW5ndGggPiBpKSBpZiAoaGFzKE8sIGtleSA9IG5hbWVzW2krK10pKSB7XG4gICAgfmFycmF5SW5kZXhPZihyZXN1bHQsIGtleSkgfHwgcmVzdWx0LnB1c2goa2V5KTtcbiAgfVxuICByZXR1cm4gcmVzdWx0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWtleXMtaW50ZXJuYWwuanNcbi8vIG1vZHVsZSBpZCA9IDE1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///157\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(13);\nvar anObject = __webpack_require__(5);\nvar getKeys = __webpack_require__(54);\n\nmodule.exports = __webpack_require__(12) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qcz9iNzBjIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSA/IE9iamVjdC5kZWZpbmVQcm9wZXJ0aWVzIDogZnVuY3Rpb24gZGVmaW5lUHJvcGVydGllcyhPLCBQcm9wZXJ0aWVzKSB7XG4gIGFuT2JqZWN0KE8pO1xuICB2YXIga2V5cyA9IGdldEtleXMoUHJvcGVydGllcyk7XG4gIHZhciBsZW5ndGggPSBrZXlzLmxlbmd0aDtcbiAgdmFyIGkgPSAwO1xuICB2YXIgUDtcbiAgd2hpbGUgKGxlbmd0aCA+IGkpIGRQLmYoTywgUCA9IGtleXNbaSsrXSwgUHJvcGVydGllc1tQXSk7XG4gIHJldHVybiBPO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWRwcy5qc1xuLy8gbW9kdWxlIGlkID0gMTU4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///158\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(28);\nvar gOPN = __webpack_require__(57).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWdvcG4tZXh0LmpzPzZjNmYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsbGJhY2sgZm9yIElFMTEgYnVnZ3kgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMgd2l0aCBpZnJhbWUgYW5kIHdpbmRvd1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBnT1BOID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4nKS5mO1xudmFyIHRvU3RyaW5nID0ge30udG9TdHJpbmc7XG5cbnZhciB3aW5kb3dOYW1lcyA9IHR5cGVvZiB3aW5kb3cgPT0gJ29iamVjdCcgJiYgd2luZG93ICYmIE9iamVjdC5nZXRPd25Qcm9wZXJ0eU5hbWVzXG4gID8gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMod2luZG93KSA6IFtdO1xuXG52YXIgZ2V0V2luZG93TmFtZXMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgdHJ5IHtcbiAgICByZXR1cm4gZ09QTihpdCk7XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICByZXR1cm4gd2luZG93TmFtZXMuc2xpY2UoKTtcbiAgfVxufTtcblxubW9kdWxlLmV4cG9ydHMuZiA9IGZ1bmN0aW9uIGdldE93blByb3BlcnR5TmFtZXMoaXQpIHtcbiAgcmV0dXJuIHdpbmRvd05hbWVzICYmIHRvU3RyaW5nLmNhbGwoaXQpID09ICdbb2JqZWN0IFdpbmRvd10nID8gZ2V0V2luZG93TmFtZXMoaXQpIDogZ09QTih0b0lPYmplY3QoaXQpKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX29iamVjdC1nb3BuLWV4dC5qc1xuLy8gbW9kdWxlIGlkID0gMTU5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///159\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(54);\nvar gOPS = __webpack_require__(85);\nvar pIE = __webpack_require__(74);\nvar toObject = __webpack_require__(19);\nvar IObject = __webpack_require__(73);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(8)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LWFzc2lnbi5qcz9hMTg3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDE5LjEuMi4xIE9iamVjdC5hc3NpZ24odGFyZ2V0LCBzb3VyY2UsIC4uLilcbnZhciBnZXRLZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcbnZhciBnT1BTID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcHMnKTtcbnZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG52YXIgdG9PYmplY3QgPSByZXF1aXJlKCcuL190by1vYmplY3QnKTtcbnZhciBJT2JqZWN0ID0gcmVxdWlyZSgnLi9faW9iamVjdCcpO1xudmFyICRhc3NpZ24gPSBPYmplY3QuYXNzaWduO1xuXG4vLyBzaG91bGQgd29yayB3aXRoIHN5bWJvbHMgYW5kIHNob3VsZCBoYXZlIGRldGVybWluaXN0aWMgcHJvcGVydHkgb3JkZXIgKFY4IGJ1Zylcbm1vZHVsZS5leHBvcnRzID0gISRhc3NpZ24gfHwgcmVxdWlyZSgn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G5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19vYmplY3QtYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSAxNjBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///160\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar aFunction = __webpack_require__(20);\nvar isObject = __webpack_require__(9);\nvar invoke = __webpack_require__(162);\nvar arraySlice = [].slice;\nvar factories = {};\n\nvar construct = function (F, len, args) {\n if (!(len in factories)) {\n for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';\n // eslint-disable-next-line no-new-func\n factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');\n } return factories[len](F, args);\n};\n\nmodule.exports = Function.bind || function bind(that /* , ...args */) {\n var fn = aFunction(this);\n var partArgs = arraySlice.call(arguments, 1);\n var bound = function (/* args... */) {\n var args = partArgs.concat(arraySlice.call(arguments));\n return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);\n };\n if (isObject(fn.prototype)) bound.prototype = fn.prototype;\n return bound;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9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lb2YgYm91bmQgPyBjb25zdHJ1Y3QoZm4sIGFyZ3MubGVuZ3RoLCBhcmdzKSA6IGludm9rZShmbiwgYXJncywgdGhhdCk7XG4gIH07XG4gIGlmIChpc09iamVjdChmbi5wcm90b3R5cGUpKSBib3VuZC5wcm90b3R5cGUgPSBmbi5wcm90b3R5cGU7XG4gIHJldHVybiBib3VuZDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2JpbmQuanNcbi8vIG1vZHVsZSBpZCA9IDE2MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///161\n")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9t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ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pbnZva2UuanNcbi8vIG1vZHVsZSBpZCA9IDE2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///162\n")},function(module,exports,__webpack_require__){eval("var $parseInt = __webpack_require__(7).parseInt;\nvar $trim = __webpack_require__(65).trim;\nvar ws = __webpack_require__(112);\nvar hex = /^[-+]?0[xX]/;\n\nmodule.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {\n var string = $trim(String(str), 3);\n return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));\n} : $parseInt;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcGFyc2UtaW50LmpzPzNhMDQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRwYXJzZUludCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLnBhcnNlSW50O1xudmFyICR0cmltID0gcmVxdWlyZSgnLi9fc3RyaW5nLXRyaW0nKS50cmltO1xudmFyIHdzID0gcmVxdWlyZSgnLi9fc3RyaW5nLXdzJyk7XG52YXIgaGV4ID0gL15bLStdPzBbeFhdLztcblxubW9kdWxlLmV4cG9ydHMgPSAkcGFyc2VJbnQod3MgKyAnMDgnKSAhPT0gOCB8fCAkcGFyc2VJbnQod3MgKyAnMHgxNicpICE9PSAyMiA/IGZ1bmN0aW9uIHBhcnNlSW50KHN0ciwgcmFkaXgpIHtcbiAgdmFyIHN0cmluZyA9ICR0cmltKFN0cmluZyhzdHIpLCAzKTtcbiAgcmV0dXJuICRwYXJzZUludChzdHJpbmcsIChyYWRpeCA+Pj4gMCkgfHwgKGhleC50ZXN0KHN0cmluZykgPyAxNiA6IDEwKSk7XG59IDogJHBhcnNlSW50O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wYXJzZS1pbnQuanNcbi8vIG1vZHVsZSBpZCA9IDE2M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///163\n")},function(module,exports,__webpack_require__){eval("var $parseFloat = __webpack_require__(7).parseFloat;\nvar $trim = __webpack_require__(65).trim;\n\nmodule.exports = 1 / $parseFloat(__webpack_require__(112) + '-0') !== -Infinity ? function parseFloat(str) {\n var string = $trim(String(str), 3);\n var result = $parseFloat(string);\n return result === 0 && string.charAt(0) == '-' ? -0 : result;\n} : $parseFloat;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcGFyc2UtZmxvYXQuanM/ZjJkZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJHBhcnNlRmxvYXQgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5wYXJzZUZsb2F0O1xudmFyICR0cmltID0gcmVxdWlyZSgnLi9fc3RyaW5nLXRyaW0nKS50cmltO1xuXG5tb2R1bGUuZXhwb3J0cyA9IDEgLyAkcGFyc2VGbG9hdChyZXF1aXJlKCcuL19zdHJpbmctd3MnKSArICctMCcpICE9PSAtSW5maW5pdHkgPyBmdW5jdGlvbiBwYXJzZUZsb2F0KHN0cikge1xuICB2YXIgc3RyaW5nID0gJHRyaW0oU3RyaW5nKHN0ciksIDMpO1xuICB2YXIgcmVzdWx0ID0gJHBhcnNlRmxvYXQoc3RyaW5nKTtcbiAgcmV0dXJuIHJlc3VsdCA9PT0gMCAmJiBzdHJpbmcuY2hhckF0KDApID09ICctJyA/IC0wIDogcmVzdWx0O1xufSA6ICRwYXJzZUZsb2F0O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19wYXJzZS1mbG9hdC5qc1xuLy8gbW9kdWxlIGlkID0gMTY0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///164\n")},function(module,exports,__webpack_require__){eval("var cof = __webpack_require__(34);\nmodule.exports = function (it, msg) {\n if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);\n return +it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYS1udW1iZXItdmFsdWUuanM/N2QyZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCwgbXNnKSB7XG4gIGlmICh0eXBlb2YgaXQgIT0gJ251bWJlcicgJiYgY29mKGl0KSAhPSAnTnVtYmVyJykgdGhyb3cgVHlwZUVycm9yKG1zZyk7XG4gIHJldHVybiAraXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hLW51bWJlci12YWx1ZS5qc1xuLy8gbW9kdWxlIGlkID0gMTY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///165\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(9);\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXMtaW50ZWdlci5qcz85ZmRmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi4zIE51bWJlci5pc0ludGVnZXIobnVtYmVyKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZmxvb3IgPSBNYXRoLmZsb29yO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBpc0ludGVnZXIoaXQpIHtcbiAgcmV0dXJuICFpc09iamVjdChpdCkgJiYgaXNGaW5pdGUoaXQpICYmIGZsb29yKGl0KSA9PT0gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19pcy1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAxNjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///166\n")},function(module,exports){eval("// 20.2.2.20 Math.log1p(x)\nmodule.exports = Math.log1p || function log1p(x) {\n return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1sb2cxcC5qcz80NzNkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4yMCBNYXRoLmxvZzFwKHgpXG5tb2R1bGUuZXhwb3J0cyA9IE1hdGgubG9nMXAgfHwgZnVuY3Rpb24gbG9nMXAoeCkge1xuICByZXR1cm4gKHggPSAreCkgPiAtMWUtOCAmJiB4IDwgMWUtOCA/IHggLSB4ICogeCAvIDIgOiBNYXRoLmxvZygxICsgeCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tYXRoLWxvZzFwLmpzXG4vLyBtb2R1bGUgaWQgPSAxNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///167\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.16 Math.fround(x)\nvar sign = __webpack_require__(115);\nvar pow = Math.pow;\nvar EPSILON = pow(2, -52);\nvar EPSILON32 = pow(2, -23);\nvar MAX32 = pow(2, 127) * (2 - EPSILON32);\nvar MIN32 = pow(2, -126);\n\nvar roundTiesToEven = function (n) {\n return n + 1 / EPSILON - 1 / EPSILON;\n};\n\nmodule.exports = Math.fround || function fround(x) {\n var $abs = Math.abs(x);\n var $sign = sign(x);\n var a, result;\n if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;\n a = (1 + EPSILON32 / EPSILON) * $abs;\n result = a - (a - $abs);\n // eslint-disable-next-line no-self-compare\n if (result > MAX32 || result != result) return $sign * Infinity;\n return $sign * result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1mcm91bmQuanM/ODNmOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4yLjIuMTYgTWF0aC5mcm91bmQoeClcbnZhciBzaWduID0gcmVxdWlyZSgnLi9fbWF0aC1zaWduJyk7XG52YXIgcG93ID0gTWF0aC5wb3c7XG52YXIgRVBTSUxPTiA9IHBvdygyLCAtNTIpO1xudmFyIEVQU0lMT04zMiA9IHBvdygyLCAtMjMpO1xudmFyIE1BWDMyID0gcG93KDIsIDEyNykgKiAoMiAtIEVQU0lMT04zMik7XG52YXIgTUlOMzIgPSBwb3coMiwgLTEyNik7XG5cbnZhciByb3VuZFRpZXNUb0V2ZW4gPSBmdW5jdGlvbiAobikge1xuICByZXR1cm4gbiArIDEgLyBFUFNJTE9OIC0gMSAvIEVQU0lMT047XG59O1xuXG5tb2R1bGUuZXhwb3J0cyA9IE1hdGguZnJvdW5kIHx8IGZ1bmN0aW9uIGZyb3VuZCh4KSB7XG4gIHZhciAkYWJzID0gTWF0aC5hYnMoeCk7XG4gIHZhciAkc2lnbiA9IHNpZ24oeCk7XG4gIHZhciBhLCByZXN1bHQ7XG4gIGlmICgkYWJzIDwgTUlOMzIpIHJldHVybiAkc2lnbiAqIHJvdW5kVGllc1RvRXZlbigkYWJzIC8gTUlOMzIgLyBFUFNJTE9OMzIpICogTUlOMzIgKiBFUFNJTE9OMzI7XG4gIGEgPSAoMSArIEVQU0lMT04zMiAvIEVQU0lMT04pICogJGFicztcbiAgcmVzdWx0ID0gYSAtIChhIC0gJGFicyk7XG4gIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgaWYgKHJlc3VsdCA+IE1BWDMyIHx8IHJlc3VsdCAhPSByZXN1bHQpIHJldHVybiAkc2lnbiAqIEluZmluaXR5O1xuICByZXR1cm4gJHNpZ24gKiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19tYXRoLWZyb3VuZC5qc1xuLy8gbW9kdWxlIGlkID0gMTY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///168\n")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(5);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1jYWxsLmpzPzVlZjUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gY2FsbCBzb21ldGhpbmcgb24gaXRlcmF0b3Igc3RlcCB3aXRoIHNhZmUgY2xvc2luZyBvbiBlcnJvclxudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdGVyYXRvciwgZm4sIHZhbHVlLCBlbnRyaWVzKSB7XG4gIHRyeSB7XG4gICAgcmV0dXJuIGVudHJpZXMgPyBmbihhbk9iamVjdCh2YWx1ZSlbMF0sIHZhbHVlWzFdKSA6IGZuKHZhbHVlKTtcbiAgLy8gNy40LjYgSXRlcmF0b3JDbG9zZShpdGVyYXRvciwgY29tcGxldGlvbilcbiAgfSBjYXRjaCAoZSkge1xuICAgIHZhciByZXQgPSBpdGVyYXRvclsncmV0dXJuJ107XG4gICAgaWYgKHJldCAhPT0gdW5kZWZpbmVkKSBhbk9iamVjdChyZXQuY2FsbChpdGVyYXRvcikpO1xuICAgIHRocm93IGU7XG4gIH1cbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2l0ZXItY2FsbC5qc1xuLy8gbW9kdWxlIGlkID0gMTY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///169\n")},function(module,exports,__webpack_require__){eval("var aFunction = __webpack_require__(20);\nvar toObject = __webpack_require__(19);\nvar IObject = __webpack_require__(73);\nvar toLength = __webpack_require__(14);\n\nmodule.exports = function (that, callbackfn, aLen, memo, isRight) {\n aFunction(callbackfn);\n var O = toObject(that);\n var self = IObject(O);\n var length = toLength(O.length);\n var index = isRight ? length - 1 : 0;\n var i = isRight ? -1 : 1;\n if (aLen < 2) for (;;) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (isRight ? index < 0 : length <= index) {\n throw TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktcmVkdWNlLmpzPzE2NDIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAodGhhdCwgY2FsbGJhY2tmbiwgYUxlbiwgbWVtbywgaXNSaWdodCkge1xuICBhRnVuY3Rpb24oY2FsbGJhY2tmbik7XG4gIHZhciBPID0gdG9PYmplY3QodGhhdCk7XG4g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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///170\n")},function(module,exports,__webpack_require__){"use strict";eval("// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\n\nvar toObject = __webpack_require__(19);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\n\nmodule.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {\n var O = toObject(this);\n var len = toLength(O.length);\n var to = toAbsoluteIndex(target, len);\n var from = toAbsoluteIndex(start, len);\n var end = arguments.length > 2 ? arguments[2] : undefined;\n var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);\n var inc = 1;\n if (from < to && to < from + count) {\n inc = -1;\n from += count - 1;\n to += count - 1;\n }\n while (count-- > 0) {\n if (from in O) O[to] = O[from];\n else delete O[to];\n to += inc;\n from += inc;\n } return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktY29weS13aXRoaW4uanM/MGNmYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjMuMyBBcnJheS5wcm90b3R5cGUuY29weVdpdGhpbih0YXJnZXQsIHN0YXJ0LCBlbmQgPSB0aGlzLmxlbmd0aClcbid1c2Ugc3RyaWN0JztcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIHRvQWJzb2x1dGVJbmRleCA9IHJlcXVpcmUoJy4vX3RvLWFic29sdXRlLWluZGV4Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcblxubW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Z3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///171\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9faXRlci1zdGVwLmpzPzI4MWQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZG9uZSwgdmFsdWUpIHtcbiAgcmV0dXJuIHsgdmFsdWU6IHZhbHVlLCBkb25lOiAhIWRvbmUgfTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2l0ZXItc3RlcC5qc1xuLy8gbW9kdWxlIGlkID0gMTcyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///172\n")},function(module,exports,__webpack_require__){eval("// 21.2.5.3 get RegExp.prototype.flags()\nif (__webpack_require__(12) && /./g.flags != 'g') __webpack_require__(13).f(RegExp.prototype, 'flags', {\n configurable: true,\n get: __webpack_require__(89)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmZsYWdzLmpzP2E1ZGYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMi41LjMgZ2V0IFJlZ0V4cC5wcm90b3R5cGUuZmxhZ3MoKVxuaWYgKHJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgLy4vZy5mbGFncyAhPSAnZycpIHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYoUmVnRXhwLnByb3RvdHlwZSwgJ2ZsYWdzJywge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogcmVxdWlyZSgnLi9fZmxhZ3MnKVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5mbGFncy5qc1xuLy8gbW9kdWxlIGlkID0gMTczXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///173\n")},function(module,exports){eval("module.exports = function (exec) {\n try {\n return { e: false, v: exec() };\n } catch (e) {\n return { e: true, v: e };\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcGVyZm9ybS5qcz80ODM1Il0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGV4ZWMpIHtcbiAgdHJ5IHtcbiAgICByZXR1cm4geyBlOiBmYWxzZSwgdjogZXhlYygpIH07XG4gIH0gY2F0Y2ggKGUpIHtcbiAgICByZXR1cm4geyBlOiB0cnVlLCB2OiBlIH07XG4gIH1cbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3BlcmZvcm0uanNcbi8vIG1vZHVsZSBpZCA9IDE3NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///174\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar newPromiseCapability = __webpack_require__(130);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvbWlzZS1yZXNvbHZlLmpzPzllOTgiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBuZXdQcm9taXNlQ2FwYWJpbGl0eSA9IHJlcXVpcmUoJy4vX25ldy1wcm9taXNlLWNhcGFiaWxpdHknKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoQywgeCkge1xuICBhbk9iamVjdChDKTtcbiAgaWYgKGlzT2JqZWN0KHgpICYmIHguY29uc3RydWN0b3IgPT09IEMpIHJldHVybiB4O1xuICB2YXIgcHJvbWlzZUNhcGFiaWxpdHkgPSBuZXdQcm9taXNlQ2FwYWJpbGl0eS5mKEMpO1xuICB2YXIgcmVzb2x2ZSA9IHByb21pc2VDYXBhYmlsaXR5LnJlc29sdmU7XG4gIHJlc29sdmUoeCk7XG4gIHJldHVybiBwcm9taXNlQ2FwYWJpbGl0eS5wcm9taXNlO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcHJvbWlzZS1yZXNvbHZlLmpzXG4vLyBtb2R1bGUgaWQgPSAxNzVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///175\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar strong = __webpack_require__(177);\nvar validate = __webpack_require__(67);\nvar MAP = 'Map';\n\n// 23.1 Map Objects\nmodule.exports = __webpack_require__(93)(MAP, function (get) {\n return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.1.3.6 Map.prototype.get(key)\n get: function get(key) {\n var entry = strong.getEntry(validate(this, MAP), key);\n return entry && entry.v;\n },\n // 23.1.3.9 Map.prototype.set(key, value)\n set: function set(key, value) {\n return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);\n }\n}, strong, true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc2LmpzIiwic291cmNlc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R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWFwLmpzXG4vLyBtb2R1bGUgaWQgPSAxNzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///176\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar dP = __webpack_require__(13).f;\nvar create = __webpack_require__(56);\nvar redefineAll = __webpack_require__(61);\nvar ctx = __webpack_require__(33);\nvar anInstance = __webpack_require__(59);\nvar forOf = __webpack_require__(60);\nvar $iterDefine = __webpack_require__(118);\nvar step = __webpack_require__(172);\nvar setSpecies = __webpack_require__(58);\nvar DESCRIPTORS = __webpack_require__(12);\nvar fastKey = __webpack_require__(47).fastKey;\nvar validate = __webpack_require__(67);\nvar SIZE = DESCRIPTORS ? '_s' : 'size';\n\nvar getEntry = function (that, key) {\n // fast case\n var index = fastKey(key);\n var entry;\n if (index !== 'F') return that._i[index];\n // frozen object case\n for (entry = that._f; entry; entry = entry.n) {\n if (entry.k == key) return entry;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = create(null); // index\n that._f = undefined; // first entry\n that._l = undefined; // last entry\n that[SIZE] = 0; // size\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.1.3.1 Map.prototype.clear()\n // 23.2.3.2 Set.prototype.clear()\n clear: function clear() {\n for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {\n entry.r = true;\n if (entry.p) entry.p = entry.p.n = undefined;\n delete data[entry.i];\n }\n that._f = that._l = undefined;\n that[SIZE] = 0;\n },\n // 23.1.3.3 Map.prototype.delete(key)\n // 23.2.3.4 Set.prototype.delete(value)\n 'delete': function (key) {\n var that = validate(this, NAME);\n var entry = getEntry(that, key);\n if (entry) {\n var next = entry.n;\n var prev = entry.p;\n delete that._i[entry.i];\n entry.r = true;\n if (prev) prev.n = next;\n if (next) next.p = prev;\n if (that._f == entry) that._f = next;\n if (that._l == entry) that._l = prev;\n that[SIZE]--;\n } return !!entry;\n },\n // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)\n // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)\n forEach: function forEach(callbackfn /* , that = undefined */) {\n validate(this, NAME);\n var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);\n var entry;\n while (entry = entry ? entry.n : this._f) {\n f(entry.v, entry.k, this);\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n }\n },\n // 23.1.3.7 Map.prototype.has(key)\n // 23.2.3.7 Set.prototype.has(value)\n has: function has(key) {\n return !!getEntry(validate(this, NAME), key);\n }\n });\n if (DESCRIPTORS) dP(C.prototype, 'size', {\n get: function () {\n return validate(this, NAME)[SIZE];\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var entry = getEntry(that, key);\n var prev, index;\n // change existing entry\n if (entry) {\n entry.v = value;\n // create new entry\n } else {\n that._l = entry = {\n i: index = fastKey(key, true), // <- index\n k: key, // <- key\n v: value, // <- value\n p: prev = that._l, // <- previous entry\n n: undefined, // <- next entry\n r: false // <- removed\n };\n if (!that._f) that._f = entry;\n if (prev) prev.n = entry;\n that[SIZE]++;\n // add to index\n if (index !== 'F') that._i[index] = entry;\n } return that;\n },\n getEntry: getEntry,\n setStrong: function (C, NAME, IS_MAP) {\n // add .keys, .values, .entries, [@@iterator]\n // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11\n $iterDefine(C, NAME, function (iterated, kind) {\n this._t = validate(iterated, NAME); // target\n this._k = kind; // kind\n this._l = undefined; // previous\n }, function () {\n var that = this;\n var kind = that._k;\n var entry = that._l;\n // revert to the last existing entry\n while (entry && entry.r) entry = entry.p;\n // get next entry\n if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {\n // or finish the iteration\n that._t = undefined;\n return step(1);\n }\n // return step by kind\n if (kind == 'keys') return step(0, entry.k);\n if (kind == 'values') return step(0, entry.v);\n return step(0, [entry.k, entry.v]);\n }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);\n\n // add [@@species], 23.1.2.2, 23.2.2.2\n setSpecies(NAME);\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi1zdHJvbmcuanM/MGUwOCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgZFAgPSByZXF1aXJlKCcuL19vYmplY3QtZHAnKS5mO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciByZWRlZmluZUFsbCA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lLWFsbCcpO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIGFuSW5zdGFuY2UgPSByZXF1aXJlKCcuL19hbi1pbnN0YW5jZScpO1xudmFyIGZvck9mID0gcmVxdWlyZSgnLi9fZm9yLW9mJyk7XG52YXIgJGl0ZXJEZWZpbmUgPSByZXF1aXJlKCcuL19pdGVyLWRlZmluZScpO1xudmFyIHN0ZXAgPSByZXF1aXJlKCcuL19pdGVyLXN0ZXAnKTtcbnZhciBzZXRTcGVjaWVzID0gcmVxdWly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iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///177\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar strong = __webpack_require__(177);\nvar validate = __webpack_require__(67);\nvar SET = 'Set';\n\n// 23.2 Set Objects\nmodule.exports = __webpack_require__(93)(SET, function (get) {\n return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.2.3.1 Set.prototype.add(value)\n add: function add(value) {\n return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);\n }\n}, strong);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc2V0LmpzPzc1MjUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIHN0cm9uZyA9IHJlcXVpcmUoJy4vX2NvbGxlY3Rpb24tc3Ryb25nJyk7XG52YXIgdmFsaWRhdGUgPSByZXF1aXJlKCcuL192YWxpZGF0ZS1jb2xsZWN0aW9uJyk7XG52YXIgU0VUID0gJ1NldCc7XG5cbi8vIDIzLjIgU2V0IE9iamVjdHNcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fY29sbGVjdGlvbicpKFNFVCwgZnVuY3Rpb24gKGdldCkge1xuICByZXR1cm4gZnVuY3Rpb24gU2V0KCkgeyByZXR1cm4gZ2V0KHRoaXMsIGFyZ3VtZW50cy5sZW5ndGggPiAwID8gYXJndW1lbnRzWzBdIDogdW5kZWZpbmVkKTsgfTtcbn0sIHtcbiAgLy8gMjMuMi4zLjEgU2V0LnByb3RvdHlwZS5hZGQodmFsdWUpXG4gIGFkZDogZnVuY3Rpb24gYWRkKHZhbHVlKSB7XG4gICAgcmV0dXJuIHN0cm9uZy5kZWYodmFsaWRhdGUodGhpcywgU0VUKSwgdmFsdWUgPSB2YWx1ZSA9PT0gMCA/IDAgOiB2YWx1ZSwgdmFsdWUpO1xuICB9XG59LCBzdHJvbmcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zZXQuanNcbi8vIG1vZHVsZSBpZCA9IDE3OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///178\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar each = __webpack_require__(40)(0);\nvar redefine = __webpack_require__(24);\nvar meta = __webpack_require__(47);\nvar assign = __webpack_require__(160);\nvar weak = __webpack_require__(180);\nvar isObject = __webpack_require__(9);\nvar fails = __webpack_require__(8);\nvar validate = __webpack_require__(67);\nvar WEAK_MAP = 'WeakMap';\nvar getWeak = meta.getWeak;\nvar isExtensible = Object.isExtensible;\nvar uncaughtFrozenStore = weak.ufstore;\nvar tmp = {};\nvar InternalMap;\n\nvar wrapper = function (get) {\n return function WeakMap() {\n return get(this, arguments.length > 0 ? arguments[0] : undefined);\n };\n};\n\nvar methods = {\n // 23.3.3.3 WeakMap.prototype.get(key)\n get: function get(key) {\n if (isObject(key)) {\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);\n return data ? data[this._i] : undefined;\n }\n },\n // 23.3.3.5 WeakMap.prototype.set(key, value)\n set: function set(key, value) {\n return weak.def(validate(this, WEAK_MAP), key, value);\n }\n};\n\n// 23.3 WeakMap Objects\nvar $WeakMap = module.exports = __webpack_require__(93)(WEAK_MAP, wrapper, methods, weak, true, true);\n\n// IE11 WeakMap frozen keys fix\nif (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) {\n InternalMap = weak.getConstructor(wrapper, WEAK_MAP);\n assign(InternalMap.prototype, methods);\n meta.NEED = true;\n each(['delete', 'has', 'get', 'set'], function (key) {\n var proto = $WeakMap.prototype;\n var method = proto[key];\n redefine(proto, key, function (a, b) {\n // store frozen objects on internal weakmap shim\n if (isObject(a) && !isExtensible(a)) {\n if (!this._f) this._f = new InternalMap();\n var result = this._f[key](a, b);\n return key == 'set' ? this : result;\n // store all the rest on native weakmap\n } return method.call(this, a, b);\n });\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYud2Vhay1tYXAuanM/NjQzNSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgZWFjaCA9IHJlcXVpcmUoJy4vX2FycmF5LW1ldGhvZHMnKSgwKTtcbnZhciByZWRlZmluZSA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lJyk7XG52YXIgbWV0YSA9IHJlcXVpcmUoJy4vX21ldGEnKTtcbnZhciBhc3NpZ24gPSByZXF1aXJlKCcuL19vYmplY3QtYXNzaWduJyk7XG52YXIgd2VhayA9IHJlcXVpcmUoJy4vX2NvbGxlY3Rpb24td2VhaycpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIHZhbGlkYXRlID0gcmVxdWlyZSgnLi9fdmFsaWRhdGUtY29sbGVjdGlvbicpO1xudmFyIFdFQUtfTUFQID0gJ1dlYWtNYXAnO1xudmFyIGdldFdlYWsgPSBtZXRhLmdldFdlYWs7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5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYud2Vhay1tYXAuanNcbi8vIG1vZHVsZSBpZCA9IDE3OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///179\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar redefineAll = __webpack_require__(61);\nvar getWeak = __webpack_require__(47).getWeak;\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar anInstance = __webpack_require__(59);\nvar forOf = __webpack_require__(60);\nvar createArrayMethod = __webpack_require__(40);\nvar $has = __webpack_require__(27);\nvar validate = __webpack_require__(67);\nvar arrayFind = createArrayMethod(5);\nvar arrayFindIndex = createArrayMethod(6);\nvar id = 0;\n\n// fallback for uncaught frozen keys\nvar uncaughtFrozenStore = function (that) {\n return that._l || (that._l = new UncaughtFrozenStore());\n};\nvar UncaughtFrozenStore = function () {\n this.a = [];\n};\nvar findUncaughtFrozen = function (store, key) {\n return arrayFind(store.a, function (it) {\n return it[0] === key;\n });\n};\nUncaughtFrozenStore.prototype = {\n get: function (key) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) return entry[1];\n },\n has: function (key) {\n return !!findUncaughtFrozen(this, key);\n },\n set: function (key, value) {\n var entry = findUncaughtFrozen(this, key);\n if (entry) entry[1] = value;\n else this.a.push([key, value]);\n },\n 'delete': function (key) {\n var index = arrayFindIndex(this.a, function (it) {\n return it[0] === key;\n });\n if (~index) this.a.splice(index, 1);\n return !!~index;\n }\n};\n\nmodule.exports = {\n getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {\n var C = wrapper(function (that, iterable) {\n anInstance(that, C, NAME, '_i');\n that._t = NAME; // collection type\n that._i = id++; // collection id\n that._l = undefined; // leak store for uncaught frozen objects\n if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);\n });\n redefineAll(C.prototype, {\n // 23.3.3.2 WeakMap.prototype.delete(key)\n // 23.4.3.3 WeakSet.prototype.delete(value)\n 'delete': function (key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);\n return data && $has(data, this._i) && delete data[this._i];\n },\n // 23.3.3.4 WeakMap.prototype.has(key)\n // 23.4.3.4 WeakSet.prototype.has(value)\n has: function has(key) {\n if (!isObject(key)) return false;\n var data = getWeak(key);\n if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);\n return data && $has(data, this._i);\n }\n });\n return C;\n },\n def: function (that, key, value) {\n var data = getWeak(anObject(key), true);\n if (data === true) uncaughtFrozenStore(that).set(key, value);\n else data[that._i] = value;\n return that;\n },\n ufstore: uncaughtFrozenStore\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjd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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///180\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/ecma262/#sec-toindex\nvar toInteger = __webpack_require__(38);\nvar toLength = __webpack_require__(14);\nmodule.exports = function (it) {\n if (it === undefined) return 0;\n var number = toInteger(it);\n var length = toLength(number);\n if (number !== length) throw RangeError('Wrong length!');\n return length;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fdG8taW5kZXguanM/ZjAzZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL2VjbWEyNjIvI3NlYy10b2luZGV4XG52YXIgdG9JbnRlZ2VyID0gcmVxdWlyZSgnLi9fdG8taW50ZWdlcicpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICBpZiAoaXQgPT09IHVuZGVmaW5lZCkgcmV0dXJuIDA7XG4gIHZhciBudW1iZXIgPSB0b0ludGVnZXIoaXQpO1xuICB2YXIgbGVuZ3RoID0gdG9MZW5ndGgobnVtYmVyKTtcbiAgaWYgKG51bWJlciAhPT0gbGVuZ3RoKSB0aHJvdyBSYW5nZUVycm9yKCdXcm9uZyBsZW5ndGghJyk7XG4gIHJldHVybiBsZW5ndGg7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL190by1pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gMTgxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///181\n")},function(module,exports,__webpack_require__){eval("// all object keys, includes non-enumerable and symbols\nvar gOPN = __webpack_require__(57);\nvar gOPS = __webpack_require__(85);\nvar anObject = __webpack_require__(5);\nvar Reflect = __webpack_require__(7).Reflect;\nmodule.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {\n var keys = gOPN.f(anObject(it));\n var getSymbols = gOPS.f;\n return getSymbols ? keys.concat(getSymbols(it)) : keys;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb3duLWtleXMuanM/NjE0YSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBhbGwgb2JqZWN0IGtleXMsIGluY2x1ZGVzIG5vbi1lbnVtZXJhYmxlIGFuZCBzeW1ib2xzXG52YXIgZ09QTiA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BuJyk7XG52YXIgZ09QUyA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BzJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBSZWZsZWN0ID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuUmVmbGVjdDtcbm1vZHVsZS5leHBvcnRzID0gUmVmbGVjdCAmJiBSZWZsZWN0Lm93bktleXMgfHwgZnVuY3Rpb24gb3duS2V5cyhpdCkge1xuICB2YXIga2V5cyA9IGdPUE4uZihhbk9iamVjdChpdCkpO1xuICB2YXIgZ2V0U3ltYm9scyA9IGdPUFMuZjtcbiAgcmV0dXJuIGdldFN5bWJvbHMgPyBrZXlzLmNvbmNhdChnZXRTeW1ib2xzKGl0KSkgOiBrZXlzO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb3duLWtleXMuanNcbi8vIG1vZHVsZSBpZCA9IDE4MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///182\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray\nvar isArray = __webpack_require__(86);\nvar isObject = __webpack_require__(9);\nvar toLength = __webpack_require__(14);\nvar ctx = __webpack_require__(33);\nvar IS_CONCAT_SPREADABLE = __webpack_require__(10)('isConcatSpreadable');\n\nfunction flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {\n var targetIndex = start;\n var sourceIndex = 0;\n var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;\n var element, spreadable;\n\n while (sourceIndex < sourceLen) {\n if (sourceIndex in source) {\n element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];\n\n spreadable = false;\n if (isObject(element)) {\n spreadable = element[IS_CONCAT_SPREADABLE];\n spreadable = spreadable !== undefined ? !!spreadable : isArray(element);\n }\n\n if (spreadable && depth > 0) {\n targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;\n } else {\n if (targetIndex >= 0x1fffffffffffff) throw TypeError();\n target[targetIndex] = element;\n }\n\n targetIndex++;\n }\n sourceIndex++;\n }\n return targetIndex;\n}\n\nmodule.exports = flattenIntoArray;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZmxhdHRlbi1pbnRvLWFycmF5LmpzPzIwNWEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1mbGF0TWFwLyNzZWMtRmxhdHRlbkludG9BcnJheVxudmFyIGlzQXJyYXkgPSByZXF1aXJlKCcuL19pcy1hcnJheScpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciBJU19DT05DQVRfU1BSRUFEQUJMRSA9IHJlcXVpcmUoJy4vX3drcycpKCdpc0NvbmNhdFNwcmVhZGFibGUnKTtcblxuZnVuY3Rpb24gZmxhdHRlbkludG9BcnJheSh0YXJnZXQsIG9yaWdpbmFsLCBzb3VyY2UsIHNvdXJjZUxlbiwgc3RhcnQsIGRlcHRo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G4gICAgICB9XG5cbiAgICAgIHRhcmdldEluZGV4Kys7XG4gICAgfVxuICAgIHNvdXJjZUluZGV4Kys7XG4gIH1cbiAgcmV0dXJuIHRhcmdldEluZGV4O1xufVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZsYXR0ZW5JbnRvQXJyYXk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2ZsYXR0ZW4taW50by1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMTgzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///183\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-string-pad-start-end\nvar toLength = __webpack_require__(14);\nvar repeat = __webpack_require__(114);\nvar defined = __webpack_require__(37);\n\nmodule.exports = function (that, maxLength, fillString, left) {\n var S = String(defined(that));\n var stringLength = S.length;\n var fillStr = fillString === undefined ? ' ' : String(fillString);\n var intMaxLength = toLength(maxLength);\n if (intMaxLength <= stringLength || fillStr == '') return S;\n var fillLen = intMaxLength - stringLength;\n var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));\n if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);\n return left ? stringFiller + S : S + stringF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lbmd0aCA+IGZpbGxMZW4pIHN0cmluZ0ZpbGxlciA9IHN0cmluZ0ZpbGxlci5zbGljZSgwLCBmaWxsTGVuKTtcbiAgcmV0dXJuIGxlZnQgPyBzdHJpbmdGaWxsZXIgKyBTIDogUyArIHN0cmluZ0ZpbGxlcjtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX3N0cmluZy1wYWQuanNcbi8vIG1vZHVsZSBpZCA9IDE4NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///184\n")},function(module,exports,__webpack_require__){eval("var getKeys = __webpack_require__(54);\nvar toIObject = __webpack_require__(28);\nvar isEnum = __webpack_require__(74).f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LXRvLWFycmF5LmpzPzk0YTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBpc0VudW0gPSByZXF1aXJlKCcuL19vYmplY3QtcGllJykuZjtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGlzRW50cmllcykge1xuICByZXR1cm4gZnVuY3Rpb24gKGl0KSB7XG4gICAgdmFyIE8gPSB0b0lPYmplY3QoaXQpO1xuICAgIHZhciBrZXlzID0gZ2V0S2V5cyhPKTtcbiAgICB2YXIgbGVuZ3RoID0ga2V5cy5sZW5ndGg7XG4gICAgdmFyIGkgPSAwO1xuICAgIHZhciByZXN1bHQgPSBbXTtcbiAgICB2YXIga2V5O1xuICAgIHdoaWxlIChsZW5ndGggPiBpKSBpZiAoaXNFbnVtLmNhbGwoTywga2V5ID0ga2V5c1tpKytdKSkge1xuICAgICAgcmVzdWx0LnB1c2goaXNFbnRyaWVzID8gW2tleSwgT1trZXldXSA6IE9ba2V5XSk7XG4gICAgfSByZXR1cm4gcmVzdWx0O1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fb2JqZWN0LXRvLWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSAxODVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///185\n")},function(module,exports,__webpack_require__){eval('// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar classof = __webpack_require__(75);\nvar from = __webpack_require__(187);\nmodule.exports = function (NAME) {\n return function toJSON() {\n if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn\'t generic");\n return from(this);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi10by1qc29uLmpzPzVkNzAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL0RhdmlkQnJ1YW50L01hcC1TZXQucHJvdG90eXBlLnRvSlNPTlxudmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgZnJvbSA9IHJlcXVpcmUoJy4vX2FycmF5LWZyb20taXRlcmFibGUnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKE5BTUUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIHRvSlNPTigpIHtcbiAgICBpZiAoY2xhc3NvZih0aGlzKSAhPSBOQU1FKSB0aHJvdyBUeXBlRXJyb3IoTkFNRSArIFwiI3RvSlNPTiBpc24ndCBnZW5lcmljXCIpO1xuICAgIHJldHVybiBmcm9tKHRoaXMpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fY29sbGVjdGlvbi10by1qc29uLmpzXG4vLyBtb2R1bGUgaWQgPSAxODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///186\n')},function(module,exports,__webpack_require__){eval("var forOf = __webpack_require__(60);\n\nmodule.exports = function (iter, ITERATOR) {\n var result = [];\n forOf(iter, false, result.push, result, ITERATOR);\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktZnJvbS1pdGVyYWJsZS5qcz80MDZlIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBmb3JPZiA9IHJlcXVpcmUoJy4vX2Zvci1vZicpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdGVyLCBJVEVSQVRPUikge1xuICB2YXIgcmVzdWx0ID0gW107XG4gIGZvck9mKGl0ZXIsIGZhbHNlLCByZXN1bHQucHVzaCwgcmVzdWx0LCBJVEVSQVRPUik7XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1mcm9tLWl0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSAxODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///187\n")},function(module,exports){eval("// https://rwaldron.github.io/proposal-math-extensions/\nmodule.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {\n if (\n arguments.length === 0\n // eslint-disable-next-line no-self-compare\n || x != x\n // eslint-disable-next-line no-self-compare\n || inLow != inLow\n // eslint-disable-next-line no-self-compare\n || inHigh != inHigh\n // eslint-disable-next-line no-self-compare\n || outLow != outLow\n // eslint-disable-next-line no-self-compare\n || outHigh != outHigh\n ) return NaN;\n if (x === Infinity || x === -Infinity) return x;\n return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zY2FsZS5qcz81OThmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbm1vZHVsZS5leHBvcnRzID0gTWF0aC5zY2FsZSB8fCBmdW5jdGlvbiBzY2FsZSh4LCBpbkxvdywgaW5IaWdoLCBvdXRMb3csIG91dEhpZ2gpIHtcbiAgaWYgKFxuICAgIGFyZ3VtZW50cy5sZW5ndGggPT09IDBcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgIHx8IHggIT0geFxuICAgICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgICAgfHwgaW5Mb3cgIT0gaW5Mb3dcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgIHx8IGluSGlnaCAhPSBpbkhpZ2hcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgIHx8IG91dExvdyAhPSBvdXRMb3dcbiAgICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICAgIHx8IG91dEhpZ2ggIT0gb3V0SGlnaFxuICApIHJldHVybiBOYU47XG4gIGlmICh4ID09PSBJbmZpbml0eSB8fCB4ID09PSAtSW5maW5pdHkpIHJldHVybiB4O1xuICByZXR1cm4gKHggLSBpbkxvdykgKiAob3V0SGlnaCAtIG91dExvdykgLyAoaW5IaWdoIC0gaW5Mb3cpICsgb3V0TG93O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fbWF0aC1zY2FsZS5qc1xuLy8gbW9kdWxlIGlkID0gMTg4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///188\n")},function(module,exports,__webpack_require__){eval("var has = __webpack_require__(62);\nvar toIObject = __webpack_require__(50);\nvar arrayIndexOf = __webpack_require__(431)(false);\nvar IE_PROTO = __webpack_require__(135)('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while (names.length > i) if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3Qta2V5cy1pbnRlcm5hbC5qcz8yMWI4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgYXJyYXlJbmRleE9mID0gcmVxdWlyZSgnLi9fYXJyYXktaW5jbHVkZXMnKShmYWxzZSk7XG52YXIgSUVfUFJPVE8gPSByZXF1aXJlKCcuL19zaGFyZWQta2V5JykoJ0lFX1BST1RPJyk7XG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKG9iamVjdCwgbmFtZXMpIHtcbiAgdmFyIE8gPSB0b0lPYmplY3Qob2JqZWN0KTtcbiAgdmFyIGkgPSAwO1xuICB2YXIgcmVzdWx0ID0gW107XG4gIHZhciBrZXk7XG4gIGZvciAoa2V5IGluIE8pIGlmIChrZXkgIT0gSUVfUFJPVE8pIGhhcyhPLCBrZXkpICYmIHJlc3VsdC5wdXNoKGtleSk7XG4gIC8vIERvbid0IGVudW0gYnVnICYgaGlkZGVuIGtleXNcbiAgd2hpbGUgKG5hbWVzLmxlbmd0aCA+IGkpIGlmIChoYXMoTywga2V5ID0gbmFtZXNbaSsrXSkpIHtcbiAgICB+YXJyYXlJbmRleE9mKHJlc3VsdCwga2V5KSB8fCByZXN1bHQucHVzaChrZXkpO1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1rZXlzLWludGVybmFsLmpzXG4vLyBtb2R1bGUgaWQgPSAxODlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///189\n")},function(module,exports,__webpack_require__){eval("// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = __webpack_require__(77);\n// eslint-disable-next-line no-prototype-builtins\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pb2JqZWN0LmpzPzMxNGUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZmFsbGJhY2sgZm9yIG5vbi1hcnJheS1saWtlIEVTMyBhbmQgbm9uLWVudW1lcmFibGUgb2xkIFY4IHN0cmluZ3NcbnZhciBjb2YgPSByZXF1aXJlKCcuL19jb2YnKTtcbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1wcm90b3R5cGUtYnVpbHRpbnNcbm1vZHVsZS5leHBvcnRzID0gT2JqZWN0KCd6JykucHJvcGVydHlJc0VudW1lcmFibGUoMCkgPyBPYmplY3QgOiBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGNvZihpdCkgPT0gJ1N0cmluZycgPyBpdC5zcGxpdCgnJykgOiBPYmplY3QoaXQpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pb2JqZWN0LmpzXG4vLyBtb2R1bGUgaWQgPSAxOTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///190\n")},function(module,exports,__webpack_require__){eval("module.exports = !__webpack_require__(51) && !__webpack_require__(70)(function () {\n return Object.defineProperty(__webpack_require__(139)('div'), 'a', { get: function () { return 7; } }).a != 7;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pZTgtZG9tLWRlZmluZS5qcz80OWYwIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJykgJiYgIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gT2JqZWN0LmRlZmluZVByb3BlcnR5KHJlcXVpcmUoJy4vX2RvbS1jcmVhdGUnKSgnZGl2JyksICdhJywgeyBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIDc7IH0gfSkuYSAhPSA3O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faWU4LWRvbS1kZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDE5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///191\n")},function(module,exports){eval("//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkyLmpzIiwic291cmNlcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///192\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(78);\nvar $export = __webpack_require__(26);\nvar redefine = __webpack_require__(194);\nvar hide = __webpack_require__(63);\nvar Iterators = __webpack_require__(71);\nvar $iterCreate = __webpack_require__(435);\nvar setToStringTag = __webpack_require__(100);\nvar getPrototypeOf = __webpack_require__(196);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function () { return this; };\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n var getMethod = function (kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n switch (kind) {\n case KEYS: return function keys() { return new Constructor(this, kind); };\n case VALUES: return function values() { return new Constructor(this, kind); };\n } return function entries() { return new Constructor(this, kind); };\n };\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype;\n // Fix native\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true);\n // fix for some old engines\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n }\n // fix Array#{values, @@iterator}.name in V8 / FF\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n $default = function values() { return $native.call(this); };\n }\n // Define iterator\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n }\n // Plug for library\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n return methods;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWRlZmluZS5qcz9iYzgwIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBMSUJSQVJZID0gcmVxdWlyZSgnLi9fbGlicmFyeScpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciByZWRlZmluZSA9IHJlcXVpcmUoJy4vX3JlZGVmaW5lJyk7XG52YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbnZhciBJdGVyYXRvcnMgPSByZXF1aXJlKCcuL19pdGVyYXRvcnMnKTtcbnZhciAkaXRlckNyZWF0ZSA9IHJlcXVpcmUoJy4vX2l0ZXItY3JlYXRlJyk7XG52YXIgc2V0VG9TdHJpbmdUYWcgPSByZXF1aXJlKCcuL19zZXQtdG8tc3RyaW5nLXRhZycpO1xudmFyIGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdwbycpO1xudmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgQlVHR1kgPSAhKFtdLmtleXMgJiYgJ25leHQnIGluIFtdLmtleXMoKSk7IC8vIFNhZmFyaSBoYXMgYn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vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlci1kZWZpbmUuanNcbi8vIG1vZHVsZSBpZCA9IDE5M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///193\n")},function(module,exports,__webpack_require__){eval("module.exports = __webpack_require__(63);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19yZWRlZmluZS5qcz9mM2NkIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9faGlkZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3JlZGVmaW5lLmpzXG4vLyBtb2R1bGUgaWQgPSAxOTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///194\n")},function(module,exports,__webpack_require__){eval("var document = __webpack_require__(21).document;\nmodule.exports = document && document.documentElement;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19odG1sLmpzPzQ0ZjIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRvY3VtZW50ID0gcmVxdWlyZSgnLi9fZ2xvYmFsJykuZG9jdW1lbnQ7XG5tb2R1bGUuZXhwb3J0cyA9IGRvY3VtZW50ICYmIGRvY3VtZW50LmRvY3VtZW50RWxlbWVudDtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19odG1sLmpzXG4vLyBtb2R1bGUgaWQgPSAxOTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///195\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = __webpack_require__(62);\nvar toObject = __webpack_require__(76);\nvar IE_PROTO = __webpack_require__(135)('IE_PROTO');\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n } return O instanceof Object ? ObjectProto : null;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ3BvLmpzPzNmM2MiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjkgLyAxNS4yLjMuMiBPYmplY3QuZ2V0UHJvdG90eXBlT2YoTylcbnZhciBoYXMgPSByZXF1aXJlKCcuL19oYXMnKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElFX1BST1RPID0gcmVxdWlyZSgnLi9fc2hhcmVkLWtleScpKCdJRV9QUk9UTycpO1xudmFyIE9iamVjdFByb3RvID0gT2JqZWN0LnByb3RvdHlwZTtcblxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuZ2V0UHJvdG90eXBlT2YgfHwgZnVuY3Rpb24gKE8pIHtcbiAgTyA9IHRvT2JqZWN0KE8pO1xuICBpZiAoaGFzKE8sIElFX1BST1RPKSkgcmV0dXJuIE9bSUVfUFJPVE9dO1xuICBpZiAodHlwZW9mIE8uY29uc3RydWN0b3IgPT0gJ2Z1bmN0aW9uJyAmJiBPIGluc3RhbmNlb2YgTy5jb25zdHJ1Y3Rvcikge1xuICAgIHJldHVybiBPLmNvbnN0cnVjdG9yLnByb3RvdHlwZTtcbiAgfSByZXR1cm4gTyBpbnN0YW5jZW9mIE9iamVjdCA/IE9iamVjdFByb3RvIDogbnVsbDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdwby5qc1xuLy8gbW9kdWxlIGlkID0gMTk2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///196\n")},function(module,exports,__webpack_require__){eval("// call something on iterator step with safe closing on error\nvar anObject = __webpack_require__(41);\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value);\n // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWNhbGwuanM/OWFjNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBjYWxsIHNvbWV0aGluZyBvbiBpdGVyYXRvciBzdGVwIHdpdGggc2FmZSBjbG9zaW5nIG9uIGVycm9yXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0ZXJhdG9yLCBmbiwgdmFsdWUsIGVudHJpZXMpIHtcbiAgdHJ5IHtcbiAgICByZXR1cm4gZW50cmllcyA/IGZuKGFuT2JqZWN0KHZhbHVlKVswXSwgdmFsdWVbMV0pIDogZm4odmFsdWUpO1xuICAvLyA3LjQuNiBJdGVyYXRvckNsb3NlKGl0ZXJhdG9yLCBjb21wbGV0aW9uKVxuICB9IGNhdGNoIChlKSB7XG4gICAgdmFyIHJldCA9IGl0ZXJhdG9yWydyZXR1cm4nXTtcbiAgICBpZiAocmV0ICE9PSB1bmRlZmluZWQpIGFuT2JqZWN0KHJldC5jYWxsKGl0ZXJhdG9yKSk7XG4gICAgdGhyb3cgZTtcbiAgfVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWNhbGwuanNcbi8vIG1vZHVsZSBpZCA9IDE5N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///197\n")},function(module,exports,__webpack_require__){eval("// check on default Array iterator\nvar Iterators = __webpack_require__(71);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1hcnJheS1pdGVyLmpzPzMyMWMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gY2hlY2sgb24gZGVmYXVsdCBBcnJheSBpdGVyYXRvclxudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xudmFyIElURVJBVE9SID0gcmVxdWlyZSgnLi9fd2tzJykoJ2l0ZXJhdG9yJyk7XG52YXIgQXJyYXlQcm90byA9IEFycmF5LnByb3RvdHlwZTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXQpIHtcbiAgcmV0dXJuIGl0ICE9PSB1bmRlZmluZWQgJiYgKEl0ZXJhdG9ycy5BcnJheSA9PT0gaXQgfHwgQXJyYXlQcm90b1tJVEVSQVRPUl0gPT09IGl0KTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtYXJyYXktaXRlci5qc1xuLy8gbW9kdWxlIGlkID0gMTk4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///198\n")},function(module,exports,__webpack_require__){eval("// 7.3.20 SpeciesConstructor(O, defaultConstructor)\nvar anObject = __webpack_require__(41);\nvar aFunction = __webpack_require__(99);\nvar SPECIES = __webpack_require__(22)('species');\nmodule.exports = function (O, D) {\n var C = anObject(O).constructor;\n var S;\n return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zcGVjaWVzLWNvbnN0cnVjdG9yLmpzP2I3Y2MiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gNy4zLjIwIFNwZWNpZXNDb25zdHJ1Y3RvcihPLCBkZWZhdWx0Q29uc3RydWN0b3IpXG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgU1BFQ0lFUyA9IHJlcXVpcmUoJy4vX3drcycpKCdzcGVjaWVzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChPLCBEKSB7XG4gIHZhciBDID0gYW5PYmplY3QoTykuY29uc3RydWN0b3I7XG4gIHZhciBTO1xuICByZXR1cm4gQyA9PT0gdW5kZWZpbmVkIHx8IChTID0gYW5PYmplY3QoQylbU1BFQ0lFU10pID09IHVuZGVmaW5lZCA/IEQgOiBhRnVuY3Rpb24oUyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NwZWNpZXMtY29uc3RydWN0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDE5OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///199\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(69);\nvar invoke = __webpack_require__(443);\nvar html = __webpack_require__(195);\nvar cel = __webpack_require__(139);\nvar global = __webpack_require__(21);\nvar process = global.process;\nvar setTask = global.setImmediate;\nvar clearTask = global.clearImmediate;\nvar MessageChannel = global.MessageChannel;\nvar Dispatch = global.Dispatch;\nvar counter = 0;\nvar queue = {};\nvar ONREADYSTATECHANGE = 'onreadystatechange';\nvar defer, channel, port;\nvar run = function () {\n var id = +this;\n // eslint-disable-next-line no-prototype-builtins\n if (queue.hasOwnProperty(id)) {\n var fn = queue[id];\n delete queue[id];\n fn();\n }\n};\nvar listener = function (event) {\n run.call(event.data);\n};\n// Node.js 0.9+ & IE10+ has setImmediate, otherwise:\nif (!setTask || !clearTask) {\n setTask = function setImmediate(fn) {\n var args = [];\n var i = 1;\n while (arguments.length > i) args.push(arguments[i++]);\n queue[++counter] = function () {\n // eslint-disable-next-line no-new-func\n invoke(typeof fn == 'function' ? fn : Function(fn), args);\n };\n defer(counter);\n return counter;\n };\n clearTask = function clearImmediate(id) {\n delete queue[id];\n };\n // Node.js 0.8-\n if (__webpack_require__(77)(process) == 'process') {\n defer = function (id) {\n process.nextTick(ctx(run, id, 1));\n };\n // Sphere (JS game engine) Dispatch API\n } else if (Dispatch && Dispatch.now) {\n defer = function (id) {\n Dispatch.now(ctx(run, id, 1));\n };\n // Browsers with MessageChannel, includes WebWorkers\n } else if (MessageChannel) {\n channel = new MessageChannel();\n port = channel.port2;\n channel.port1.onmessage = listener;\n defer = ctx(port.postMessage, port, 1);\n // Browsers with postMessage, skip WebWorkers\n // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'\n } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {\n defer = function (id) {\n global.postMessage(id + '', '*');\n };\n global.addEventListener('message', listener, false);\n // IE8-\n } else if (ONREADYSTATECHANGE in cel('script')) {\n defer = function (id) {\n html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {\n html.removeChild(this);\n run.call(id);\n };\n };\n // Rest old browsers\n } else {\n defer = function (id) {\n setTimeout(ctx(run, id, 1), 0);\n };\n }\n}\nmodule.exports = {\n set: setTask,\n clear: clearTask\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190YXNrLmpzPzJmOGQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyIG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return { e: true, v: e };\n }\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19wZXJmb3JtLmpzPzc0ZDAiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoZXhlYykge1xuICB0cnkge1xuICAgIHJldHVybiB7IGU6IGZhbHNlLCB2OiBleGVjKCkgfTtcbiAgfSBjYXRjaCAoZSkge1xuICAgIHJldHVybiB7IGU6IHRydWUsIHY6IGUgfTtcbiAgfVxufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19wZXJmb3JtLmpzXG4vLyBtb2R1bGUgaWQgPSAyMDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///201\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(41);\nvar isObject = __webpack_require__(46);\nvar newPromiseCapability = __webpack_require__(144);\n\nmodule.exports = function (C, x) {\n anObject(C);\n if (isObject(x) && x.constructor === C) return x;\n var promiseCapability = newPromiseCapability.f(C);\n var resolve = promiseCapability.resolve;\n resolve(x);\n return promiseCapability.promise;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19wcm9taXNlLXJlc29sdmUuanM/N2M5NSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG5ld1Byb21pc2VDYXBhYmlsaXR5ID0gcmVxdWlyZSgnLi9fbmV3LXByb21pc2UtY2FwYWJpbGl0eScpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChDLCB4KSB7XG4gIGFuT2JqZWN0KEMpO1xuICBpZiAoaXNPYmplY3QoeCkgJiYgeC5jb25zdHJ1Y3RvciA9PT0gQykgcmV0dXJuIHg7XG4gIHZhciBwcm9taXNlQ2FwYWJpbGl0eSA9IG5ld1Byb21pc2VDYXBhYmlsaXR5LmYoQyk7XG4gIHZhciByZXNvbHZlID0gcHJvbWlzZUNhcGFiaWxpdHkucmVzb2x2ZTtcbiAgcmVzb2x2ZSh4KTtcbiAgcmV0dXJuIHByb21pc2VDYXBhYmlsaXR5LnByb21pc2U7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3Byb21pc2UtcmVzb2x2ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///202\n")},function(module,exports,__webpack_require__){eval("var ITERATOR = __webpack_require__(22)('iterator');\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n riter['return'] = function () { SAFE_CLOSING = true; };\n // eslint-disable-next-line no-throw-literal\n Array.from(riter, function () { throw 2; });\n} catch (e) { /* empty */ }\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n iter.next = function () { return { done: safe = true }; };\n arr[ITERATOR] = function () { return iter; };\n exec(arr);\n } catch (e) { /* empty */ }\n return safe;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWRldGVjdC5qcz83NThkIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIFNBRkVfQ0xPU0lORyA9IGZhbHNlO1xuXG50cnkge1xuICB2YXIgcml0ZXIgPSBbN11bSVRFUkFUT1JdKCk7XG4gIHJpdGVyWydyZXR1cm4nXSA9IGZ1bmN0aW9uICgpIHsgU0FGRV9DTE9TSU5HID0gdHJ1ZTsgfTtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXRocm93LWxpdGVyYWxcbiAgQXJyYXkuZnJvbShyaXRlciwgZnVuY3Rpb24gKCkgeyB0aHJvdyAyOyB9KTtcbn0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChleGVjLCBza2lwQ2xvc2luZykge1xuICBpZiAoIXNraXBDbG9zaW5nICYmICFTQUZFX0NMT1NJTkcpIHJldHVybiBmYWxzZTtcbiAgdmFyIHNhZmUgPSBmYWxzZTtcbiAgdHJ5IHtcbiAgICB2YXIgYXJyID0gWzddO1xuICAgIHZhciBpdGVyID0gYXJyW0lURVJBVE9SXSgpO1xuICAgIGl0ZXIubmV4dCA9IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHsgZG9uZTogc2FmZSA9IHRydWUgfTsgfTtcbiAgICBhcnJbSVRFUkFUT1JdID0gZnVuY3Rpb24gKCkgeyByZXR1cm4gaXRlcjsgfTtcbiAgICBleGVjKGFycik7XG4gIH0gY2F0Y2ggKGUpIHsgLyogZW1wdHkgKi8gfVxuICByZXR1cm4gc2FmZTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXRlci1kZXRlY3QuanNcbi8vIG1vZHVsZSBpZCA9IDIwM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///203\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(453), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzPzBiODMiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9kZWZpbmUtcHJvcGVydHlcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2RlZmluZS1wcm9wZXJ0eS5qc1xuLy8gbW9kdWxlIGlkID0gMjA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///204\n')},function(module,exports,__webpack_require__){eval("// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)\nvar $keys = __webpack_require__(189);\nvar hiddenKeys = __webpack_require__(137).concat('length', 'prototype');\n\nexports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {\n return $keys(O, hiddenKeys);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi5qcz85ZjQ0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi43IC8gMTUuMi4zLjQgT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMoTylcbnZhciAka2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzLWludGVybmFsJyk7XG52YXIgaGlkZGVuS2V5cyA9IHJlcXVpcmUoJy4vX2VudW0tYnVnLWtleXMnKS5jb25jYXQoJ2xlbmd0aCcsICdwcm90b3R5cGUnKTtcblxuZXhwb3J0cy5mID0gT2JqZWN0LmdldE93blByb3BlcnR5TmFtZXMgfHwgZnVuY3Rpb24gZ2V0T3duUHJvcGVydHlOYW1lcyhPKSB7XG4gIHJldHVybiAka2V5cyhPLCBoaWRkZW5LZXlzKTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWdvcG4uanNcbi8vIG1vZHVsZSBpZCA9IDIwNVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///205\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ProxyObject = __webpack_require__(207);\n\nvar _ProxyObject2 = _interopRequireDefault(_ProxyObject);\n\nvar _DataObjectChild = __webpack_require__(208);\n\nvar _DataObjectChild2 = _interopRequireDefault(_DataObjectChild);\n\nvar _HeartBeat = __webpack_require__(486);\n\nvar _HeartBeat2 = _interopRequireDefault(_HeartBeat);\n\nvar _utils = __webpack_require__(6);\n\nvar _HypertyResourceFactory = __webpack_require__(487);\n\nvar _HypertyResourceFactory2 = _interopRequireDefault(_HypertyResourceFactory);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObject'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n * Main extension class for observers and reporters, with common properties and methods.\n * Children management is common for observers and reporters.\n */\nvar DataObject = function () {\n /* private\n _version: number\n _owner: HypertyURL\n _url: ObjectURL\n _schema: Schema\n _bus: MiniBus\n _status: on | paused\n _syncObj: SyncData\n _children: { id: DataObjectChild }\n _childrenListener: [MsgListener]\n ----event handlers----\n _onAddChildHandler: (event) => void\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the Syncher create or subscribe method's\n */\n\n function DataObject(input) {\n (0, _classCallCheck3.default)(this, DataObject);\n\n var _this = this;\n\n function throwMandatoryParmMissingError(par) {\n throw '[DataObject] ' + par + ' mandatory parameter is missing';\n }\n\n input.syncher ? _this._syncher = input.syncher : throwMandatoryParmMissingError('syncher');\n input.url ? _this._url = input.url : throwMandatoryParmMissingError('url');\n input.created ? _this._created = input.created : throwMandatoryParmMissingError('created');\n input.reporter ? _this._reporter = input.reporter : throwMandatoryParmMissingError('reporter');\n input.runtime ? _this._runtime = input.runtime : throwMandatoryParmMissingError('runtime');\n input.schema ? _this._schema = input.schema : throwMandatoryParmMissingError('schema');\n input.name ? _this._name = input.name : throwMandatoryParmMissingError('name');\n\n _this._status = input.status;\n\n if (input.data) {\n _this._syncObj = new _ProxyObject2.default(input.data);\n } else {\n _this._syncObj = new _ProxyObject2.default({});\n }\n _this._childrens = input.childrens;\n\n //TODO: For Further Study\n _this._mutual = input.mutual;\n\n _this._version = 0;\n _this._childId = 1;\n _this._childrenListener; //bus listener for children\n _this._onAddChildrenHandler; //Hyperty side handlers to process child objects created by remote Hyperties\n\n _this._resumed = input.resume;\n\n if (input.resume) {\n _this._version = input.version;\n }\n\n _this._owner = input.syncher._owner;\n _this._bus = input.syncher._bus;\n\n if (input.description) _this._description = input.description;\n if (input.tags) _this._tags = input.tags;\n if (input.resources) _this._resources = input.resources;\n if (input.observerStorage) _this._observerStorage = input.observerStorage;\n if (input.publicObservation) _this._publicObservation = input.publicObservation;\n\n _this._metadata = (0, _assign2.default)(input);\n\n // console.log('[DataObject] mutual ', _this._metadata.mutual);\n\n if (!input.hasOwnProperty('resume') || input.hasOwnProperty('resume') && !input.resume) {\n _this._metadata.lastModified = _this._metadata.created;\n }\n\n delete _this._metadata.data;\n delete _this._metadata.syncher;\n delete _this._metadata.authorise;\n\n _this._hypertyResourceFactory = new _HypertyResourceFactory2.default();\n _this._childrenObjects = {};\n _this._sharedChilds = []; //childObjects that were not sent yet to Reporters\n\n if (input.backup && _this._childrens) {\n var lastHeartbeat = input.hasOwnProperty('childrenObjects') && input.childrenObjects.hasOwnProperty('heartbeat') ? input.childrenObjects.heartbeat : 0;\n _this._heartBeat = new _HeartBeat2.default(_this._bus, _this._owner, _this._syncher._runtimeUrl, this, 15, lastHeartbeat);\n if (_this._resumed) _this._heartBeat.start(true);else _this._heartBeat.start(false);\n }\n }\n\n (0, _createClass3.default)(DataObject, [{\n key: '_getLastChildId',\n value: function _getLastChildId() {\n var _this = this;\n\n var childIdInt = 0;\n var childIdString = _this._owner + '#' + childIdInt;\n\n (0, _keys2.default)(_this._childrens).filter(function (key) {\n if (_this._childrens[key].childId > childIdString) {\n childIdString = _this._childrens[key].childId;\n }\n });\n\n return childIdInt = Number(childIdString.split('#')[1]);\n }\n }, {\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this2 = this;\n\n var _this = this;\n\n var childBaseURL = _this._url + '/children/';\n log.log('[Data Object - AllocateListeners] - ', _this._childrens);\n if (_this._childrens) {\n // _this._childrens.forEach((child) => {\n var childURL = childBaseURL;\n var listener = _this._bus.addListener(childURL, function (msg) {\n //ignore msg sent by himself\n if (msg.from !== _this2._owner) {\n log.log('DataObject-Children-RCV: ', msg);\n switch (msg.type) {\n case 'create':\n _this._onChildCreate(msg);break;\n case 'delete':\n log.log(msg);break;\n default:\n _this._changeChildren(msg);break;\n }\n }\n // });\n\n _this._childrenListener = listener;\n });\n }\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n if (_this._childrenListener) {\n _this._childrenListener.remove();\n\n (0, _keys2.default)(_this._childrenObjects).forEach(function (child) {\n /* if (children === 'resources') {\n Object.keys(_this._childrenObjects[children]).forEach((child) => {\n _this._childrenObjects[children][child]._releaseListeners();\n });\n } else {*/\n _this._childrenObjects[child]._releaseListeners();\n // }\n });\n }\n }\n\n /**\n * Sync Data Object Observer with last version of Data Object Reporter. Useful for Resumes\n */\n\n }, {\n key: 'sync',\n value: function sync() {\n var _this3 = this;\n\n var _this = this;\n log.info('[DataObject.sync] synchronising ');\n\n return new _promise2.default(function (resolve, reject) {\n\n var criteria = {};\n\n if (_this3.metadata.backupRevision) criteria.backupRevision = _this3.metadata.backupRevision;\n\n _this._syncher.read(_this._metadata.url, criteria).then(function (value) {\n log.info('[DataObject.sync] value to sync: ', value);\n\n (0, _assign2.default)(_this.data, (0, _utils.deepClone)(value.data));\n\n _this._version = value.version;\n\n _this._metadata.lastModified = value.lastModified;\n\n //TODO: check first if there are new childrenObjects to avoid overhead\n\n if (value.childrenObjects) {\n _this.resumeChildrens(value.childrenObjects);\n _this._storeChildrens();\n resolve(true);\n } else resolve(true);\n\n /*if (value.version != _this._version) {\n log.info('[DataObject.sync] updating existing data: ', _this.data);\n Object.assign(_this.data || {}, deepClone(value.data));\n _this._metadata = deepClone(value);\n delete _this._metadata.data;\n _this._version = value.version;\n } else {\n log.info('[DataObject.sync] existing data is updated: ', value);\n }*/\n }).catch(function (reason) {\n log.info('[DataObject.sync] sync failed: ', reason);\n resolve(false);\n });\n });\n }\n /**\n *\n */\n\n }, {\n key: 'resumeChildrens',\n value: function resumeChildrens(childrens) {\n var _this4 = this;\n\n var _this = this;\n\n var childIdString = this._owner.split('/')[3] + '#' + this._childId;\n\n //setup childrens data from subscription\n // Object.keys(childrens).forEach((childrenResource) => {\n // let children = childrens[childrenResource];\n var children = childrens;\n\n //_this._childrenObjects[childrenResource] = {};\n (0, _keys2.default)(children).forEach(function (childId) {\n var newChild = false;\n\n /* if (!_this._childrenObjects.hasOwnProperty(childrenResource))\n _this._childrenObjects[childrenResource] = {};*/\n\n // check if it is the last heartbeat\n\n if (childId === 'heartbeat') {\n // _this._heartBeat.onNewHeartbeat(children[childId].value);\n // _this._heartBeat.start(true);\n } else if (children[childId].hasOwnProperty('value') && children[childId].value.resourceType && !_this._childrenObjects.hasOwnProperty(childId)) {\n _this._childrenObjects[childId] = _this._resumeHypertyResource(children[childId]);\n newChild = true;\n } else if (!_this._childrenObjects.hasOwnProperty(childId)) {\n\n _this._childrenObjects[childId] = _this._resumeChild(children[childId]);\n log.log('[DataObject.resumeChildrens] new DataObjectChild: ', _this._childrenObjects[childId]);\n newChild = true;\n }\n\n if (newChild && childId > childIdString) {\n childIdString = childId;\n log.log('[DataObjectReporter.resumeChildrens] - resuming: ', _this4._childrenObjects[childId]);\n }\n });\n // });\n\n this._childId = Number(childIdString.split('#')[1]);\n }\n }, {\n key: '_resumeChild',\n value: function _resumeChild(input) {\n var _this = this;\n var childInput = input.value;\n childInput.parentObject = _this;\n childInput.parent = _this._url;\n\n var child = new _DataObjectChild2.default(childInput);\n\n child.identity = input.identity;\n\n var event = {\n type: 'create',\n from: child.reporter,\n url: child.parent,\n value: child.data,\n childId: child.url,\n identity: child.identity,\n child: child\n };\n\n if (child.resourceType) {\n event.resource = child;\n }\n\n if (_this._onAddChildrenHandler) _this._onAddChildrenHandler(event);\n\n return child;\n }\n }, {\n key: '_resumeHypertyResource',\n value: function _resumeHypertyResource(input) {\n var _this = this;\n var childInput = input.value;\n childInput.parentObject = _this;\n childInput.parent = _this._url;\n\n var hypertyResource = _this._hypertyResourceFactory.createHypertyResource(false, childInput.resourceType, childInput);\n\n hypertyResource.identity = input.identity;\n\n var event = {\n type: 'create',\n from: hypertyResource.reporter,\n url: hypertyResource.parent,\n value: hypertyResource.data,\n childId: hypertyResource.url,\n identity: hypertyResource.identity,\n child: hypertyResource\n };\n\n if (hypertyResource.resourceType) {\n event.resource = hypertyResource;\n }\n\n if (_this._onAddChildrenHandler) _this._onAddChildrenHandler(event);\n\n return hypertyResource;\n }\n\n /**\n * All Metadata about the Data Object\n * @type {Object} -\n */\n\n }, {\n key: 'pause',\n\n\n /**\n * @ignore\n */\n value: function pause() {\n //TODO: this feature needs more analise\n throw 'Not implemented';\n }\n\n /**\n * @ignore\n */\n\n }, {\n key: 'resume',\n value: function resume() {\n //TODO: this feature needs more analise\n throw 'Not implemented';\n }\n\n /**\n * @ignore\n */\n\n }, {\n key: 'stop',\n value: function stop() {\n //TODO: should remove the subscription and send message unsubscribe?\n throw 'Not implemented';\n }\n\n /**\n * Create and add a DataObjectChild to a children collection.\n * @param {JSON} initialData - Initial data of the child\n * @param {MessageBodyIdentity} identity - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @param {SyncChildMetadata} input - (optional) All additional metadata about the DataObjectChild.\n * @return {Promise} - Return Promise to a new DataObjectChild.\n */\n\n }, {\n key: 'addChild',\n value: function addChild(initialData, identity, input) {\n var _this = this;\n var newChild = void 0;\n\n //returns promise, in the future, the API may change to asynchronous call\n return new _promise2.default(function (resolve) {\n\n var msgChildPath = _this._url + '/children/';\n\n var childInput = _this._getChildInput(input);\n childInput.data = initialData;\n // childInput.children = children;\n newChild = new _DataObjectChild2.default(childInput);\n\n if (identity) newChild.identity = identity;\n\n newChild.share();\n\n console.log('[DataObject.addChild] added ', newChild);\n\n newChild.onChange(function (event) {\n _this._onChange(event, { path: msgChildPath, childId: childInput.url });\n });\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[childInput.url] = newChild;\n\n resolve(newChild);\n });\n }\n }, {\n key: '_deleteChildrens',\n value: function _deleteChildrens() {\n\n var _this = this;\n var deletePromises = [];\n\n return new _promise2.default(function (resolve) {\n if (_this.childrens) {\n log.log('[DataObject.deleteChildrens]', _this.childrens);\n var child = void 0;\n\n for (child in _this.childrens) {\n // let child;\n\n /* if (children === 'resources') {\n for (child in _this.childrens[children]) {\n let childObj = _this.childrens[children][child];\n log.log('[DataObject._deleteChildrens] child',childObj);\n if (childObj.metadata.hasOwnProperty('resourceType'))\n deletePromises.push(_this.childrens[children][child].delete());\n }\n } else {*/\n var childObj = _this.childrens[child];\n log.log('[DataObject._deleteChildrens] child', childObj);\n if (childObj.metadata.hasOwnProperty('resourceType')) deletePromises.push(_this.childrens[child].delete());\n }\n // }\n\n log.log('[DataObject._deleteChildrens] promises ', deletePromises);\n\n if (deletePromises.length > 0) {\n _promise2.default.all(deletePromises).then(function () {\n resolve('[DataObject._deleteChildrens] done');\n });\n } else resolve('[DataObject._deleteChildrens] nothing to delete');\n }\n });\n }\n }, {\n key: '_getChildInput',\n value: function _getChildInput(input) {\n var _this = this;\n var childInput = (0, _assign2.default)({}, input);\n\n _this._childId++;\n\n //removing domain from childId to avoid backup issues with '.'\n\n childInput.url = _this._owner.split('/')[3] + '#' + _this._childId;\n\n childInput.parentObject = _this;\n childInput.reporter = _this._owner;\n childInput.created = new Date().toISOString();\n childInput.runtime = _this._syncher._runtimeUrl;\n childInput.p2pHandler = _this._syncher._p2pHandler;\n childInput.p2pRequester = _this._syncher._p2pRequester;\n childInput.schema = _this._schema;\n childInput.parent = _this.url;\n childInput.mutual = _this.metadata.mutual;\n // console.log('[DataObject._getChildInput] mutual ', childInput.mutual);\n\n return childInput;\n }\n }, {\n key: 'addHypertyResource',\n value: function addHypertyResource(type, resource, identity, input) {\n var _this = this;\n\n //returns promise, in the future, the API may change to asynchronous call\n return new _promise2.default(function (resolve) {\n\n var hypertyResource = void 0;\n var msgChildPath = _this._url + '/children/';\n\n var childInput = _this._getChildInput(input);\n // childInput.children = children;\n\n _this._hypertyResourceFactory.createHypertyResourceWithContent(true, type, resource, childInput).then(function (resource) {\n hypertyResource = resource;\n\n if (identity) hypertyResource.identity = identity;\n\n hypertyResource.share();\n\n log.log('[DataObject.addHypertyResource] added ', hypertyResource);\n\n hypertyResource.onChange(function (event) {\n _this._onChange(event, { path: msgChildPath, childId: hypertyResource.childId });\n });\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[hypertyResource.childId] = hypertyResource;\n\n resolve(hypertyResource);\n });\n });\n }\n\n /**\n * Setup the callback to process create and delete of childrens.\n * @param {function(event: MsgEvent)} callback\n * TODO: add childrenId to support different handlers per children\n */\n\n }, {\n key: 'onAddChild',\n value: function onAddChild(callback) {\n\n this._onAddChildrenHandler = callback;\n }\n\n //FLOW-IN: message received from a remote DataObject -> addChild\n\n }, {\n key: '_onChildCreate',\n value: function _onChildCreate(msg) {\n var _this = this;\n\n // console.log('[DataObject._onChildCreate] receivedBy ' + _this._owner + ' : ', msg);\n\n // if this is an heartbeat msg foward it to heatbeat handler\n\n if (msg.body.resource === 'heartbeat') {\n console.log('[DataObject._onChildCreate] new heartbeat received ' + msg.body.value);\n this._heartBeat.onNewHeartbeat(msg.body.value);\n } else {\n console.log('[DataObject._onChildCreate] new child receivedBy ' + _this._owner + ' : ', msg);\n var response = {\n from: msg.to,\n to: msg.from,\n type: 'response',\n id: msg.id,\n body: {\n code: 100\n }\n };\n\n _this._bus.postMessage(response);\n\n if (msg.body.value.resourceType) {\n _this._onHypertyResourceAdded(msg);\n } else _this._onChildAdded(msg);\n }\n }\n }, {\n key: '_onChildAdded',\n value: function _onChildAdded(msg) {\n var _this = this;\n var childInput = (0, _utils.deepClone)(msg.body.value);\n childInput.parentObject = _this;\n\n // let children = childInput.children;\n\n var newChild = new _DataObjectChild2.default(childInput);\n newChild.identity = msg.body.identity;\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[childInput.url] = newChild;\n\n if (msg.to === _this.metadata.url) newChild.store();\n\n _this._hypertyEvt(msg, newChild);\n }\n }, {\n key: '_onHypertyResourceAdded',\n value: function _onHypertyResourceAdded(msg) {\n var _this = this;\n var input = msg.body.value;\n var hypertyResource = void 0;\n\n // let children = input.children;\n\n input.parentObject = _this;\n\n hypertyResource = _this._hypertyResourceFactory.createHypertyResource(false, input.resourceType, input);\n hypertyResource.identity = msg.body.identity;\n\n // if (!_this._childrenObjects.hasOwnProperty(children)) _this._childrenObjects[children] = {};\n\n _this._childrenObjects[hypertyResource.childId] = hypertyResource;\n\n _this._hypertyEvt(msg, hypertyResource);\n\n // locally store messages that are directly sent to the hyperty\n // ie to sync with messages sent when offline\n\n if (msg.to === _this.metadata.url) hypertyResource.store();\n }\n }, {\n key: '_hypertyEvt',\n value: function _hypertyEvt(msg, child) {\n var _this = this;\n\n var event = {\n type: msg.type,\n from: msg.from,\n url: msg.to,\n value: child.data,\n childId: child.url,\n identity: msg.body.identity,\n child: child\n };\n\n if (child.resourceType) {\n event.resource = child;\n }\n\n if (_this._onAddChildrenHandler) _this._onAddChildrenHandler(event);\n }\n\n //send delta messages to subscriptions\n\n }, {\n key: '_onChange',\n value: function _onChange(event, childInfo) {\n var _this = this;\n\n _this._metadata.lastModified = new Date().toISOString();\n\n _this._version++;\n\n if (_this._status === 'live') {\n //FLOW-OUT: this message will be sent directly to a resource changes address: MessageBus\n var changeMsg = {\n type: 'update', from: _this._url, to: _this._url + '/changes',\n body: { version: _this._version, source: _this._owner, attribute: event.field, lastModified: _this._metadata.lastModified }\n };\n\n log.log('[DataObject - _onChange] - ', event, childInfo, changeMsg);\n\n if (event.oType === _ProxyObject.ObjectType.OBJECT) {\n if (event.cType !== _ProxyObject.ChangeType.REMOVE) {\n changeMsg.body.value = (0, _utils.deepClone)(event.data);\n }\n } else {\n changeMsg.body.attributeType = event.oType;\n changeMsg.body.value = event.data;\n if (event.cType !== _ProxyObject.ChangeType.UPDATE) {\n changeMsg.body.operation = event.cType;\n }\n }\n\n //childInfo must have (path, childId)\n if (childInfo) {\n changeMsg.to = childInfo.path;\n changeMsg.body.resource = childInfo.childId;\n }\n\n //TODO: For Further Study\n if (!_this.data._mutual) changeMsg.body.mutual = _this._mutual;\n\n _this._bus.postMessage(changeMsg);\n }\n }\n\n //FLOW-IN: delta message received from a remote DataObjectReporter or DataObjectChild when changing data\n\n }, {\n key: '_changeObject',\n value: function _changeObject(syncObj, msg) {\n var _this = this;\n\n //TODO: update version ?\n //how to handle an incorrect version ? Example: receive a version 3 when the observer is in version 1, where is the version 2 ?\n //will we need to confirm the reception ?\n if (_this._version + 1 <= msg.body.version) {\n _this._version = msg.body.version;\n var path = msg.body.attribute;\n var value = void 0;\n if ((0, _typeof3.default)(msg.body.value) === 'object') value = (0, _utils.deepClone)(msg.body.value);else value = msg.body.value;\n\n var findResult = syncObj.findBefore(path);\n\n if (msg.body.lastModified) {\n _this._metadata.lastModified = msg.body.lastModified;\n } else {\n _this._metadata.lastModified = new Date().toISOString();\n }\n\n if (msg.body.attributeType === _ProxyObject.ObjectType.ARRAY) {\n if (msg.body.operation === _ProxyObject.ChangeType.ADD) {\n var arr = findResult.obj;\n var index = findResult.last;\n Array.prototype.splice.apply(arr, [index, 0].concat(value));\n } else if (msg.body.operation === _ProxyObject.ChangeType.REMOVE) {\n var _arr = findResult.obj;\n var _index = findResult.last;\n _arr.splice(_index, value);\n } else {\n findResult.obj[findResult.last] = value; // UPDATE\n }\n } else {\n if (msg.body.hasOwnProperty('value')) {\n findResult.obj[findResult.last] = value; // UPDATE or ADD\n } else {\n delete findResult.obj[findResult.last]; // REMOVE\n }\n }\n } else {\n //TODO: how to handle unsynchronized versions?\n log.log('UNSYNCHRONIZED VERSION: (data => ' + _this._version + ', msg => ' + msg.body.version + ')');\n }\n }\n\n //FLOW-IN: message received from a remote DataObjectChild when changing data\n\n }, {\n key: '_changeChildren',\n value: function _changeChildren(msg) {\n var _this = this;\n var dividedURL = (0, _utils.divideURL)(msg.to);\n var identity = dividedURL.identity;\n // const resource = identity ? identity.substring(identity.lastIndexOf('/') + 1) : undefined;\n\n var childId = msg.body.resource;\n var children = _this._childrenObjects[childId];\n\n log.log('Change children: ', _this._owner, msg, resource);\n\n if (children) {\n _this._changeObject(children._syncObj, msg);\n } else {\n log.warn('No children found for: ', childId);\n }\n }\n }, {\n key: 'metadata',\n get: function get() {\n return this._metadata;\n }\n\n /**\n * Object URL of reporter or observer\n * @type {ObjectURL}\n */\n\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n\n /**\n * Object schema URL (this field is not yet stable, and is subsject to change)\n * @type {SchemaURL}\n */\n\n }, {\n key: 'schema',\n get: function get() {\n return this._schema;\n }\n\n /**\n * Status of the reporter or observer connection (this field is not yet stable, and is subsject to change)\n * @type {Status} - Enum of: on | paused\n */\n\n }, {\n key: 'status',\n get: function get() {\n return this._status;\n }\n\n /**\n * Data structure to be synchronized.\n * @type {JSON} - JSON structure that should follow the defined schema, if any.\n */\n\n }, {\n key: 'data',\n get: function get() {\n return this._syncObj.data;\n }\n\n /**\n * All created children's since the subscription, doesn't contain all children's since reporter creation.\n * @type {Object}\n */\n\n }, {\n key: 'childrens',\n get: function get() {\n return this._childrenObjects;\n }\n }]);\n return DataObject;\n}();\n\nexports.default = DataObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFPYmplY3QuanM/ZDAxOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlIFwiTGljZW5zZVwiKTtcbiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbipcbiogICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjBcbipcbiogVW5s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FDQTtBQUNBOzs7Ozs7O0FBSUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQUE7QUFBQTs7Ozs7QUFtWUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///206\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ObjectType = exports.ChangeType = undefined;\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\n__webpack_require__(149);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar objectType = { ARRAY: '[object Array]', OBJECT: '[object Object]' };\n\n/**\n * @access private\n * Main class that maintains a JSON object, and observes changes in this object, recursively.\n * Internal objects and arrays are also observed.\n */\n\nvar SyncObject = function () {\n function SyncObject(initialData) {\n (0, _classCallCheck3.default)(this, SyncObject);\n\n var _this = this;\n\n _this._observers = [];\n _this._filters = {};\n\n this._data = initialData || {};\n\n this._internalObserve(this._data);\n }\n\n (0, _createClass3.default)(SyncObject, [{\n key: 'observe',\n value: function observe(callback) {\n this._observers.push(callback);\n }\n }, {\n key: 'find',\n value: function find(path) {\n var list = (0, _utils.parseAttributes)(path);\n\n return this._findWithSplit(list);\n }\n }, {\n key: 'findBefore',\n value: function findBefore(path) {\n var result = {};\n var list = (0, _utils.parseAttributes)(path);\n result.last = list.pop();\n result.obj = this._findWithSplit(list);\n\n return result;\n }\n }, {\n key: '_findWithSplit',\n value: function _findWithSplit(list) {\n var obj = this._data;\n list.forEach(function (value) {\n obj = obj[value];\n });\n\n return obj;\n }\n }, {\n key: '_internalObserve',\n value: function _internalObserve(object) {\n var _this2 = this;\n\n var handler = function handler(changeset) {\n\n changeset.every(function (change) {\n _this2._onChanges(change);\n });\n };\n\n this._data = Object.deepObserve(object, handler);\n }\n }, {\n key: '_fireEvent',\n value: function _fireEvent(event) {\n this._observers.forEach(function (callback) {\n callback(event);\n });\n }\n }, {\n key: '_onChanges',\n value: function _onChanges(change) {\n\n var obj = change.object;\n var objType = void 0;\n\n if (obj.constructor === Object) {\n objType = ObjectType.OBJECT;\n }\n\n if (obj.constructor === Array) {\n objType = ObjectType.ARRAY;\n }\n\n var fieldString = change.keypath;\n\n // console.log('Field:', fieldString);\n // console.log('type:', change.type);\n\n //let oldValue = change.oldValue;\n var newValue = obj[change.name];\n\n // console.info(change.type + ' | Field: ' + fieldString + ' | New Value:', JSON.stringify(newValue), fieldString.includes('length'));\n\n if (change.type === 'update' && !fieldString.includes('.length')) {\n this._fireEvent({\n cType: ChangeType.UPDATE,\n oType: objType,\n field: fieldString,\n data: newValue\n });\n }\n\n if (change.type === 'add') {\n this._fireEvent({\n cType: ChangeType.ADD,\n oType: objType,\n field: fieldString,\n data: newValue\n });\n }\n\n if (change.type === 'delete') {\n this._fireEvent({\n cType: ChangeType.REMOVE,\n oType: objType,\n field: fieldString\n });\n }\n }\n }, {\n key: 'data',\n get: function get() {\n return this._data;\n }\n }]);\n return SyncObject;\n}();\n\nvar ChangeType = exports.ChangeType = { UPDATE: 'update', ADD: 'add', REMOVE: 'remove' };\nvar ObjectType = exports.ObjectType = { OBJECT: 'object', ARRAY: 'array' };\nexports.default = SyncObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1Byb3h5T2JqZWN0LmpzP2EwZDIiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0ICdwcm94eS1vYnNlcnZlJztcbmltcG9ydCB7cGFyc2VBdHRyaWJ1dGVzfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNvbnN0IG9iamVjd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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFKQTtBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFKQTtBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFLQTtBQUNBOzs7QUFsR0E7QUFBQTtBQUFBOzs7OztBQXNHQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///207\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ProxyObject = __webpack_require__(207);\n\nvar _ProxyObject2 = _interopRequireDefault(_ProxyObject);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectChild'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n// Log System\n\n/**\n * The class returned from the DataObject addChildren call or from onAddChildren if remotely created.\n */\nvar DataObjectChild /* implements SyncStatus */ = function () {\n /* private\n ----event handlers----\n _onResponseHandler: (event) => void\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the DataObject.addChild\n */\n function DataObjectChild(input) {\n (0, _classCallCheck3.default)(this, DataObjectChild);\n\n var _this = this;\n\n function throwMandatoryParmMissingError(par) {\n throw '[DataObjectChild] ' + par + ' mandatory parameter is missing';\n }\n\n input.parent ? _this._parent = input.parent : throwMandatoryParmMissingError('parent');\n input.url ? _this._url = input.url : throwMandatoryParmMissingError('url');\n input.created ? _this._created = input.created : throwMandatoryParmMissingError('created');\n input.reporter ? _this._reporter = input.reporter : throwMandatoryParmMissingError('reporter');\n input.runtime ? _this._runtime = input.runtime : throwMandatoryParmMissingError('runtime');\n input.schema ? _this._schema = input.schema : throwMandatoryParmMissingError('schema');\n input.parentObject ? _this._parentObject = input.parentObject : throwMandatoryParmMissingError('parentObject');\n\n if (input.name) _this._name = input.name;\n if (input.description) _this._description = input.description;\n if (input.tags) _this._tags = input.tags;\n if (input.resources) _this._resources = input.resources;\n if (input.observerStorage) _this._observerStorage = input.observerStorage;\n if (input.publicObservation) _this._publicObservation = input.publicObservation;\n\n _this._childId = input.url;\n\n if (input.data) {\n _this._syncObj = new _ProxyObject2.default(input.data);\n } else {\n _this._syncObj = new _ProxyObject2.default({});\n }\n\n log.log('[DataObjectChild - Constructor] - ', _this._syncObj);\n\n _this._bus = _this._parentObject._bus;\n _this._owner = _this._parentObject._owner;\n\n _this._allocateListeners();\n\n _this._metadata = input;\n\n // delete _this._metadata.data;\n delete _this._metadata.parentObject;\n\n _this._sharingStatus = false;\n }\n\n (0, _createClass3.default)(DataObjectChild, [{\n key: 'share',\n\n\n /**\n * This function is used to share the child Object among authorised Hyperties\n * @param {boolean} reporter If true the child object is only shared to Parent reporter\n * @return {Promise} It returns a promise with the sharing results.\n */\n\n value: function share(toReporter) {\n var _this = this;\n\n _this._sharingStatus = new _promise2.default(function (resolve, reject) {\n\n var to = void 0;\n var reporter = toReporter;\n\n if (reporter) {\n to = _this.metadata.parent;\n } else to = _this.metadata.parent + '/children/';\n\n var childValue = _this.metadata;\n childValue.data = _this.data;\n\n //FLOW-OUT: this message will be sent directly to a resource child address: MessageBus\n var requestMsg = {\n type: 'create', from: _this.metadata.reporter, to: to,\n body: { resource: childValue.url, value: childValue }\n };\n\n if (_this.identity) {\n requestMsg.body.identity = _this.identity;\n }\n\n //to be used to disable mutual authentication for legacy users\n\n if (_this._parentObject.data.hasOwnProperty('mutual')) requestMsg.body.mutual = _this._parentObject.data.mutual;\n\n if (_this._parentObject.metadata.reporter === _this.metadata.reporter) {\n _this._bus.postMessage((0, _utils.deepClone)(requestMsg));\n return resolve();\n } else {\n\n var callback = function callback(reply) {\n\n if (reply.to === _this._reporter) {\n _this._bus.removeResponseListener(requestMsg.from, reply.id);\n\n log.log('[Syncher.DataObjectChild.share] Parent reporter reply ', reply);\n\n var result = {\n code: reply.body && reply.body.code ? reply.body.code : 500,\n desc: reply.body && reply.body.desc ? reply.body.desc : 'Unknown'\n };\n\n if (reply.body.code < 300) {\n return resolve(result);\n } else return reject(result);\n }\n };\n\n var id = _this._bus.postMessage((0, _utils.deepClone)(requestMsg), callback, false);\n\n setTimeout(function () {\n\n // If Reporter does not reply the promise is rejected\n _this._bus.removeResponseListener(requestMsg.from, id);\n\n var result = {\n code: 408,\n desc: 'timout'\n };\n return reject(result);\n }, 3000);\n }\n });\n }\n\n /**\n * This function is used to share the child Object among authorised Hyperties\n * @param {boolean} reporter If true the child object is only shared to Parent reporter\n * @return {Promise} It returns a promise with the sharing results.\n */\n\n }, {\n key: 'store',\n value: function store() {\n var _this = this;\n\n var child = {};\n var key = _this.metadata.children + '.' + _this.metadata.url;\n\n child.value = _this.metadata;\n child.identity = _this.identity;\n\n var msg = {\n\n from: _this.metadata.reporter,\n to: _this._parentObject._syncher._subURL,\n type: 'create',\n body: {\n resource: _this.metadata.parent,\n attribute: key,\n value: child\n }\n };\n\n log.log('[DataObjectChild.store]:', msg);\n\n _this._bus.postMessage(msg);\n }\n }, {\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this = this;\n\n //this is only needed for children reporters\n if (_this._reporter === _this._owner) {\n _this._listener = _this._bus.addListener(_this._reporter, function (msg) {\n if (msg.type === 'response' && msg.id === _this._msgId) {\n log.log('DataObjectChild.onResponse:', msg);\n _this._onResponse(msg);\n }\n });\n }\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n if (_this._listener) {\n _this._listener.remove();\n }\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n _this._releaseListeners();\n\n //TODO: send delete message ?\n\n // nothing to be done\n // return new Promise((resolve) => {\n // log.log('[DataObjectChild.delete]');\n // resolve();\n // });\n }\n\n /**\n * All Metadata about the Child Data Object\n * @type {Object} -\n */\n\n }, {\n key: 'onChange',\n\n\n /**\n * Register the change listeners sent by the reporter child\n * @param {function(event: MsgEvent)} callback\n */\n value: function onChange(callback) {\n this._syncObj.observe(function (event) {\n log.log('[DataObjectChild - observer] - ', event);\n callback(event);\n });\n }\n\n /**\n * Setup the callback to process response notifications of the creates\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n this._onResponseHandler = callback;\n }\n\n //FLOW-IN: message received from a remote DataObject -> _onChildCreate\n\n }, {\n key: '_onResponse',\n value: function _onResponse(msg) {\n var _this = this;\n\n var event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n _this._onResponseHandler(event);\n }\n }\n }, {\n key: 'shareable',\n get: function get() {\n var shareable = this.metadata;\n shareable.data = this.data;\n\n return shareable;\n }\n }, {\n key: 'metadata',\n get: function get() {\n return this._metadata;\n }\n\n /**\n * Children ID generated on addChildren. Unique identifier\n * @type {URL} - URL of the format #\n */\n\n }, {\n key: 'childId',\n get: function get() {\n return this._childId;\n }\n\n /**\n * Data Structure to be synchronized.\n * @type {JSON} - JSON structure that should follow the defined schema, if any.\n */\n\n }, {\n key: 'sharingStatus',\n get: function get() {\n return this._sharingStatus;\n }\n\n /**\n * Data Structure to be synchronized.\n * @type {JSON} - JSON structure that should follow the defined schema, if any.\n */\n\n }, {\n key: 'data',\n get: function get() {\n return this._syncObj.data;\n }\n\n /**\n * Set for this dataObjectChild an identity\n * @method identity\n * @param {Identity} identity identity from who created the message\n */\n\n }, {\n key: 'identity',\n set: function set(identity) {\n this._identity = identity;\n }\n\n /**\n * Get for this dataObjectChild an identity\n * @method identity\n * @return {Identity} identity from who created the message\n */\n ,\n get: function get() {\n return this._identity;\n }\n }]);\n return DataObjectChild;\n}();\n\nexports.default = DataObjectChild;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFPYmplY3RDaGlsZC5qcz9hNzQ2Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2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ICAgICAgbGV0IHJlc3VsdCA9IHtcbiAgICAgICAgICAgICAgY29kZTogcmVwbHkuYm9keSAmJiByZXBseS5ib2R5LmNvZGUgPyByZXBseS5ib2R5LmNvZGUgOiA1MDAsXG4gICAgICAgICAgICAgIGRlc2M6IHJlcGx5LmJvZHkgJiYgcmVwbHkuYm9keS5kZXNjID8gcmVwbHkuYm9keS5kZXNjIDogJ1Vua25vd24nXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAocmVwbHkuYm9keS5jb2RlIDwgMzAwKSB7XG4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKHJlc3VsdCk7XG4gICAgICAgICAgICB9IGVsc2UgcmV0dXJuIHJlamVjdChyZXN1bHQpO1xuXG4gICAgICAgICAgfVxuICAgICAgICB9O1xuXG4gICAgICAgIGxldCBpZCA9IF90aGlzLl9idXMucG9zdE1lc3NhZ2UoZGVlcENsb25lKHJlcXVlc3RNc2cpLCBjYWxsYmFjaywgZmFsc2UpO1xuXG4gICAgICAgIHNldFRpbWVvdXQoKCk9PiB7XG5cbiAgICAgICAgICAvLyBJZiBSZXBvcnRlciBkb2VzICBub3QgcmVwbHkgdGhlIHByb21pc2UgaXMgcmVqZWN0ZWRcbiAgICAgICAgICBfdGhpcy5fYnVzLnJlbW92ZVJlc3BvbnNlTGlzdGVuZXIocmVxdWVzdE1zZy5mcm9tLCBpZCk7XG5cbiAgICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgY29kZTogNDA4LFxuICAgICAgICAgICAgZGVzYzogJ3RpbW91dCdcbiAgICAgICAgICB9O1xuICAgICAgICAgIHJldHVybiByZWplY3QocmVzdWx0KTtcblxuICAgICAgICB9LCAzMDAwKTtcblxuICAgICAgfVxuICAgIH0pO1xuXG4gIH1cblxuICAvKipcbiAgICAgKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2hhcmUgdGhlIGNoaWxkIE9iamVjdCBhbW9uZyBhdXRob3Jpc2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0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUhBO0FBQ0E7QUFLQTtBQUNBO0FBQ0E7QUFDQTs7O0FBeE9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBNkpBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUFBO0FBQUE7QUFDQTtBQUNBOzs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUtBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7O0FBS0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7Ozs7O0FBS0E7QUFBQTtBQUFBOzs7OztBQXNDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///208\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the "License");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an "AS IS" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n * EventEmitter\n * All classes which extends this, can have addEventListener and trigger events;\n */\nvar EventEmitter = function () {\n function EventEmitter() {\n (0, _classCallCheck3.default)(this, EventEmitter);\n }\n\n (0, _createClass3.default)(EventEmitter, [{\n key: "addEventListener",\n\n\n /**\n * addEventListener listen for an eventType\n * @param {string} eventType - listening for this type of event\n * @param {Function} cb - callback function will be executed when the event it is invoked\n */\n value: function addEventListener(eventType, cb) {\n var _this = this;\n _this[eventType] = cb;\n }\n\n /**\n * Invoke the eventType\n * @param {string} eventType - event will be invoked\n * @param {object} params - parameters will be passed to the addEventListener\n */\n\n }, {\n key: "trigger",\n value: function trigger(eventType, params) {\n var _this = this;\n\n if (_this[eventType]) {\n _this[eventType](params);\n }\n }\n }]);\n return EventEmitter;\n}();\n\nexports.default = EventEmitter;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9FdmVudEVtaXR0ZXIuanM/YzgzMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0U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s7OztBQXNCQTs7OztBQUlBOzs7Ozs7Ozs7QUFFQTs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///209\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\nvar CommunicationStatus = exports.CommunicationStatus = {\n OPEN: 'open',\n PENDING: 'pending',\n CLOSED: 'closed',\n PAUSED: 'paused',\n FAILED: 'failed'\n};\n\nvar communicationObject = exports.communicationObject = {\n startingTime: '',\n status: '',\n participants: {}\n};\n\nvar communicationChildren = exports.communicationChildren = {\n \"parent\": \"communication\",\n \"listener\": \"resources\",\n \"type\": \"HypertyResource\"\n};\n\n/*\nexport let communicationObject = {\n id: '',\n name: '',\n owner: '',\n scheme: 'comm',\n startingTime: '',\n lastModified: '',\n duration: '',\n status: '',\n participants: []\n};\n*///# sourceURL=[module]\n//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G4gIHBhcnRpY2lwYW50czogW11cbn07XG4qL1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9jaGF0TWFuYWdlci9jb21tdW5pY2F0aW9uLmpzIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXVCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFMQTtBQUNBO0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUNBO0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFIQTtBQUNBO0FBS0E7Ozs7Ozs7Ozs7OztBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///210\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _RegistrationStatus = __webpack_require__(150);\n\nvar _RegistrationStatus2 = _interopRequireDefault(_RegistrationStatus);\n\nvar _InvitationsHandler = __webpack_require__(503);\n\nvar _InvitationsHandler2 = _interopRequireDefault(_InvitationsHandler);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* The Group Chat API is used to control a Group Chat instance.\n* @author Vitor Silva [vitor-t-silva@telecom.pt]\n* @version 0.1.0\n*/\n\n//import { UserInfo } from './UserInfo';\nvar ChatController = function () {\n function ChatController(syncher, discovery, domain, search, identity, manager) {\n (0, _classCallCheck3.default)(this, ChatController);\n\n\n if (!syncher) throw Error('Syncher is a necessary dependecy');\n if (!discovery) throw Error('Discover is a necessary dependecy');\n if (!domain) throw Error('Domain is a necessary dependecy');\n if (!search) throw Error('Search is a necessary dependecy');\n\n var _this = this;\n _this._syncher = syncher;\n _this.discovery = discovery;\n _this.search = search;\n _this.myIdentity = identity;\n _this.controllerMode = 'reporter';\n _this.child_cseq = 0;\n _this.domain = domain;\n\n _this._manager = manager;\n\n var hypertyURL = syncher.owner;\n\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + domain + '/.well-known/dataschema/Communication';\n\n _this._invitationsHandler = new _InvitationsHandler2.default(hypertyURL);\n }\n\n (0, _createClass3.default)(ChatController, [{\n key: '_setOnAddChildListener',\n value: function _setOnAddChildListener(dataObject) {\n\n var _this = this;\n\n dataObject.onAddChild(function (child) {\n _this.child_cseq += 1;\n console.info('[ChatManager.ChatController._setOnAddChildListener] new Child received: ', child);\n\n if (_this._onMessage) _this._onMessage(child);\n });\n }\n }, {\n key: '_onSubscribe',\n value: function _onSubscribe(event) {\n\n var dataObjectReporter = this._dataObjectReporter;\n\n event.accept();\n\n console.log('[ChatManager.ChatController.onSubscribe] event', event, dataObjectReporter.url);\n console.log('[ChatManager.ChatController.onSubscribe] New user has subscribe this object: ', dataObjectReporter.data, event.identity);\n\n var identity = JSON.parse((0, _stringify2.default)(event.identity));\n\n if (identity.hasOwnProperty('assertion')) {\n delete identity.assertion;\n }\n\n var userInfo = {\n hypertyURL: event.url,\n domain: event.domain,\n identity: identity\n };\n var userURL = event.identity.userProfile.guid;\n\n console.log('[ChatManager.ChatController.onSubscribe] new participant', userInfo);\n if (event.identity.legacy) {\n userInfo.legacy = event.identity.legacy;\n }\n\n dataObjectReporter.data.participants[userURL] = userInfo;\n\n console.log('[ChatManager.ChatController.onSubscribe] communicationObject OBJ chatcontroller', dataObjectReporter.data.participants);\n console.log('[ChatManager.ChatController.onSubscribe - onSubscription] ', userInfo);\n // console.log('[ChatManager.ChatController.onSubscribe - this._onUserAdded] ', this._onUserAdded);\n\n if (this._onUserAdded) this._onUserAdded(userInfo);\n }\n }, {\n key: '_onUnsubscribe',\n value: function _onUnsubscribe(event) {\n var dataObjectReporter = this._dataObjectReporter;\n\n console.log('[ChatManager.ChatController.onUnsubscribe] event', event, dataObjectReporter.url);\n\n var participant = event.identity.userProfile;\n\n console.log('[ChatManager.ChatController.onUnsubscribe] participant left', participant);\n if (event.identity.legacy) {\n participant.legacy = event.identity.legacy;\n }\n\n delete dataObjectReporter.data.participants[participant.userURL];\n\n console.log('[ChatManager.ChatController.onUnsubscribe - this._onUserRemoved] ', this.onUserRemoved);\n if (this._onUserRemoved) this._onUserRemoved(participant);\n }\n\n /**\n * This function is used to send a file.\n * @param {string} file Is the file to be sent.\n * @return {Promise} It returns the ChatMessage child object created by the Syncher as a Promise.\n */\n\n }, {\n key: 'sendFile',\n value: function sendFile(file) {\n\n var _this = this;\n var mode = _this.controllerMode;\n var dataObject = mode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n return new _promise2.default(function (resolve, reject) {\n\n var identity = {\n userProfile: _this.myIdentity\n };\n\n dataObject.addHypertyResource('resources', 'file', file, identity).then(function (resourceFile) {\n\n var identity = {\n userProfile: _this.myIdentity\n };\n var fileSentEvt = { value: resourceFile, identity: identity, resource: resourceFile };\n\n var reporterStatus = new _RegistrationStatus2.default(dataObject.url, _this._manager._runtimeURL, _this._manager._hypertyURL, _this._manager._bus);\n\n // recursive function to sync with chat reporter\n\n var share2Reporter = function share2Reporter(file, subscriber, evt, status) {\n var statusOfReporter = status;\n file.sharingStatus.then(resolve(evt)).catch(function (result) {\n console.log('[ChatManager.ChatController.sendFile] share failed: ', result);\n\n statusOfReporter.onLive(subscriber, function () {\n statusOfReporter.unsubscribeLive(subscriber);\n file.share(true);\n share2Reporter(file, subscriber, evt, statusOfReporter);\n });\n //TODO: subscribe to sync when reporter is live. New synched messages should trigger onMessage ie onChild\n });\n };\n\n share2Reporter(resourceFile, _this._manager._hypertyURL, fileSentEvt, reporterStatus);\n });\n }).catch(function (reason) {\n console.error('Reason:', reason);\n reject(reason);\n });\n }\n\n /**\n * This function is used to send a chat message.\n * @param {string} message Is the ChatMessage to be sent.\n * @return {Promise} It returns the ChatMessage child object created by the Syncher as a Promise.\n */\n\n }, {\n key: 'send',\n value: function send(message, identity) {\n\n var _this = this;\n var mode = _this.controllerMode;\n var dataObject = mode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n return new _promise2.default(function (resolve, reject) {\n\n // let _dataObjectChild;\n _this.child_cseq += 1;\n var msg = {\n\n /* url: dataObject.data.url,\n cseq: _this.child_cseq,\n reporter: dataObject.data.reporter,\n schema: dataObject.data.schema,\n name: dataObject.data.name,\n created : new Date().toJSON(),*/\n\n type: 'chat',\n content: message\n };\n\n var sender = identity ? identity : {\n userProfile: _this.myIdentity\n };\n\n // TODO: change chatmessages to resource - chat, file\n // TODO: change message to hypertyResource - https://github.com/reTHINK-project/dev-service-framework/tree/develop/docs/datamodel/data-objects/hyperty-resource\n // TODO: handle with multiple resources - if the \"message\" will be different for each type of resources\n dataObject.addChild(msg, sender).then(function (dataObjectChild) {\n console.log('[ChatManager.ChatController][addChild - Chat Message]: ', dataObjectChild);\n //resolve(dataObjectChild);\n\n //TODO: move to separate function\n\n\n var msg = {\n childId: dataObjectChild._childId,\n from: dataObjectChild._owner,\n value: dataObjectChild.data,\n type: 'create',\n identity: sender\n };\n\n var reporterStatus = new _RegistrationStatus2.default(dataObject.url, _this._manager._runtimeURL, _this._manager._hypertyURL, _this._manager._bus);\n\n // recursive function to sync with chat reporter\n\n var share2Reporter = function share2Reporter(child, subscriber, msg, status) {\n var statusOfReporter = status;\n child.sharingStatus.then(resolve(msg)).catch(function (result) {\n\n statusOfReporter.onLive(subscriber, function () {\n statusOfReporter.unsubscribeLive(subscriber);\n child.share(true);\n share2Reporter(child, subscriber, msg, statusOfReporter);\n });\n //TODO: subscribe to sync when reporter is live. New synched messages should trigger onMessage ie onChild\n });\n };\n\n share2Reporter(dataObjectChild, _this._manager._hypertyURL, msg, reporterStatus);\n }).catch(function (reason) {\n console.error('Reason:', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * [onChange description]\n * @param {Function} callback [description]\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onChange',\n value: function onChange(callback) {\n var _this = this;\n _this._onChange = callback;\n }\n\n /**\n * This function is used to receive new messages.\n * @param {Function} callback Function to handle with new messages\n * @return {Communication.ChatMessage} m\n */\n\n }, {\n key: 'onMessage',\n value: function onMessage(callback) {\n var _this = this;\n _this._onMessage = callback;\n }\n\n /**\n * [onUserAdded description]\n * @param {Function} callback [description]\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onUserAdded',\n value: function onUserAdded(callback) {\n var _this = this;\n _this._onUserAdded = callback;\n }\n\n /**\n * When the an user was removed\n * @param {Function} callback Function handle with the removed user\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onUserRemoved',\n value: function onUserRemoved(callback) {\n var _this = this;\n _this._onUserRemoved = callback;\n }\n\n /**\n * This function is used to receive requests to close the Group Chat instance.\n * @return {DeleteEvent} The DeleteEvent fired by the Syncher when the Chat is closed.\n */\n\n }, {\n key: 'onClose',\n value: function onClose(callback) {\n var _this = this;\n _this._onClose = callback;\n }\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n var _this = this;\n _this._onResponse = callback;\n }\n\n /**\n * This function is used to add / invite new user on an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @param {URL.UserURL} users User to be invited to join the Group Chat that is identified with reTHINK User URL.\n * @return {Promise} It returns as a Promise true if successfully invited or false otherwise.\n */\n\n }, {\n key: 'addUser',\n value: function addUser(users) {\n\n var _this = this;\n\n var haveEmptyElements = function haveEmptyElements(element) {\n console.log('Element:', element.length);\n return element.length !== 0;\n };\n\n var notFoundElements = function notFoundElements(element) {\n console.log('user not found: ', element);\n return !(element instanceof String);\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n if (users.filter(haveEmptyElements).length === 0) {\n return reject('Don\\'t have users to invite');\n }\n\n console.info('[ChatManager.ChatController.addUsers ]: ', users);\n\n /*_this.search.users(users, domains, ['comm'], ['chat'])\n .then((hypertiesIDs) => {\n if (hypertiesIDs.filter(notFoundElements).length === 0) {\n throw 'User(s) not found';\n }\n let selectedHyperties = hypertiesIDs.map((hyperty) => {\n return hyperty.hypertyID;\n });*/\n\n var usersDiscovery = [];\n var disconnected = [];\n var live = {};\n\n users.forEach(function (user) {\n var userDiscoveryPromise = _this.discovery.discoverHypertiesDO(user.user, ['comm'], ['chat'], user.domain);\n usersDiscovery.push(userDiscoveryPromise);\n });\n\n _promise2.default.all(usersDiscovery).then(function (userDiscoveryResults) {\n console.log('[ChatManager.ChatController.addUsers] Users Discovery Results->', userDiscoveryResults);\n\n var selectedHyperties = [];\n\n userDiscoveryResults.forEach(function (userDiscoveryResult) {\n\n userDiscoveryResult.forEach(function (discovered) {\n if (discovered.data.status === 'live') {\n selectedHyperties.push(discovered.data.hypertyID);\n live[discovered.data.hypertyID] = discovered;\n } else if (disconnected.length < 5) disconnected.push(discovered);\n });\n });\n\n console.info('[ChatManager.ChatController]------------------------ Syncher Create ---------------------- \\n');\n console.info('[ChatManager.ChatController]Selected Hyperties: !!! ', selectedHyperties);\n console.info('Have ' + selectedHyperties.length + ' users;');\n // console.info('[ChatManager] HypertiesIDs ', hypertiesIDs);\n\n var dataObject = _this.controllerMode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n if (disconnected.length > 0) _this._invitationsHandler.inviteDisconnectedHyperties(disconnected, dataObject);\n\n dataObject.inviteObservers(selectedHyperties);\n\n if (dataObject.invitations.length > 0) _this._invitationsHandler.processInvitations(live, dataObject);\n\n return;\n }).then(function () {\n console.info('[ChatManager.ChatController]Are invited with success ' + users.length + ' users;');\n resolve(true);\n }).catch(function (reason) {\n console.error('An error occurred when trying to invite users;\\n', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * This function is used to request the Reporter to add / invite new user on an existing Group Chat instance.\n * Only Observers are allowed to use this function.\n * @param {URL.UserURL} users User to be invited to join the Group Chat that is identified with reTHINK User URL.\n * @return {Promise} It returns as a Promise true if successfully invited or false otherwise.\n */\n\n }, {\n key: 'addUserReq',\n value: function addUserReq(users) {\n\n var _this = this;\n\n //check is Observer and invoke observer.execute() with new promise\n var haveEmptyElements = function haveEmptyElements(element) {\n console.log('Element:', element.length);\n return element.length !== 0;\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n if (users.filter(haveEmptyElements).length === 0) {\n return reject('[ChatManager.ChatController.addUserReq] Don\\'t have users to add');\n }\n if (!_this.controllerMode === 'observer') {\n return reject('[ChatManager.ChatController.addUserReq] only allowed to Chat Observer');\n\n var addUser = _this.addUser(users);\n\n if (_this._dataObjectObserver) {\n addUser = _this._dataObjectObserver.execute('addUser', users);\n }\n\n addUser.then(function () {\n console.info('[ChatManager.ChatController.addUserReq] Request accepted by Reporter ');\n resolve(true);\n }).catch(function (reason) {\n console.error('[ChatManager.ChatController.addUserReq] Request rejected by Reporter;\\n', reason);\n reject(reason);\n });\n }\n });\n }\n }, {\n key: 'onInvitationResponse',\n value: function onInvitationResponse(callback) {\n var _this = this;\n _this._onInvitationResponse = callback;\n _this._invitationsHandler.invitationResponse = callback;\n }\n\n /**\n * This function is used to remove a user from an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @return { boolean} Promise with the status\n */\n\n /**\n * This function is used to remove a user from an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @param {URL.UserURL} user User to be removed from the Group Chat that is identified with reTHINK User URL.\n * @return { boolean} It returns as a Promise true if successfully removed or false otherwise.\n */\n\n }, {\n key: 'removeUser',\n value: function removeUser(user) {\n\n // TODO: implement the removeUser;\n console.log('[ChatManager.ChatController]Not yet implemented: ', user);\n }\n\n /**\n * This function is used to close an existing Group Chat instance.\n * Only available to Chat Group Reporters i.e. the Hyperty instance that created the Group Chat.\n * @return {Boolean} It returns as a Promise true if successfully closed or false otherwise.\n */\n\n }, {\n key: 'close',\n value: function close() {\n var del = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n // TODO: the dataObjectReporter.delete should be a Promise;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.controllerMode === 'reporter') {\n // reporter\n _this._invitationsHandler.cleanInvitations(_this.dataObjectReporter).then(function () {\n if (!del) {\n _this._manager.communicationObject.status = 'closed';\n resolve(true);\n } else {\n\n try {\n\n delete _this._manager._reportersControllers[_this.dataObjectReporter.url];\n _this.dataObjectReporter.delete();\n resolve(true);\n if (_this._onClose) _this._onClose({\n code: 200,\n desc: 'deleted',\n url: _this.dataObjectReporter.url\n });\n } catch (e) {\n console.error(e);\n reject(false);\n }\n }\n });\n } else {\n // observer\n if (del) {\n try {\n delete _this._manager._observersControllers[_this.dataObjectObserver.url];\n _this.dataObjectObserver.unsubscribe();\n resolve(true);\n } catch (e) {\n console.error(e);\n reject(false);\n }\n } else {\n // TODO: send message \n resolve(true);\n }\n }\n });\n }\n }, {\n key: 'invitationsHandler',\n get: function get() {\n return this._invitationsHandler;\n }\n }, {\n key: 'url',\n get: function get() {\n return this.controllerMode === 'reporter' ? this.dataObjectReporter.url : this.dataObjectObserver.url;\n }\n }, {\n key: 'dataObjectReporter',\n set: function set(dataObjectReporter) {\n\n if (!dataObjectReporter) throw new Error('[ChatController] The data object reporter is necessary parameter ');\n var _this = this;\n\n _this.controllerMode = 'reporter';\n\n // Handler to process received files\n\n // dataObjectReporter.onResponse(function(event) {\n // console.log('[DataObjectReporter - onResponse]', event);\n // if (_this._onInvitationResponse) {\n // _this._onInvitationResponse(event);\n // }\n //\n // });\n\n dataObjectReporter.onSubscription(function (event) {\n\n switch (event.type) {\n case 'subscribe':\n _this._onSubscribe(event);break;\n case 'unsubscribe':\n _this._onUnsubscribe(event);break;\n }\n });\n\n _this._setOnAddChildListener(dataObjectReporter);\n\n dataObjectReporter.onRead(function (event) {\n event.accept();\n });\n\n dataObjectReporter.onExecute(function (event) {\n switch (event.method) {\n case 'addUser':\n _this.addUser(event.params[0]).then(function () {\n event.accept();\n }).catch(function (reason) {\n console.error('Reason:', reason);\n event.reject(reason);\n });\n break;\n case 'removeUser':\n _this.removeUser(event.params).then(function () {\n event.accept();\n }).catch(function (reason) {\n console.error('Reason:', reason);\n event.reject(reason);\n });\n break;\n default:\n event.reject('[ChatController.onExecute] Chat method execution not accepted by Reporter');\n break;\n }\n });\n\n _this._dataObjectReporter = dataObjectReporter;\n },\n get: function get() {\n var _this = this;\n return _this._dataObjectReporter;\n }\n }, {\n key: 'messages',\n get: function get() {\n\n return this.controllerMode === 'reporter' ? this._dataObjectReporter._childrenObjects : this._dataObjectObserver._childrenObjects;\n }\n }, {\n key: 'dataObjectObserver',\n set: function set(dataObjectObserver) {\n var _this = this;\n\n _this.controllerMode = 'observer';\n\n _this._dataObjectObserver = dataObjectObserver;\n\n dataObjectObserver.onChange('*', function (event) {\n console.info('[ChatManager.ChatController]Observer - onChange', event);\n\n if (event.field.includes('participants')) {\n switch (event.cType) {\n case 'add':\n if (_this._onUserAdded) _this._onUserAdded(event);\n break;\n\n case 'remove':\n if (_this._onUserRemoved) _this._onUserRemoved(event);\n break;\n }\n }\n\n if (_this._onChange) _this._onChange(event);\n });\n\n _this._setOnAddChildListener(dataObjectObserver);\n\n // let childrens = dataObjectObserver.childrens;\n // Object.keys(childrens).forEach((child) => {\n // if (_this._onMessage) _this._onMessage({\n // childId: child,\n // identity: childrens[child].identity,\n // value: childrens[child].data\n // });\n // })\n },\n get: function get() {\n var _this = this;\n return _this._dataObjectObserver;\n }\n }, {\n key: 'dataObject',\n get: function get() {\n return this.controllerMode === 'reporter' ? this.dataObjectReporter : this.dataObjectObserver;\n }\n }, {\n key: 'closeEvent',\n set: function set(event) {\n var _this = this;\n _this._closeEvent = event;\n\n if (_this._onClose) _this._onClose(event);\n },\n get: function get() {\n var _this = this;\n return _this._closeEvent;\n }\n }]);\n return ChatController;\n}();\n\nexports.default = ChatController;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9DaGF0Q29udHJvbGxlci5qcz81MDg3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCA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4gICAqL1xuICBjbG9zZShkZWwgPSB0cnVlKSB7XG4gICAgLy8gVE9ETzogdGhlIGRhdGFPYmplY3RSZXBvcnRlci5kZWxldGUgc2hvdWxkIGJlIGEgUHJvbWlzZTtcblxuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgXG4gICAgICBpZiAoX3RoaXMuY29udHJvbGxlck1vZGUgPT09ICdyZXBvcnRlcicpIHtcbiAgICAgICAgLy8gcmVwb3J0ZXJcbiAgICAgICAgX3RoaXMuX2ludml0YXRpb25zSGFuZGxlci5jbGVhbkludml0YXRpb25zKF90aGlzLmRhdGFPYmplY3RSZXBvcnRlcikudGhlbigoKSA9PiB7XG4gICAgICAgICAgaWYgKCFkZWwpIHtcbiAgICAgICAgICAgIF90aGlzLl9tYW5hZ2VyLmNvbW11bmljYXRpb25PYmplY3Quc3RhdHVzID0gJ2Nsb3NlZCc7XG4gICAgICAgICAgICAgIHJlc29sdmUodHJ1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBlbHNle1xuXG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgZGVsZXRlIF90aGlzLl9tYW5hZ2VyLl9yZXBvcnRlcnNDb250cm9sbGVyc1tfdGhpcy5kYXRhT2JqZWN0UmVwb3J0ZXIudXJsXTtcbiAgICAgICAgICAgICAgICBfdGhpcy5kYXRhT2JqZWN0UmVwb3J0ZXIuZGVsZXRlKCk7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZSh0cnVlKTtcbiAgICAgICAgICAgICAgICBpZiAoX3RoaXMuX29uQ2xvc2UpIF90aGlzLl9vbkNsb3NlKHtcbiAgICAgICAgICAgICAgICAgIGNvZGU6IDIwMCxcbiAgICAgICAgICAgICAgICAgIGRlc2M6ICdkZWxldGVkJyxcbiAgICAgICAgICAgICAgICAgIHVybDogX3RoaXMuZGF0YU9iamVjdFJlcG9ydGVyLnVybFxuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKGUpO1xuICAgICAgICAgICAgICAgIHJlamVjdChmYWxzZSk7XG4gICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0pO1xuXG4gICAgICB9IGVsc2Uge1xuICAgICAgICAvLyBvYnNlcnZlclxuICAgICAgICBpZihkZWwpe1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBkZWxldGUgX3RoaXMuX21hbmFnZXIuX29ic2VydmVyc0NvbnRyb2xsZXJzW190aGlzLmRhdGFPYmplY3RPYnNlcnZlci51cmxdO1xuICAgICAgICAgICAgX3RoaXMuZGF0YU9iamVjdE9ic2VydmVyLnVuc3Vic2NyaWJlKCk7XG4gICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoZSk7XG4gICAgICAgICAgICByZWplY3QoZmFsc2UpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBlbHNle1xuICAgICAgICAgIC8vIFRPRE86IHNlbmQgbWVzc2FnZSBcbiAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICB9IFxuICAgICAgICBcbiAgICAgIH1cbiAgICB9KTtcblxuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgQ2hhdENvbnRyb2xsZXI7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL2NoYXRNYW5hZ2VyL0NoYXRDb250cm9sbGVyLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBOEJBO0FBQ0E7OztBQUFBO0FBQ0E7Ozs7O0FB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\n\nvar _defineProperty2 = __webpack_require__(504);\n\nvar _defineProperty3 = _interopRequireDefault(_defineProperty2);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar UserInfo = exports.UserInfo = function UserInfo(hypertyURL, domain, identity) {\n var _ref;\n\n (0, _classCallCheck3.default)(this, UserInfo);\n\n\n var completeIdentity = (0, _utils.deepClone)(identity);\n if (!identity.hasOwnProperty('userProfile')) {\n completeIdentity['userProfile'] = identity;\n }\n\n return _ref = {\n hypertyURL: hypertyURL,\n domain: domain }, (0, _defineProperty3.default)(_ref, 'domain', domain), (0, _defineProperty3.default)(_ref, 'identity', completeIdentity), _ref;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9Vc2VySW5mby5qcz81MThiIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlZXBDbG9uZSB9IGZyb20gJy4uL3V0aWxzL3V0aWxzJztcblxuZXhwb3J0IGNsYXNzIFVzZXJJbmZvIHtcblxuICBjb25zdHJ1Y3RvcihoeXBlcnR5VVJMLCBkb21haW4sIGlkZW50aXR5KSB7XG5cbiAgICBsZXQgY29tcGxldGVJZGVudGl0eSA9IGRlZXBDbG9uZShpZGVudGl0eSk7XG4gICAgaWYgKCFpZGVudGl0eS5oYXNPd25Qcm9wZXJ0eSgndXNlclByb2ZpbGUnKSkge1xuICAgICAgY29tcGxldGVJZGVudGl0eVsndXNlclByb2ZpbGUnXSA9IGlkZW50aXR5O1xuICAgIH1cblxuICAgIHJldHVybiB7XG4gICAgICBoeXBlcnR5VVJMOiBoeXBlcnR5VVJMLFxuICAgICAgZG9tYWluLCBkb21haW4sXG4gICAgICBpZGVudGl0eTogY29tcGxldGVJZGVudGl0eVxuICAgIH1cblxuICB9XG5cbn1cblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvY2hhdE1hbmFnZXIvVXNlckluZm8uanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7OztBQUNBO0FBRUE7QUFDQTtBQURBO0FBQ0E7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFJQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///212\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* The Group Chat API is used to control a Group Chat instance.\n* @author Vitor Silva [vitor-t-silva@telecom.pt]\n* @version 0.1.0\n*/\n\n//import { UserInfo } from './UserInfo';\n//import RegistrationStatus from '../discovery/RegistrationStatus';\n//import InvitationsHandler from './InvitationsHandler';\n\nvar Chat = function () {\n function Chat(syncher, domain, identity, manager) {\n (0, _classCallCheck3.default)(this, Chat);\n\n\n if (!syncher) throw Error('Syncher is a necessary dependecy');\n // if (!discovery) throw Error('Discover is a necessary dependecy');\n if (!domain) throw Error('Domain is a necessary dependecy');\n // if (!search) throw Error('Search is a necessary dependecy');\n\n var _this = this;\n _this._syncher = syncher;\n // _this.discovery = discovery;\n // _this.search = search;\n _this.myIdentity = identity;\n _this.controllerMode = 'reporter';\n _this.child_cseq = 0;\n _this.domain = domain;\n\n _this._manager = manager;\n\n var hypertyURL = syncher.owner;\n\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + domain + '/.well-known/dataschema/Communication';\n\n // _this._invitationsHandler = new InvitationsHandler(hypertyURL);\n }\n\n /* get invitationsHandler() {\n return this._invitationsHandler;\n }*/\n\n (0, _createClass3.default)(Chat, [{\n key: '_setOnAddChildListener',\n value: function _setOnAddChildListener(dataObject) {\n\n var _this = this;\n\n dataObject.onAddChild(function (child) {\n _this.child_cseq += 1;\n console.info('[ChatManager.ChatController._setOnAddChildListener] new Child received: ', child);\n\n if (_this._onMessage) _this._onMessage(child);\n });\n }\n }, {\n key: '_onSubscribe',\n value: function _onSubscribe(event) {\n\n var dataObjectReporter = this._dataObjectReporter;\n\n event.accept();\n\n console.log('[ChatManager.ChatController.onSubscribe] event', event, dataObjectReporter.url);\n console.log('[ChatManager.ChatController.onSubscribe] New user has subscribe this object: ', dataObjectReporter.data, event.identity);\n\n var identity = JSON.parse((0, _stringify2.default)(event.identity));\n\n if (identity.hasOwnProperty('assertion')) {\n delete identity.assertion;\n }\n\n var userInfo = {\n hypertyURL: event.url,\n domain: event.domain,\n identity: identity\n };\n var userURL = event.identity.userProfile.guid;\n\n console.log('[ChatManager.ChatController.onSubscribe] new participant', userInfo);\n if (event.identity.legacy) {\n userInfo.legacy = event.identity.legacy;\n }\n\n dataObjectReporter.data.participants[userURL] = userInfo;\n\n console.log('[ChatManager.ChatController.onSubscribe] communicationObject OBJ chatcontroller', dataObjectReporter.data.participants);\n console.log('[ChatManager.ChatController.onSubscribe - onSubscription] ', userInfo);\n // console.log('[ChatManager.ChatController.onSubscribe - this._onUserAdded] ', this._onUserAdded);\n\n if (this._onUserAdded) this._onUserAdded(userInfo);\n }\n }, {\n key: '_onUnsubscribe',\n value: function _onUnsubscribe(event) {\n var dataObjectReporter = this._dataObjectReporter;\n\n console.log('[ChatManager.ChatController.onUnsubscribe] event', event, dataObjectReporter.url);\n\n var participant = event.identity.userProfile;\n\n console.log('[ChatManager.ChatController.onUnsubscribe] participant left', participant);\n if (event.identity.legacy) {\n participant.legacy = event.identity.legacy;\n }\n\n delete dataObjectReporter.data.participants[participant.userURL];\n\n console.log('[ChatManager.ChatController.onUnsubscribe - this._onUserRemoved] ', this.onUserRemoved);\n if (this._onUserRemoved) this._onUserRemoved(participant);\n }\n\n /**\n * This function is used to send a file.\n * @param {string} file Is the file to be sent.\n * @return {Promise} It returns the ChatMessage child object created by the Syncher as a Promise.\n */\n\n }, {\n key: 'sendFile',\n value: function sendFile(file) {\n\n var _this = this;\n var mode = _this.controllerMode;\n var dataObject = mode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n return new _promise2.default(function (resolve, reject) {\n\n var identity = {\n userProfile: _this.myIdentity\n };\n\n dataObject.addHypertyResource('resources', 'file', file, identity).then(function (resourceFile) {\n\n var identity = {\n userProfile: _this.myIdentity\n };\n var fileSentEvt = { value: resourceFile, identity: identity, resource: resourceFile };\n\n /* let reporterStatus = new RegistrationStatus(dataObject.url, _this._manager._runtimeURL, _this._manager._hypertyURL, _this._manager._bus );\n \n // recursive function to sync with chat reporter\n \n let share2Reporter = function(file, subscriber, evt, status) {\n let statusOfReporter = status;\n file.sharingStatus.then(resolve(evt)).catch((result)=>{\n console.log('[ChatManager.ChatController.sendFile] share failed: ', result);\n \n statusOfReporter.onLive( subscriber, () => {\n statusOfReporter.unsubscribeLive(subscriber);\n file.share(true);\n share2Reporter(file, subscriber, evt, statusOfReporter);\n });\n //TODO: subscribe to sync when reporter is live. New synched messages should trigger onMessage ie onChild\n });\n }*/\n\n // resourceFile.share(true).then(()=>{\n resolve(fileSentEvt);\n // });\n // share2Reporter(resourceFile, _this._manager._hypertyURL, fileSentEvt, reporterStatus);\n });\n }).catch(function (reason) {\n console.error('Reason:', reason);\n reject(reason);\n });\n }\n\n /**\n * This function is used to send a chat message.\n * @param {string} message Is the ChatMessage to be sent.\n * @return {Promise} It returns the ChatMessage child object created by the Syncher as a Promise.\n */\n\n }, {\n key: 'send',\n value: function send(message, identity) {\n\n var _this = this;\n var mode = _this.controllerMode;\n var dataObject = mode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n\n return new _promise2.default(function (resolve, reject) {\n\n // let _dataObjectChild;\n _this.child_cseq += 1;\n var msg = {\n\n /* url: dataObject.data.url,\n cseq: _this.child_cseq,\n reporter: dataObject.data.reporter,\n schema: dataObject.data.schema,\n name: dataObject.data.name,\n created : new Date().toJSON(),*/\n\n type: 'chat',\n content: message\n };\n\n var sender = identity ? identity : {\n userProfile: _this.myIdentity\n };\n\n // TODO: change chatmessages to resource - chat, file\n // TODO: change message to hypertyResource - https://github.com/reTHINK-project/dev-service-framework/tree/develop/docs/datamodel/data-objects/hyperty-resource\n // TODO: handle with multiple resources - if the \"message\" will be different for each type of resources\n dataObject.addChild(msg, sender).then(function (dataObjectChild) {\n console.log('[ChatManager.ChatController][addChild - Chat Message]: ', dataObjectChild);\n //resolve(dataObjectChild);\n\n //TODO: move to separate function\n\n\n var msg = {\n childId: dataObjectChild._childId,\n from: dataObjectChild._owner,\n value: dataObjectChild.data,\n type: 'create',\n identity: sender\n };\n\n /* let reporterStatus = new RegistrationStatus(dataObject.url, _this._manager._runtimeURL, _this._manager._hypertyURL, _this._manager._bus );\n \n // recursive function to sync with chat reporter\n \n let share2Reporter = function(child, subscriber, msg, status) {\n let statusOfReporter = status;\n child.sharingStatus.then(resolve(msg)).catch((result)=>{\n \n statusOfReporter.onLive( subscriber, () => {\n statusOfReporter.unsubscribeLive(subscriber);\n child.share(true);\n share2Reporter(child, subscriber, msg, statusOfReporter);\n });\n //TODO: subscribe to sync when reporter is live. New synched messages should trigger onMessage ie onChild\n });\n }*/\n\n // share2Reporter(dataObjectChild, _this._manager._hypertyURL, msg, reporterStatus);\n // dataObjectChild.share(true);\n resolve(msg);\n }).catch(function (reason) {\n console.error('Reason:', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * [onChange description]\n * @param {Function} callback [description]\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onChange',\n value: function onChange(callback) {\n var _this = this;\n _this._onChange = callback;\n }\n\n /**\n * This function is used to receive new messages.\n * @param {Function} callback Function to handle with new messages\n * @return {Communication.ChatMessage} m\n */\n\n }, {\n key: 'onMessage',\n value: function onMessage(callback) {\n var _this = this;\n _this._onMessage = callback;\n }\n\n /**\n * [onUserAdded description]\n * @param {Function} callback [description]\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onUserAdded',\n value: function onUserAdded(callback) {\n var _this = this;\n _this._onUserAdded = callback;\n }\n\n /**\n * When the an user was removed\n * @param {Function} callback Function handle with the removed user\n * @return {[type]} [description]\n */\n\n }, {\n key: 'onUserRemoved',\n value: function onUserRemoved(callback) {\n var _this = this;\n _this._onUserRemoved = callback;\n }\n\n /**\n * This function is used to receive requests to close the Group Chat instance.\n * @return {DeleteEvent} The DeleteEvent fired by the Syncher when the Chat is closed.\n */\n\n }, {\n key: 'onClose',\n value: function onClose(callback) {\n var _this = this;\n _this._onClose = callback;\n }\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n var _this = this;\n _this._onResponse = callback;\n }\n\n /**\n * This function is used to add / invite new user on an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @param {URL.UserURL} users User to be invited to join the Group Chat that is identified with reTHINK User URL.\n * @return {Promise} It returns as a Promise true if successfully invited or false otherwise.\n */\n /* addUser(users) {\n \n let _this = this;\n \n let haveEmptyElements = (element) => {\n console.log('Element:', element.length);\n return element.length !== 0;\n };\n \n let notFoundElements = (element) => {\n console.log('user not found: ', element);\n return !(element instanceof String);\n };\n \n return new Promise(function(resolve, reject) {\n \n if (users.filter(haveEmptyElements).length === 0) {\n return reject('Don\\'t have users to invite');\n }\n \n console.info('[ChatManager.ChatController.addUsers ]: ', users);\n \n /*_this.search.users(users, domains, ['comm'], ['chat'])\n \n .then((hypertiesIDs) => {\n \n if (hypertiesIDs.filter(notFoundElements).length === 0) {\n throw 'User(s) not found';\n }\n \n let selectedHyperties = hypertiesIDs.map((hyperty) => {\n return hyperty.hypertyID;\n });*/\n\n /* let usersDiscovery = [];\n let disconnected = [];\n let live = {};\n \n users.forEach((user) => {\n let userDiscoveryPromise = _this.discovery.discoverHypertiesDO(user.user, ['comm'], ['chat'], user.domain);\n usersDiscovery.push(userDiscoveryPromise);\n });\n \n Promise.all(usersDiscovery).then((userDiscoveryResults) => {\n console.log('[ChatManager.ChatController.addUsers] Users Discovery Results->', userDiscoveryResults);\n \n let selectedHyperties = [];\n \n userDiscoveryResults.forEach((userDiscoveryResult) => {\n \n userDiscoveryResult.forEach((discovered)=>{\n if (discovered.data.status === 'live'){\n selectedHyperties.push(discovered.data.hypertyID);\n live[discovered.data.hypertyID] = discovered;\n }\n else if (disconnected.length < 5) disconnected.push(discovered);\n });\n \n });\n \n console.info('[ChatManager.ChatController]------------------------ Syncher Create ---------------------- \\n');\n console.info('[ChatManager.ChatController]Selected Hyperties: !!! ', selectedHyperties);\n console.info(`Have ${selectedHyperties.length} users;`);\n // console.info('[ChatManager] HypertiesIDs ', hypertiesIDs);\n \n let dataObject = _this.controllerMode === 'reporter' ? _this.dataObjectReporter : _this.dataObjectObserver;\n \n if (disconnected.length > 0) _this._invitationsHandler.inviteDisconnectedHyperties(disconnected, dataObject);\n \n dataObject.inviteObservers(selectedHyperties);\n \n if (dataObject.invitations.length > 0) _this._invitationsHandler.processInvitations(live, dataObject);\n \n return;\n \n })\n .then(() => {\n console.info('[ChatManager.ChatController]Are invited with success ' + users.length + ' users;');\n resolve(true);\n \n \n \n }).catch((reason) => {\n console.error('An error occurred when trying to invite users;\\n', reason);\n reject(reason);\n });\n \n });\n \n }*/\n\n /**\n * This function is used to request the Reporter to add / invite new user on an existing Group Chat instance.\n * Only Observers are allowed to use this function.\n * @param {URL.UserURL} users User to be invited to join the Group Chat that is identified with reTHINK User URL.\n * @return {Promise} It returns as a Promise true if successfully invited or false otherwise.\n */\n /* addUserReq(users) {\n \n let _this = this;\n \n //check is Observer and invoke observer.execute() with new promise\n let haveEmptyElements = (element) => {\n console.log('Element:', element.length);\n return element.length !== 0;\n };\n \n return new Promise(function(resolve, reject) {\n \n if (users.filter(haveEmptyElements).length === 0) {\n return reject('[ChatManager.ChatController.addUserReq] Don\\'t have users to add');\n }\n if (!_this.controllerMode === 'observer') {\n return reject('[ChatManager.ChatController.addUserReq] only allowed to Chat Observer');\n \n let addUser = _this.addUser(users);\n \n if (_this._dataObjectObserver) {\n addUser = _this._dataObjectObserver.execute('addUser', users);\n }\n \n addUser.then(() => {\n console.info('[ChatManager.ChatController.addUserReq] Request accepted by Reporter ');\n resolve(true);\n }).catch((reason) => {\n console.error('[ChatManager.ChatController.addUserReq] Request rejected by Reporter;\\n', reason);\n reject(reason);\n });\n }\n \n });\n \n }*/\n\n }, {\n key: 'onInvitationResponse',\n value: function onInvitationResponse(callback) {\n var _this = this;\n _this._onInvitationResponse = callback;\n // _this._invitationsHandler.invitationResponse = callback;\n }\n\n /**\n * This function is used to remove a user from an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @return { boolean} Promise with the status\n */\n\n /**\n * This function is used to remove a user from an existing Group Chat instance.\n * Only the Reporter, i.e. the Hyperty that has created the Group Chat, is allowed to use this function.\n * @param {URL.UserURL} user User to be removed from the Group Chat that is identified with reTHINK User URL.\n * @return { boolean} It returns as a Promise true if successfully removed or false otherwise.\n */\n\n }, {\n key: 'removeUser',\n value: function removeUser(user) {\n\n // TODO: implement the removeUser;\n console.log('[ChatManager.ChatController]Not yet implemented: ', user);\n }\n\n /**\n * This function is used to close an existing Group Chat instance.\n * Only available to Chat Group Reporters i.e. the Hyperty instance that created the Group Chat.\n * @return {Boolean} It returns as a Promise true if successfully closed or false otherwise.\n */\n\n }, {\n key: 'close',\n value: function close() {\n var del = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n // TODO: the dataObjectReporter.delete should be a Promise;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.controllerMode === 'reporter') {\n // reporter\n // _this._invitationsHandler.cleanInvitations(_this.dataObjectReporter).then(() => {\n if (!del) {\n _this._manager.communicationObject.status = 'closed';\n resolve(true);\n } else {\n\n try {\n\n delete _this._manager._reportersControllers[_this.dataObjectReporter.url];\n _this.dataObjectReporter.delete();\n resolve(true);\n if (_this._onClose) _this._onClose({\n code: 200,\n desc: 'deleted',\n url: _this.dataObjectReporter.url\n });\n } catch (e) {\n console.error(e);\n reject(false);\n }\n }\n\n // });\n } else {\n // observer\n if (del) {\n try {\n delete _this._manager._observersControllers[_this.dataObjectObserver.url];\n _this.dataObjectObserver.unsubscribe();\n resolve(true);\n } catch (e) {\n console.error(e);\n reject(false);\n }\n } else {\n // TODO: send message \n resolve(true);\n }\n }\n });\n }\n }, {\n key: 'url',\n get: function get() {\n return this.controllerMode === 'reporter' ? this.dataObjectReporter.url : this.dataObjectObserver.url;\n }\n }, {\n key: 'dataObjectReporter',\n set: function set(dataObjectReporter) {\n\n if (!dataObjectReporter) throw new Error('[ChatController] The data object reporter is necessary parameter ');\n var _this = this;\n\n _this.controllerMode = 'reporter';\n\n // Handler to process received files\n\n // dataObjectReporter.onResponse(function(event) {\n // console.log('[DataObjectReporter - onResponse]', event);\n // if (_this._onInvitationResponse) {\n // _this._onInvitationResponse(event);\n // }\n //\n // });\n\n dataObjectReporter.onSubscription(function (event) {\n\n switch (event.type) {\n case 'subscribe':\n _this._onSubscribe(event);break;\n case 'unsubscribe':\n _this._onUnsubscribe(event);break;\n }\n });\n\n _this._setOnAddChildListener(dataObjectReporter);\n\n dataObjectReporter.onRead(function (event) {\n event.accept();\n });\n\n dataObjectReporter.onExecute(function (event) {\n switch (event.method) {\n case 'addUser':\n _this.addUser(event.params[0]).then(function () {\n event.accept();\n }).catch(function (reason) {\n console.error('Reason:', reason);\n event.reject(reason);\n });\n break;\n case 'removeUser':\n _this.removeUser(event.params).then(function () {\n event.accept();\n }).catch(function (reason) {\n console.error('Reason:', reason);\n event.reject(reason);\n });\n break;\n default:\n event.reject('[ChatController.onExecute] Chat method execution not accepted by Reporter');\n break;\n }\n });\n\n _this._dataObjectReporter = dataObjectReporter;\n },\n get: function get() {\n var _this = this;\n return _this._dataObjectReporter;\n }\n }, {\n key: 'messages',\n get: function get() {\n\n return this.controllerMode === 'reporter' ? this._dataObjectReporter._childrenObjects : this._dataObjectObserver._childrenObjects;\n }\n }, {\n key: 'dataObjectObserver',\n set: function set(dataObjectObserver) {\n var _this = this;\n\n _this.controllerMode = 'observer';\n\n _this._dataObjectObserver = dataObjectObserver;\n\n dataObjectObserver.onChange('*', function (event) {\n console.info('[ChatManager.ChatController]Observer - onChange', event);\n\n if (event.field.includes('participants')) {\n switch (event.cType) {\n case 'add':\n if (_this._onUserAdded) _this._onUserAdded(event);\n break;\n\n case 'remove':\n if (_this._onUserRemoved) _this._onUserRemoved(event);\n break;\n }\n }\n\n if (_this._onChange) _this._onChange(event);\n });\n\n _this._setOnAddChildListener(dataObjectObserver);\n\n // let childrens = dataObjectObserver.childrens;\n // Object.keys(childrens).forEach((child) => {\n // if (_this._onMessage) _this._onMessage({\n // childId: child,\n // identity: childrens[child].identity,\n // value: childrens[child].data\n // });\n // })\n },\n get: function get() {\n var _this = this;\n return _this._dataObjectObserver;\n }\n }, {\n key: 'dataObject',\n get: function get() {\n return this.controllerMode === 'reporter' ? this.dataObjectReporter : this.dataObjectObserver;\n }\n }, {\n key: 'closeEvent',\n set: function set(event) {\n var _this = this;\n _this._closeEvent = event;\n\n if (_this._onClose) _this._onClose(event);\n },\n get: function get() {\n var _this = this;\n return _this._closeEvent;\n }\n }]);\n return Chat;\n}();\n\nexports.default = Chat;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9DaGF0LmpzPzUzMjEiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFj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Nsb3NlZCBvciBmYWxzZSBvdGhlcndpc2UuXG4gICAqL1xuICBjbG9zZShkZWwgPSB0cnVlKSB7XG4gICAgLy8gVE9ETzogdGhlIGRhdGFPYmplY3RSZXBvcnRlci5kZWxldGUgc2hvdWxkIGJlIGEgUHJvbWlzZTtcblxuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuICAgICAgXG4gICAgICBpZiAoX3RoaXMuY29udHJvbGxlck1vZGUgPT09ICdyZXBvcnRlcicpIHtcbiAgICAgICAgLy8gcmVwb3J0ZXJcbi8vICAgICAgICBfdGhpcy5faW52aXRhdGlvbnNIYW5kbGVyLmNsZWFuSW52aXRhdGlvbnMoX3RoaXMuZGF0YU9iamVjdFJlcG9ydGVyKS50aGVuKCgpID0+IHtcbiAgICAgICAgICBpZiAoIWRlbCkge1xuICAgICAgICAgICAgX3RoaXMuX21hbmFnZXIuY29tbXVuaWNhdGlvbk9iamVjdC5zdGF0dXMgPSAnY2xvc2VkJztcbiAgICAgICAgICAgICAgcmVzb2x2ZSh0cnVlKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIGVsc2V7XG5cbiAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICBkZWxldGUgX3RoaXMuX21hbmFnZXIuX3JlcG9ydGVyc0NvbnRyb2xsZXJzW190aGlzLmRhdGFPYmplY3RSZXBvcnRlci51cmxdO1xuICAgICAgICAgICAgICAgIF90aGlzLmRhdGFPYmplY3RSZXBvcnRlci5kZWxldGUoKTtcbiAgICAgICAgICAgICAgICByZXNvbHZlKHRydWUpO1xuICAgICAgICAgICAgICAgIGlmIChfdGhpcy5fb25DbG9zZSkgX3RoaXMuX29uQ2xvc2Uoe1xuICAgICAgICAgICAgICAgICAgY29kZTogMjAwLFxuICAgICAgICAgICAgICAgICAgZGVz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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFQQTtBQVNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQWdCQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQThkQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///213\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Bus');\n\n/**\n* @author micaelpedrosa@gmail.com\n* Minimal interface and implementation to send and receive messages. It can be reused in many type of components.\n* Components that need a message system should receive this class as a dependency or extend it.\n* Extensions should implement the following private methods: _onPostMessage and _registerExternalListener\n*/\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Log system\n\nvar Bus = function () {\n /* private\n _msgId: number;\n _subscriptions: \n _responseTimeOut: number\n _responseCallbacks: void>\n */\n\n function Bus() {\n (0, _classCallCheck3.default)(this, Bus);\n\n var _this = this;\n _this._msgId = 0;\n _this._subscriptions = {};\n\n _this._responseTimeOut = 15000; //default to 3s\n _this._responseCallbacks = {};\n\n _this._registerExternalListener();\n }\n\n /**\n * Register listener to receive message when \"msg.to === url\".\n * Special url \"*\" for default listener is accepted to intercept all messages.\n * @param {URL} url Address to intercept, tha is in the message \"to\"\n * @param {Listener} listener listener\n * @return {MsgListener} instance of MsgListener\n */\n\n\n (0, _createClass3.default)(Bus, [{\n key: 'addListener',\n value: function addListener(url, listener) {\n var _this = this;\n\n var item = new MsgListener(_this._subscriptions, url, listener);\n var itemList = _this._subscriptions[url];\n if (!itemList) {\n itemList = [];\n _this._subscriptions[url] = itemList;\n }\n\n itemList.push(item);\n return item;\n }\n\n /**\n * Manually add a response listener. Only one listener per message ID should exist.\n * ATENTION, there is no timeout for this listener.\n * The listener should be removed with a removeResponseListener, failing to do this will result in a unreleased memory problem.\n * @param {URL} url Origin address of the message sent, \"msg.from\".\n * @param {number} msgId Message ID that is returned from the postMessage.\n * @param {Function} responseListener Callback function for the response\n */\n\n }, {\n key: 'addResponseListener',\n value: function addResponseListener(url, msgId, responseListener) {\n this._responseCallbacks[url + msgId] = responseListener;\n }\n\n /**\n * Remove the response listener.\n * @param {URL} url Origin address of the message sent, \"msg.from\".\n * @param {number} msgId Message ID that is returned from the postMessage\n */\n\n }, {\n key: 'removeResponseListener',\n value: function removeResponseListener(url, msgId) {\n delete this._responseCallbacks[url + msgId];\n }\n\n /**\n * Remove all existent listeners for the URL\n * @param {URL} url Address registered\n */\n\n }, {\n key: 'removeAllListenersOf',\n value: function removeAllListenersOf(url) {\n delete this._subscriptions[url];\n }\n\n /**\n * Helper method to bind listeners (in both directions) into other MiniBus target.\n * @param {URL} outUrl Outbound URL, register listener for url in direction \"this -> target\"\n * @param {URL} inUrl Inbound URL, register listener for url in direction \"target -> this\"\n * @param {MiniBus} target The other target MiniBus\n * @return {Bound} an object that contains the properties [thisListener, targetListener] and the unbind method.\n */\n\n }, {\n key: 'bind',\n value: function bind(outUrl, inUrl, target) {\n var _this2 = this;\n\n var _this = this;\n\n var thisListn = _this.addListener(outUrl, function (msg) {\n target.postMessage(msg);\n });\n\n var targetListn = target.addListener(inUrl, function (msg) {\n _this.postMessage(msg);\n });\n\n return {\n thisListener: thisListn,\n targetListener: targetListn,\n unbind: function unbind() {\n _this2.thisListener.remove();\n _this2.targetListener.remove();\n }\n };\n }\n\n //publish on default listeners\n\n }, {\n key: '_publishOnDefault',\n value: function _publishOnDefault(msg) {\n //is there any \"*\" (default) listeners?\n var itemList = this._subscriptions['*'];\n if (itemList) {\n this._publishOn(itemList, msg);\n }\n }\n\n //publish on a subscription list.\n\n }, {\n key: '_publishOn',\n value: function _publishOn(itemList, msg) {\n itemList.forEach(function (sub) {\n sub._callback(msg);\n });\n }\n }, {\n key: '_responseCallback',\n value: function _responseCallback(inMsg, responseCallback) {\n var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _this = this;\n\n //automatic management of response handlers\n if (responseCallback) {\n var responseId = inMsg.from + inMsg.id;\n _this._responseCallbacks[responseId] = responseCallback;\n\n if (timeout) {\n setTimeout(function () {\n var responseFun = _this._responseCallbacks[responseId];\n delete _this._responseCallbacks[responseId];\n\n if (responseFun) {\n var errorMsg = {\n id: inMsg.id, type: 'response',\n body: { code: 408, desc: 'Response timeout!', value: inMsg }\n };\n\n responseFun(errorMsg);\n }\n }, _this._responseTimeOut);\n }\n }\n }\n\n //TODO: provisional responses should reset timeout\n\n }, {\n key: '_onResponse',\n value: function _onResponse(msg) {\n var _this = this;\n\n if (msg.type === 'response') {\n var responseId = msg.to + msg.id;\n var responseFun = _this._responseCallbacks[responseId];\n\n if (msg.body.code >= 200) {\n //if it's a provisional response, don't delete response listener\n delete _this._responseCallbacks[responseId];\n }\n\n if (responseFun) {\n responseFun(msg);\n return true;\n }\n }\n\n return false;\n }\n\n //receive messages from external interface\n\n }, {\n key: '_onMessage',\n value: function _onMessage(msg) {\n var _this = this;\n\n if (!_this._onResponse(msg)) {\n var itemList = _this._subscriptions[msg.to];\n if (itemList) {\n _this._publishOn(itemList, msg);\n } else {\n _this._publishOnDefault(msg);\n }\n }\n }\n }, {\n key: '_genId',\n value: function _genId(inMsg) {\n //TODO: how do we manage message ID's? Should it be a global runtime counter, or per URL address?\n //Global counter will not work, because there will be multiple MiniBus instances!\n //Per URL, can be a lot of data to maintain!\n //Maybe a counter per MiniBus instance. This is the assumed solution for now.\n if (!inMsg.id || inMsg.id === 0) {\n this._msgId++;\n inMsg.id = this._msgId;\n }\n }\n\n /**\n * Send messages to local listeners, or if not exists to external listeners.\n * It's has an optional mechanism for automatic management of response handlers.\n * The response handler will be unregistered after receiving the response, or after response timeout (default to 3s).\n * @param {Message} msg Message to send. Message ID is automatically added to the message.\n * @param {Function} responseCallback Optional parameter, if the developer what's automatic response management.\n * @return {number} Returns the message ID, in case it should be needed for manual management of the response handler.\n */\n\n }, {\n key: 'postMessage',\n value: function postMessage(inMsg, responseCallback) {}\n\n /**\n * Function to post messages with a number of retries in case timeouts occur.\n * @param {Message} msg Message to send. Message ID is automatically added to the message.\n * @param {Function} responseCallback Optional parameter, if the developer what's automatic response management.\n * @param {integer} retries number of retries when timeouts occur\n * @return {boolean} message delivery result;\n */\n\n }, {\n key: 'postMessageWithRetries',\n value: function postMessageWithRetries(msg, retries, callback) {\n\n var _this = this;\n\n var retry = 0;\n //let timeout = true;\n\n var sendMsg = function sendMsg() {\n\n return new _promise2.default(function (resolve, reject) {\n _this.postMessage(msg, function (reply) {\n if (reply.body.code === 408 || reply.body.code === 500) reject();else {\n log.info('[Bus.postMessageWithRetries] msg delivered: ', msg);\n callback(reply);\n resolve();\n }\n });\n });\n };\n\n var tryAgain = function tryAgain() {\n sendMsg().then(function () {\n //timeout = false;\n return;\n }, function () {\n log.warn('[Bus.postMessageWithRetries] Message Bounced (retry ' + retry + '): \\'', msg);\n if (retry++ < retries) {\n tryAgain();\n // setTimeout(() => { tryAgain(); }, 1000);\n } else {\n var error = '[Error] Message Bounced (delivery attempts ' + retries + '): \\'';\n throw new Error(error + msg);\n }\n });\n };\n tryAgain();\n }\n\n /**\n * Not public available, used by the class extension implementation, to process messages from the public \"postMessage\" without a registered listener.\n * Used to send the message to an external interface, like a WebWorker, IFrame, etc.\n * @param {Message.Message} msg Message\n */\n\n }, {\n key: '_onPostMessage',\n value: function _onPostMessage(msg) {} /*implementation will send message to external system*/\n\n /**\n * Not public available, used by the class extension implementation, to process all messages that enter the MiniBus from an external interface, like a WebWorker, IFrame, etc.\n * This method is called one time in the constructor to register external listeners.\n * The implementation will probably call the \"_onMessage\" method to publish in the local listeners.\n * DO NOT call \"postMessage\", there is a danger that the message enters in a cycle!\n */\n\n }, {\n key: '_registerExternalListener',\n value: function _registerExternalListener() {/*implementation will register external listener and call \"this._onMessage(msg)\" */}\n }]);\n return Bus;\n}();\n\nvar MsgListener = function () {\n /* private\n _subscriptions: ;\n _url: string;\n _callback: (msg) => void;\n */\n\n function MsgListener(subscriptions, url, callback) {\n (0, _classCallCheck3.default)(this, MsgListener);\n\n var _this = this;\n\n _this._subscriptions = subscriptions;\n _this._url = url;\n _this._callback = callback;\n }\n\n (0, _createClass3.default)(MsgListener, [{\n key: 'remove',\n\n\n /**\n * Remove this listener from the Bus\n */\n value: function remove() {\n var _this = this;\n\n var subs = _this._subscriptions[_this._url];\n if (subs) {\n var index = subs.indexOf(_this);\n subs.splice(index, 1);\n\n //if there are no listeners, remove the subscription entirely.\n if (subs.length === 0) {\n delete _this._subscriptions[_this._url];\n }\n }\n }\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n }]);\n return MsgListener;\n}();\n\nexports.default = Bus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9idXMvQnVzLmpzPzZkMTciXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4qIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd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0FBQ0E7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7QUFRQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7QUFTQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBOzs7Ozs7Ozs7QUFNQTs7Ozs7QUFJQTtBQUNBOzs7Ozs7QUFNQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFHQTs7O0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBbEJBO0FBQUE7QUFBQTs7Ozs7QUFxQkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///214\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _RegistryDataModel2 = __webpack_require__(507);\n\nvar _RegistryDataModel3 = _interopRequireDefault(_RegistryDataModel2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author: Gil Dias (gil.dias@tecnico.ulisboa.pt)\n* HypertyInstance Data Model used to model instances of Hyperties running in devices and servers.\n*/\nvar HypertyInstance = function (_RegistryDataModel) {\n (0, _inherits3.default)(HypertyInstance, _RegistryDataModel);\n\n function HypertyInstance(id, url, descriptorURL, descriptor, hypertyURL, user, guid, runtime, context, p2pHandler, p2pRequester, dataSchemes, resources, startingTime, lastModified) {\n (0, _classCallCheck3.default)(this, HypertyInstance);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (HypertyInstance.__proto__ || (0, _getPrototypeOf2.default)(HypertyInstance)).call(this, id, url, descriptorURL, p2pRequester, startingTime, lastModified));\n\n var _this = _this2;\n _this._descriptor = descriptor;\n _this._hypertyURL = hypertyURL;\n _this._user = user;\n _this._guid = guid;\n _this._runtime = runtime;\n _this._context = context;\n _this._p2pHandler = p2pHandler;\n _this._dataSchemes = dataSchemes;\n _this._resources = resources;\n return _this2;\n }\n\n (0, _createClass3.default)(HypertyInstance, [{\n key: 'user',\n set: function set(identity) {\n var _this = this;\n _this.user = identity;\n },\n get: function get() {\n var _this = this;\n return _this._user;\n }\n }, {\n key: 'hypertyURL',\n get: function get() {\n var _this = this;\n return _this._hypertyURL;\n }\n }, {\n key: 'descriptor',\n get: function get() {\n var _this = this;\n return _this._descriptor;\n }\n }, {\n key: 'objectName',\n get: function get() {\n var _this = this;\n return _this._descriptor._objectName;\n }\n }, {\n key: 'p2pHandler',\n get: function get() {\n var _this = this;\n return _this._p2pHandler;\n }\n }, {\n key: 'dataSchemes',\n get: function get() {\n var _this = this;\n return _this._dataSchemes;\n }\n }, {\n key: 'resources',\n get: function get() {\n var _this = this;\n return _this._resources;\n }\n }, {\n key: 'runtimeURL',\n get: function get() {\n var _this = this;\n return _this._runtime;\n }\n }]);\n return HypertyInstance;\n}(_RegistryDataModel3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = HypertyInstance;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9IeXBlcnR5SW5zdGFuY2UuanM/Zjg1OSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAy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VudGltZTtcbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBIeXBlcnR5SW5zdGFuY2U7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3JlZ2lzdHJ5L0h5cGVydHlJbnN0YW5jZS5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFzQkE7QUFDQTs7Ozs7QUFDQTs7OztBQUlBOzs7QUFFQTtBQUFBO0FBQ0E7QUFEQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFYQTtBQVlBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUEzREE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQThEQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///215\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nexports.WatchingYou = undefined;\n\nvar _WatchingYou = __webpack_require__(510);\n\nvar _WatchingYou2 = _interopRequireDefault(_WatchingYou);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.WatchingYou = _WatchingYou2.default;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9VdGlscy5qcz9hMmM0Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBXYXRjaGluZ1lvdSBmcm9tICcuL3V0aWxzL1dhdGNoaW5nWW91JztcblxuZXhwb3J0IHsgV2F0Y2hpbmdZb3UgfTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvVXRpbHMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFBQTtBQUNBOzs7OztBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///216\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _isInteger = __webpack_require__(512);\n\nvar _isInteger2 = _interopRequireDefault(_isInteger);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Utils = __webpack_require__(216);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('IdentityModule'); // Log System\n\n/**\n* The Identity Data Model is used to model the reTHINK User entity. The Identity data model is handled by Identity Management functionality.\n*\n*/\nvar Identities = function () {\n function Identities(type, storageManager) {\n (0, _classCallCheck3.default)(this, Identities);\n\n var _this = this;\n\n _this._watchingYou = new _Utils.WatchingYou();\n\n _this._storageManager = storageManager;\n _this._guid;\n _this._type = type;\n _this._identities = {};\n _this._accessTokens = _this.watchingYou.watch('accessTokens', {}, true);\n }\n\n (0, _createClass3.default)(Identities, [{\n key: 'reset',\n value: function reset() {\n this._identities = {};\n console.log(this);\n this.currentIdentity = undefined;\n this.defaultIdentity = undefined;\n }\n }, {\n key: 'getIdentity',\n value: function getIdentity(identifier) {\n return (0, _assign2.default)({}, this._identities[identifier]);\n }\n }, {\n key: 'loadIdentities',\n value: function loadIdentities() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n\n _this._storageManager.get(null, null, 'identities').then(function (identities) {\n\n log.info('[Identities.Load Identities] identities: ', identities);\n\n if (identities) {\n _this._identities = identities;\n\n // let's set as default identity the one that expires later\n\n _this.identifiers.forEach(function (id) {\n var timeNow = (0, _utils.secondsSinceEpoch)();\n var identity = _this._identities[id];\n var expires = identity.expires;\n\n // if (!identity.hasOwnProperty('interworking')\n // || !identity.interworking) {\n _this.defaultIdentity = id;\n\n if (parseInt(expires) > timeNow) {\n _this.defaultIdentity.expires = parseInt(expires);\n _this.currentIdentity = id;\n }\n });\n }\n\n resolve();\n });\n });\n }\n }, {\n key: 'loadAccessTokens',\n value: function loadAccessTokens() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n\n _this._storageManager.get('accessTokens').then(function (accessTokens) {\n\n if (accessTokens) _this._accessTokens = accessTokens;\n resolve();\n });\n });\n }\n\n // to confirm if this function is required when the App constraints the identity selection\n\n }, {\n key: 'addIdentity',\n value: function addIdentity(identity) {\n var _this2 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (_this._isValid(identity)) {\n var id = identity.identifiers[0];\n (0, _assign2.default)(_this2._identities[id], identity);\n _this2._storeIdentity(identity).then(function () {\n _this2._identities[id].status = 'created';\n resolve();\n });\n } else {\n reject('[Identities.addIdentity] invalid IdAssertion');\n }\n });\n }\n }, {\n key: 'addAssertion',\n value: function addAssertion(assertion) {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (_this._isValid(assertion)) {\n assertion.userProfile.guid = _this._guid;\n var userUrl = assertion.userProfile.userURL;\n if (!_this.identities[userUrl]) _this._identities[userUrl] = assertion;else _this.identities[userUrl] = assertion;\n\n _this._store().then(function () {\n _this3._identities[userUrl].status = 'created';\n if (_this.defaultIdentity == false) {\n _this.defaultIdentity = userUrl;\n }\n resolve(assertion);\n });\n } else {\n reject('[Identities.addAssertion] invalid IdAssertion: ', assertion);\n }\n });\n }\n }, {\n key: 'removeIdentity',\n value: function removeIdentity(userUrl) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n delete _this.identities[userUrl];\n\n _this._store().then(function () {\n resolve();\n });\n });\n }\n }, {\n key: 'addAccessToken',\n value: function addAccessToken(accessToken) {\n var _this = this;\n log.info('[Identities.addAccessToken] ', accessToken);\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this._isValidAccessToken(accessToken)) {\n\n // let newAccessToken = deepClone(accessToken);\n\n _this._accessTokens[accessToken.domain] = accessToken;\n\n _this._storeAccessTokens().then(function () {\n _this._accessTokens[accessToken.domain].status = 'created';\n resolve(accessToken);\n });\n } else {\n reject('[Identities.addIdentity] invalid AccessToken: ', accessToken);\n }\n });\n }\n }, {\n key: 'setAccessTokenInProgress',\n value: function setAccessTokenInProgress(domain) {\n\n if (this._accessTokens[domain]) this._accessTokens[domain].status = 'in-progress';else this._accessTokens[domain] = { status: 'in-progress' };\n }\n }, {\n key: 'getAccessToken',\n value: function getAccessToken(domain, resources) {\n var accessToken = this._accessTokens[domain];\n\n if (!accessToken) {\n return undefined;\n } else if (resources.every(function (i) {\n return accessToken.resources.indexOf(i) != -1;\n })) {\n return this._accessTokens[domain];\n } else {\n return new Error('[Identities.getAccessToken] Not found for ', domain);\n }\n }\n }, {\n key: 'updateAssertion',\n value: function updateAssertion(assertion) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n var userUrl = assertion.userProfile.userURL;\n\n if (!_this.identities[userUrl]) {\n return reject('[Identities.updateAssertion] Identity not found for ', userUrl);\n } else {\n _this.identities[userUrl] = assertion;\n _this._store().then(function () {\n resolve();\n });\n }\n });\n }\n }, {\n key: 'updateAccessToken',\n value: function updateAccessToken(accessToken) {\n var _this = this;\n log.info('[Identities.updateAccessToken] ', accessToken);\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this._isValidAccessToken(accessToken)) {\n\n _this._accessTokens[accessToken.domain].expires = accessToken.expires;\n _this._accessTokens[accessToken.domain].accessToken = accessToken.accessToken;\n\n _this._storeAccessTokens().then(function () {\n _this._accessTokens[accessToken.domain].status = 'created';\n resolve(accessToken);\n });\n } else {\n reject('[Identities.updateAccessToken] invalid AccessToken: ', accessToken);\n }\n });\n }\n }, {\n key: 'addIdAssertion',\n value: function addIdAssertion(identifier, assertion, idp, scope) {\n var _this = this;\n\n var newIdAssertion = new IdAssertion(assertion, idp, scope);\n\n _this.idAssertionList.push(newIdAssertion);\n }\n\n //TODO: complete with more verifications. To be moved to Identity?\n\n }, {\n key: '_isValid',\n value: function _isValid(identity) {\n if (!identity.hasOwnProperty('assertion')) {\n return false;\n }\n\n var splitedAssertion = identity.assertion.split('.');\n var assertionParsed = void 0;\n\n //verify if the token contains the 3 components, or just the assertion\n try {\n if (splitedAssertion[1]) {\n assertionParsed = (0, _utils.decode)(splitedAssertion[1]);\n } else {\n assertionParsed = (0, _utils.decode)(identity.assertion);\n }\n } catch (err) {\n return false;\n }\n\n return true;\n }\n }, {\n key: '_isValidAccessToken',\n value: function _isValidAccessToken(accessToken) {\n\n if (!accessToken.hasOwnProperty('accessToken')) {\n return false;\n }\n\n if (!accessToken.hasOwnProperty('domain')) {\n return false;\n }\n\n if (!(accessToken.hasOwnProperty('resources') && Array.isArray(accessToken.resources))) {\n return false;\n }\n\n if (!(accessToken.hasOwnProperty('expires') && (0, _isInteger2.default)(accessToken.expires))) {\n return false;\n }\n\n if (!accessToken.hasOwnProperty('input')) {\n return false;\n }\n\n return true;\n }\n\n //TODO: add function to only set one new identity using the new indexed storage manager\n\n }, {\n key: '_store',\n value: function _store() {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var store = (0, _keys2.default)(_this4._identities).map(function (userURL) {\n return _this._storageManager.set(userURL, 0, _this4._identities[userURL], 'identities');\n });\n\n _promise2.default.all(store).then(function () {\n resolve();\n }).catch(function (err) {\n reject('On _sendReporterSessionKey from method storeIdentity error: ' + err);\n });\n });\n }\n }, {\n key: '_storeAccessTokens',\n value: function _storeAccessTokens() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var accessTokens = (0, _utils.deepClone)(_this._accessTokens);\n\n _this._storageManager.set('accessTokens', 0, accessTokens).then(function () {\n resolve();\n }).catch(function (err) {\n reject('On _sendReporterSessionKey from method storeIdentity error: ' + err);\n });\n });\n }\n }, {\n key: 'identities',\n get: function get() {\n return this._identities;\n }\n }, {\n key: 'accessTokens',\n get: function get() {\n return this._accessTokens;\n }\n }, {\n key: 'watchingYou',\n get: function get() {\n return this._watchingYou;\n }\n }, {\n key: 'guid',\n set: function set(guid) {\n this._guid = guid;\n },\n get: function get() {\n return this._guid;\n }\n }, {\n key: 'defaultIdentity',\n set: function set(identifier) {\n if (this.identities[identifier]) this._defaultIdentity = identifier;else throw new Error('[Identities.set defaultIdentity ] Error: identity does not exist here: ', identifier);\n },\n get: function get() {\n if (this._defaultIdentity) return (0, _assign2.default)({}, this.identities[this._defaultIdentity]);else return false;\n }\n }, {\n key: 'currentIdentity',\n set: function set(identifier) {\n if (this.identities[identifier]) this._currentIdentity = identifier;else throw '[Identities.set currentIdentity ] Error: identity does not exist here: ', identifier;\n },\n get: function get() {\n return (0, _assign2.default)({}, this.identities[this._currentIdentity]);\n }\n }, {\n key: 'identifiers',\n get: function get() {\n return (0, _keys2.default)(this._identities);\n }\n }]);\n return Identities;\n}();\n\n// move to Identity service framework?\n\nvar IdAssertion = function () {\n function IdAssertion(assertion, idp, userProfile) {\n (0, _classCallCheck3.default)(this, IdAssertion);\n\n var _this = this;\n\n _this._assertion = assertion;\n _this._idp = idp;\n _this._userProfile = userProfile;\n }\n\n (0, _createClass3.default)(IdAssertion, [{\n key: 'assertion',\n get: function get() {\n return this._assertion;\n }\n }, {\n key: 'idp',\n get: function get() {\n return this._idp;\n }\n }, {\n key: 'userProfile',\n get: function get() {\n return this._userProfile;\n }\n }]);\n return IdAssertion;\n}();\n\nvar IdValidation = function () {\n function IdValidation(identity, contents) {\n (0, _classCallCheck3.default)(this, IdValidation);\n\n var _this = this;\n _this.identity = identity;\n _this.contents = contents;\n }\n\n (0, _createClass3.default)(IdValidation, [{\n key: 'validates',\n value: function validates(identity, contents) {\n //TODO implement the logic\n\n }\n }]);\n return IdValidation;\n}();\n\nexports.default = Identities;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0aWVzLmpzPzM1NjQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdJZGVudGl0eU1vZHVsZScpO1xuXG5pbXBvcnQgeyBkZWNvZGUsIHNlY29uZHNTaW5jZUVwb2NoLCBkZWVwQ2xvbmUgfSBmcm9tICcuLi91dGlscy91dGlscy5qcyc7XG5pbXBvcnQgeyBXYXRjaGluZ1lvdSB9IGZyb20gJy4uL1V0aWxzJztcblxuXG4vKipcbiogVGhlIElkZW50aXR5IERhdGEgTW9kZWwgaXMgdXNlZC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UVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7OztBQTNUQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFFQTtBQU9BO0FBQ0E7QUFFQTs7O0FBUkE7QUFDQTtBQUVBO0FBT0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7Ozs7O0FBc1JBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7OztBQUlBO0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBR0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///217\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar AllowOverrides = function () {\n function AllowOverrides() {\n (0, _classCallCheck3.default)(this, AllowOverrides);\n }\n\n (0, _createClass3.default)(AllowOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorization decisions, prioritizes a positive one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return AllowOverrides;\n}();\n\nexports.default = AllowOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9BbGxvd092ZXJyaWRlcy5qcz80YzQ3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAx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7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///218\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar BlockOverrides = function () {\n function BlockOverrides() {\n (0, _classCallCheck3.default)(this, BlockOverrides);\n }\n\n (0, _createClass3.default)(BlockOverrides, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, prioritises a negative one.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n if (decisions.indexOf(false) !== -1) {\n return false;\n } else {\n if (decisions.indexOf(true) !== -1) {\n return true;\n } else {\n return 'Not Applicable';\n }\n }\n }\n }]);\n return BlockOverrides;\n}();\n\nexports.default = BlockOverrides;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9CbG9ja092ZXJyaWRlcy5qcz82MWM3Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmN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5lKGRlY2lzaW9ucykge1xuICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZihmYWxzZSkgIT09IC0xKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChkZWNpc2lvbnMuaW5kZXhPZih0cnVlKSAhPT0gLTEpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gJ05vdCBBcHBsaWNhYmxlJztcbiAgICAgIH1cbiAgICB9XG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBCbG9ja092ZXJyaWRlcztcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvcG9saWN5L2NvbWJpbmluZ0FsZ29yaXRobXMvQmxvY2tPdmVycmlkZXMuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFJQTs7Ozs7Ozs7O0FBRUE7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///219\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to combine the authorization decisions that result from rules evaluation.\n*/\nvar FirstApplicable = function () {\n function FirstApplicable() {\n (0, _classCallCheck3.default)(this, FirstApplicable);\n }\n\n (0, _createClass3.default)(FirstApplicable, [{\n key: 'combine',\n\n\n /**\n * Given an array of individual authorisation decisions, returns the first one different from 'Not Applicable', either positive or negative.\n * @param {boolean[]} decisions\n * @returns {boolean}\n */\n value: function combine(decisions) {\n for (var i in decisions) {\n if (decisions[i] !== 'Not Applicable') {\n return decisions[i];\n }\n }\n return 'Not Applicable';\n }\n }]);\n return FirstApplicable;\n}();\n\nexports.default = FirstApplicable;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29tYmluaW5nQWxnb3JpdGhtcy9GaXJzdEFwcGxpY2FibGUuanM/MzNkZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBOR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E7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///220\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.storage = storage;\nexports.createSyncDB = createSyncDB;\n\nvar _runtimeConfiguration = __webpack_require__(151);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar storages = {};\n\nfunction storage(runtimeFactory, runtimeStatusUpdate) {\n if (!runtimeFactory) throw new Error('The runtime factory is a needed parameter');\n\n (0, _keys2.default)(_runtimeConfiguration.runtimeConfiguration.storageSchemas).forEach(function (key) {\n\n if (!storages.hasOwnProperty(key)) {\n storages[key] = runtimeFactory.storageManager(key, _runtimeConfiguration.runtimeConfiguration.storageSchemas[key], runtimeStatusUpdate);\n }\n });\n\n return storages;\n}\n\nfunction createSyncDB(key, runtimeFactory, schema, runtimeStatusUpdate) {\n var url = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n if (!runtimeFactory) throw new Error('The runtime factory is a needed parameter');\n\n var remote = url ? url : _runtimeConfiguration.runtimeConfiguration.remoteStorage;\n\n return runtimeFactory.storageManager(key, schema, runtimeStatusUpdate, remote);\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL1N0b3JhZ2UuanM/ZTk0NyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBydW50aW1lQ29uZmlndXJhdGlvbiB9IGZyb20gJy4vcnVudGltZUNvbmZpZ3VyYXRpb24nO1xuXG5sZXQgc3RvcmFn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VEVSIC8vXG4vLyBzcmMvcnVudGltZS9TdG9yYWdlLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBSUE7QUFjQTtBQUNBO0FBbkJBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///221\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(534), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9hcnJheS9mcm9tLmpzPzczZjQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL2FycmF5L2Zyb21cIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvYXJyYXkvZnJvbS5qc1xuLy8gbW9kdWxlIGlkID0gMjIyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///222\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(541), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvdmFsdWVzLmpzPzgxMTEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC92YWx1ZXNcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L3ZhbHVlcy5qc1xuLy8gbW9kdWxlIGlkID0gMjIzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///223\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('SynSubscription'); // Log System\n\nvar Subscription = function () {\n function Subscription(bus, owner, url, isReporter) {\n (0, _classCallCheck3.default)(this, Subscription);\n\n var _this = this;\n var childBaseURL = url + '/children/';\n var changeURL = url + '/changes';\n\n //process delete message\n _this._deleteListener = bus.addListener(changeURL, function (msg) {\n if (msg.type === 'delete') {\n log.log('Subscription-DELETE: ', msg);\n\n //FLOW-OUT: message sent to all subscribers\n var deleteMessageToHyperty = {\n type: 'delete', from: msg.from, to: owner,\n body: { identity: msg.body.identity, resource: url }\n };\n\n //send delete to hyperty\n bus.postMessage(deleteMessageToHyperty, function (reply) {\n log.log('Subscription-DELETE-REPLY: ', reply);\n if (reply.body.code === 200) {\n _this._releaseListeners();\n }\n });\n }\n });\n\n //add change publish address or forward\n if (isReporter) {\n _this._changeListener = bus.addPublish(changeURL);\n } else {\n _this._changeListener = bus.addForward(changeURL, owner);\n }\n\n _this._childrenListeners = [];\n // log.log('[Subscription] - childID', childrens);\n // childrens.forEach((child) => {\n // let childId = childBaseURL + child;\n\n // log.log('[Subscription] - childID', childBaseURL);\n\n //add children publish address\n var childrenForward = bus.addPublish(childBaseURL);\n _this._childrenListeners.push(childrenForward);\n\n //add self forward if an observer\n if (!isReporter) {\n var selfForward = bus.addForward(childBaseURL, owner);\n _this._childrenListeners.push(selfForward);\n }\n // });\n }\n\n (0, _createClass3.default)(Subscription, [{\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._deleteListener.remove();\n\n _this._changeListener.remove();\n\n _this._childrenListeners.forEach(function (forward) {\n forward.remove();\n });\n }\n }]);\n return Subscription;\n}();\n\nexports.default = Subscription;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1N1YnNjcmlwdGlvbi5qcz8yZTg1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ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BQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///224\n")},function(e,n,t){t(226),e.exports=t(428)},function(module,exports,__webpack_require__){"use strict";eval('/* WEBPACK VAR INJECTION */(function(global) {\n\n__webpack_require__(227);\n\n__webpack_require__(424);\n\n__webpack_require__(425);\n\nif (global._babelPolyfill) {\n throw new Error("only one instance of babel-polyfill is allowed");\n}\nglobal._babelPolyfill = true;\n\nvar DEFINE_PROPERTY = "defineProperty";\nfunction define(O, key, value) {\n O[key] || Object[DEFINE_PROPERTY](O, key, {\n writable: true,\n configurable: true,\n value: value\n });\n}\n\ndefine(String.prototype, "padLeft", "".padStart);\ndefine(String.prototype, "padRight", "".padEnd);\n\n"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {\n [][key] && define(Array, key, Function.call.bind([][key]));\n});\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(154)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXBvbHlmaWxsL2xpYi9pbmRleC5qcz84ZjU4Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5yZXF1aXJlKFwiY29yZS1qcy9zaGltXCIpO1xuXG5yZXF1aXJlKFwicmVnZW5lcmF0b3ItcnVudGltZS9ydW50aW1lXCIpO1xuXG5yZXF1aXJlKFwiY29yZS1qcy9mbi9yZWdleHAvZXNjYXBlXCIpO1xuXG5pZiAoZ2xvYmFsL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ZpbGwvbGliL2luZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSAyMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///226\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(228);\n__webpack_require__(230);\n__webpack_require__(231);\n__webpack_require__(232);\n__webpack_require__(233);\n__webpack_require__(234);\n__webpack_require__(235);\n__webpack_require__(236);\n__webpack_require__(237);\n__webpack_require__(238);\n__webpack_require__(239);\n__webpack_require__(240);\n__webpack_require__(241);\n__webpack_require__(242);\n__webpack_require__(243);\n__webpack_require__(244);\n__webpack_require__(246);\n__webpack_require__(247);\n__webpack_require__(248);\n__webpack_require__(249);\n__webpack_require__(250);\n__webpack_require__(251);\n__webpack_require__(252);\n__webpack_require__(253);\n__webpack_require__(254);\n__webpack_require__(255);\n__webpack_require__(256);\n__webpack_require__(257);\n__webpack_require__(258);\n__webpack_require__(259);\n__webpack_require__(260);\n__webpack_require__(261);\n__webpack_require__(262);\n__webpack_require__(263);\n__webpack_require__(264);\n__webpack_require__(265);\n__webpack_require__(266);\n__webpack_require__(267);\n__webpack_require__(268);\n__webpack_require__(269);\n__webpack_require__(270);\n__webpack_require__(271);\n__webpack_require__(272);\n__webpack_require__(273);\n__webpack_require__(274);\n__webpack_require__(275);\n__webpack_require__(276);\n__webpack_require__(277);\n__webpack_require__(278);\n__webpack_require__(279);\n__webpack_require__(280);\n__webpack_require__(281);\n__webpack_require__(282);\n__webpack_require__(283);\n__webpack_require__(284);\n__webpack_require__(285);\n__webpack_require__(286);\n__webpack_require__(287);\n__webpack_require__(288);\n__webpack_require__(289);\n__webpack_require__(290);\n__webpack_require__(291);\n__webpack_require__(292);\n__webpack_require__(293);\n__webpack_require__(294);\n__webpack_require__(295);\n__webpack_require__(296);\n__webpack_require__(297);\n__webpack_require__(298);\n__webpack_require__(299);\n__webpack_require__(300);\n__webpack_require__(301);\n__webpack_require__(302);\n__webpack_require__(303);\n__webpack_require__(304);\n__webpack_require__(305);\n__webpack_require__(306);\n__webpack_require__(308);\n__webpack_require__(309);\n__webpack_require__(311);\n__webpack_require__(312);\n__webpack_require__(313);\n__webpack_require__(314);\n__webpack_require__(315);\n__webpack_require__(316);\n__webpack_require__(317);\n__webpack_require__(319);\n__webpack_require__(320);\n__webpack_require__(321);\n__webpack_require__(322);\n__webpack_require__(323);\n__webpack_require__(324);\n__webpack_require__(325);\n__webpack_require__(326);\n__webpack_require__(327);\n__webpack_require__(328);\n__webpack_require__(329);\n__webpack_require__(330);\n__webpack_require__(331);\n__webpack_require__(127);\n__webpack_require__(332);\n__webpack_require__(333);\n__webpack_require__(173);\n__webpack_require__(334);\n__webpack_require__(335);\n__webpack_require__(336);\n__webpack_require__(337);\n__webpack_require__(338);\n__webpack_require__(176);\n__webpack_require__(178);\n__webpack_require__(179);\n__webpack_require__(339);\n__webpack_require__(340);\n__webpack_require__(341);\n__webpack_require__(342);\n__webpack_require__(343);\n__webpack_require__(344);\n__webpack_require__(345);\n__webpack_require__(346);\n__webpack_require__(347);\n__webpack_require__(348);\n__webpack_require__(349);\n__webpack_require__(350);\n__webpack_require__(351);\n__webpack_require__(352);\n__webpack_require__(353);\n__webpack_require__(354);\n__webpack_require__(355);\n__webpack_require__(356);\n__webpack_require__(357);\n__webpack_require__(358);\n__webpack_require__(359);\n__webpack_require__(360);\n__webpack_require__(361);\n__webpack_require__(362);\n__webpack_require__(363);\n__webpack_require__(364);\n__webpack_require__(365);\n__webpack_require__(366);\n__webpack_require__(367);\n__webpack_require__(368);\n__webpack_require__(369);\n__webpack_require__(370);\n__webpack_require__(371);\n__webpack_require__(372);\n__webpack_require__(373);\n__webpack_require__(374);\n__webpack_require__(375);\n__webpack_require__(376);\n__webpack_require__(377);\n__webpack_require__(378);\n__webpack_require__(379);\n__webpack_require__(380);\n__webpack_require__(381);\n__webpack_require__(382);\n__webpack_require__(383);\n__webpack_require__(384);\n__webpack_require__(385);\n__webpack_require__(386);\n__webpack_require__(387);\n__webpack_require__(388);\n__webpack_require__(389);\n__webpack_require__(390);\n__webpack_require__(391);\n__webpack_require__(392);\n__webpack_require__(393);\n__webpack_require__(394);\n__webpack_require__(395);\n__webpack_require__(396);\n__webpack_require__(397);\n__webpack_require__(398);\n__webpack_require__(399);\n__webpack_require__(400);\n__webpack_require__(401);\n__webpack_require__(402);\n__webpack_require__(403);\n__webpack_require__(404);\n__webpack_require__(405);\n__webpack_require__(406);\n__webpack_require__(407);\n__webpack_require__(408);\n__webpack_require__(409);\n__webpack_require__(410);\n__webpack_require__(411);\n__webpack_require__(412);\n__webpack_require__(413);\n__webpack_require__(414);\n__webpack_require__(415);\n__webpack_require__(416);\n__webpack_require__(417);\n__webpack_require__(418);\n__webpack_require__(419);\n__webpack_require__(420);\n__webpack_require__(421);\n__webpack_require__(422);\n__webpack_require__(423);\nmodule.exports = __webpack_require__(32);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvc2hpbS5qcz9lMGNkIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vbW9kdWxlcy9lczYuc3ltYm9sJyk7XG5yZXF1aXJlKCcuL21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUnKTtcbnJlcXVpcmUoJy4vbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eScpO1xucmVx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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///227\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(7);\nvar has = __webpack_require__(27);\nvar DESCRIPTORS = __webpack_require__(12);\nvar $export = __webpack_require__(0);\nvar redefine = __webpack_require__(24);\nvar META = __webpack_require__(47).KEY;\nvar $fails = __webpack_require__(8);\nvar shared = __webpack_require__(83);\nvar setToStringTag = __webpack_require__(64);\nvar uid = __webpack_require__(53);\nvar wks = __webpack_require__(10);\nvar wksExt = __webpack_require__(156);\nvar wksDefine = __webpack_require__(107);\nvar enumKeys = __webpack_require__(229);\nvar isArray = __webpack_require__(86);\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar toIObject = __webpack_require__(28);\nvar toPrimitive = __webpack_require__(36);\nvar createDesc = __webpack_require__(52);\nvar _create = __webpack_require__(56);\nvar gOPNExt = __webpack_require__(159);\nvar $GOPD = __webpack_require__(29);\nvar $DP = __webpack_require__(13);\nvar $keys = __webpack_require__(54);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(57).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(74).f = $propertyIsEnumerable;\n __webpack_require__(85).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(48)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(23)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3ltYm9sLmpzPzAzNDkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gRUNNQVNjcmlwdCA2IHN5bWJvbHMgc2hpbVxudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIERFU0NSSVBUT1JTID0gcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgcmVkZWZpbmUgPSByZXF1aXJlKCcuL19yZWRlZmluZScpO1xudmFyIE1FVEEgPSByZXF1aXJlKCcuL19tZXRhJykuS0VZO1xudmFyICRmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG52YXIgc2hhcmVkID0gcmVxdWlyZSgnLi9fc2hhcmVkJyk7XG52YXIgc2V0VG9TdHJpbmdUYWcgPSByZXF1aXJl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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///228\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(54);\nvar gOPS = __webpack_require__(85);\nvar pIE = __webpack_require__(74);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZW51bS1rZXlzLmpzPzBiZTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gYWxsIGVudW1lcmFibGUgb2JqZWN0IGtleXMsIGluY2x1ZGVzIHN5bWJvbHNcbnZhciBnZXRLZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcbnZhciBnT1BTID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcHMnKTtcbnZhciBwSUUgPSByZXF1aXJlKCcuL19vYmplY3QtcGllJyk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpdCkge1xuICB2YXIgcmVzdWx0ID0gZ2V0S2V5cyhpdCk7XG4gIHZhciBnZXRTeW1ib2xzID0gZ09QUy5mO1xuICBpZiAoZ2V0U3ltYm9scykge1xuICAgIHZhciBzeW1ib2xzID0gZ2V0U3ltYm9scyhpdCk7XG4gICAgdmFyIGlzRW51bSA9IHBJRS5mO1xuICAgIHZhciBpID0gMDtcbiAgICB2YXIga2V5O1xuICAgIHdoaWxlIChzeW1ib2xzLmxlbmd0aCA+IGkpIGlmIChpc0VudW0uY2FsbChpdCwga2V5ID0gc3ltYm9sc1tpKytdKSkgcmVzdWx0LnB1c2goa2V5KTtcbiAgfSByZXR1cm4gcmVzdWx0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZW51bS1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMjlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///229\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(56) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZS5qcz84YmFmIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4vLyAxOS4xLjIuMiAvIDE1LjIuMy41IE9iamVjdC5jcmVhdGUoTyBbLCBQcm9wZXJ0aWVzXSlcbiRleHBvcnQoJGV4cG9ydC5TLCAnT2JqZWN0JywgeyBjcmVhdGU6IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///230\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(12), 'Object', { defineProperty: __webpack_require__(13).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eS5qcz80MzMyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4vLyAxOS4xLjIuNCAvIDE1LjIuMy42IE9iamVjdC5kZWZpbmVQcm9wZXJ0eShPLCBQLCBBdHRyaWJ1dGVzKVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAhcmVxdWlyZSgnLi9fZGVzY3JpcHRvcnMnKSwgJ09iamVjdCcsIHsgZGVmaW5lUHJvcGVydHk6IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmYgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5kZWZpbmUtcHJvcGVydHkuanNcbi8vIG1vZHVsZSBpZCA9IDIzMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///231\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)\n$export($export.S + $export.F * !__webpack_require__(12), 'Object', { defineProperties: __webpack_require__(158) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzPzFlMTkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4zIC8gMTUuMi4zLjcgT2JqZWN0LmRlZmluZVByb3BlcnRpZXMoTywgUHJvcGVydGllcylcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2Rlc2NyaXB0b3JzJyksICdPYmplY3QnLCB7IGRlZmluZVByb3BlcnRpZXM6IHJlcXVpcmUoJy4vX29iamVjdC1kcHMnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0aWVzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///232\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(28);\nvar $getOwnPropertyDescriptor = __webpack_require__(29).f;\n\n__webpack_require__(39)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qcz8wYmVlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi42IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoTywgUClcbnZhciB0b0lPYmplY3QgPSByZXF1aXJlKCcuL190by1pb2JqZWN0Jyk7XG52YXIgJGdldE93blByb3BlcnR5RGVzY3JpcHRvciA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJykuZjtcblxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3InLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSkge1xuICAgIHJldHVybiAkZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKHRvSU9iamVjdChpdCksIGtleSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gMjMzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///233\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(19);\nvar $getPrototypeOf = __webpack_require__(30);\n\n__webpack_require__(39)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1wcm90b3R5cGUtb2YuanM/NWI4NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuOSBPYmplY3QuZ2V0UHJvdG90eXBlT2YoTylcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyICRnZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcblxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdnZXRQcm90b3R5cGVPZicsIGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGdldFByb3RvdHlwZU9mKGl0KSB7XG4gICAgcmV0dXJuICRnZXRQcm90b3R5cGVPZih0b09iamVjdChpdCkpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///234\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(19);\nvar $keys = __webpack_require__(54);\n\n__webpack_require__(39)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmtleXMuanM/YjQ5YyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMTQgT2JqZWN0LmtleXMoTylcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyICRrZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcblxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdrZXlzJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gZnVuY3Rpb24ga2V5cyhpdCkge1xuICAgIHJldHVybiAka2V5cyh0b09iamVjdChpdCkpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyMzVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///235\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.7 Object.getOwnPropertyNames(O)\n__webpack_require__(39)('getOwnPropertyNames', function () {\n return __webpack_require__(159).f;\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktbmFtZXMuanM/NzgyZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuNyBPYmplY3QuZ2V0T3duUHJvcGVydHlOYW1lcyhPKVxucmVxdWlyZSgnLi9fb2JqZWN0LXNhcCcpKCdnZXRPd25Qcm9wZXJ0eU5hbWVzJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcG4tZXh0JykuZjtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1uYW1lcy5qc1xuLy8gbW9kdWxlIGlkID0gMjM2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///236\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.5 Object.freeze(O)\nvar isObject = __webpack_require__(9);\nvar meta = __webpack_require__(47).onFreeze;\n\n__webpack_require__(39)('freeze', function ($freeze) {\n return function freeze(it) {\n return $freeze && isObject(it) ? $freeze(meta(it)) : it;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmZyZWV6ZS5qcz81NTM5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi41IE9iamVjdC5mcmVlemUoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG1ldGEgPSByZXF1aXJlKCcuL19tZXRhJykub25GcmVlemU7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnZnJlZXplJywgZnVuY3Rpb24gKCRmcmVlemUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGZyZWV6ZShpdCkge1xuICAgIHJldHVybiAkZnJlZXplICYmIGlzT2JqZWN0KGl0KSA/ICRmcmVlemUobWV0YShpdCkpIDogaXQ7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmZyZWV6ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjM3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///237\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.17 Object.seal(O)\nvar isObject = __webpack_require__(9);\nvar meta = __webpack_require__(47).onFreeze;\n\n__webpack_require__(39)('seal', function ($seal) {\n return function seal(it) {\n return $seal && isObject(it) ? $seal(meta(it)) : it;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnNlYWwuanM/NWJmMiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMTcgT2JqZWN0LnNlYWwoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG1ldGEgPSByZXF1aXJlKCcuL19tZXRhJykub25GcmVlemU7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnc2VhbCcsIGZ1bmN0aW9uICgkc2VhbCkge1xuICByZXR1cm4gZnVuY3Rpb24gc2VhbChpdCkge1xuICAgIHJldHVybiAkc2VhbCAmJiBpc09iamVjdChpdCkgPyAkc2VhbChtZXRhKGl0KSkgOiBpdDtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3Quc2VhbC5qc1xuLy8gbW9kdWxlIGlkID0gMjM4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///238\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.15 Object.preventExtensions(O)\nvar isObject = __webpack_require__(9);\nvar meta = __webpack_require__(47).onFreeze;\n\n__webpack_require__(39)('preventExtensions', function ($preventExtensions) {\n return function preventExtensions(it) {\n return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnByZXZlbnQtZXh0ZW5zaW9ucy5qcz82Mzk3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNSBPYmplY3QucHJldmVudEV4dGVuc2lvbnMoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIG1ldGEgPSByZXF1aXJlKCcuL19tZXRhJykub25GcmVlemU7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgncHJldmVudEV4dGVuc2lvbnMnLCBmdW5jdGlvbiAoJHByZXZlbnRFeHRlbnNpb25zKSB7XG4gIHJldHVybiBmdW5jdGlvbiBwcmV2ZW50RXh0ZW5zaW9ucyhpdCkge1xuICAgIHJldHVybiAkcHJldmVudEV4dGVuc2lvbnMgJiYgaXNPYmplY3QoaXQpID8gJHByZXZlbnRFeHRlbnNpb25zKG1ldGEoaXQpKSA6IGl0O1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5wcmV2ZW50LWV4dGVuc2lvbnMuanNcbi8vIG1vZHVsZSBpZCA9IDIzOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///239\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.12 Object.isFrozen(O)\nvar isObject = __webpack_require__(9);\n\n__webpack_require__(39)('isFrozen', function ($isFrozen) {\n return function isFrozen(it) {\n return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLWZyb3plbi5qcz81YTkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xMiBPYmplY3QuaXNGcm96ZW4oTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2lzRnJvemVuJywgZnVuY3Rpb24gKCRpc0Zyb3plbikge1xuICByZXR1cm4gZnVuY3Rpb24gaXNGcm96ZW4oaXQpIHtcbiAgICByZXR1cm4gaXNPYmplY3QoaXQpID8gJGlzRnJvemVuID8gJGlzRnJvemVuKGl0KSA6IGZhbHNlIDogdHJ1ZTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3QuaXMtZnJvemVuLmpzXG4vLyBtb2R1bGUgaWQgPSAyNDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///240\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.13 Object.isSealed(O)\nvar isObject = __webpack_require__(9);\n\n__webpack_require__(39)('isSealed', function ($isSealed) {\n return function isSealed(it) {\n return isObject(it) ? $isSealed ? $isSealed(it) : false : true;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLXNlYWxlZC5qcz9mYjI4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xMyBPYmplY3QuaXNTZWFsZWQoTylcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2lzU2VhbGVkJywgZnVuY3Rpb24gKCRpc1NlYWxlZCkge1xuICByZXR1cm4gZnVuY3Rpb24gaXNTZWFsZWQoaXQpIHtcbiAgICByZXR1cm4gaXNPYmplY3QoaXQpID8gJGlzU2VhbGVkID8gJGlzU2VhbGVkKGl0KSA6IGZhbHNlIDogdHJ1ZTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3QuaXMtc2VhbGVkLmpzXG4vLyBtb2R1bGUgaWQgPSAyNDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///241\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.11 Object.isExtensible(O)\nvar isObject = __webpack_require__(9);\n\n__webpack_require__(39)('isExtensible', function ($isExtensible) {\n return function isExtensible(it) {\n return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLWV4dGVuc2libGUuanM/ODBmYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjIuMTEgT2JqZWN0LmlzRXh0ZW5zaWJsZShPKVxudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG5cbnJlcXVpcmUoJy4vX29iamVjdC1zYXAnKSgnaXNFeHRlbnNpYmxlJywgZnVuY3Rpb24gKCRpc0V4dGVuc2libGUpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGlzRXh0ZW5zaWJsZShpdCkge1xuICAgIHJldHVybiBpc09iamVjdChpdCkgPyAkaXNFeHRlbnNpYmxlID8gJGlzRXh0ZW5zaWJsZShpdCkgOiB0cnVlIDogZmFsc2U7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLWV4dGVuc2libGUuanNcbi8vIG1vZHVsZSBpZCA9IDI0MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///242\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(0);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(160) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmFzc2lnbi5qcz85ZjVkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMy4xIE9iamVjdC5hc3NpZ24odGFyZ2V0LCBzb3VyY2UpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiwgJ09iamVjdCcsIHsgYXNzaWduOiByZXF1aXJlKCcuL19vYmplY3QtYXNzaWduJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC5hc3NpZ24uanNcbi8vIG1vZHVsZSBpZCA9IDI0M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///243\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.10 Object.is(value1, value2)\nvar $export = __webpack_require__(0);\n$export($export.S, 'Object', { is: __webpack_require__(245) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLmpzPzlkMWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4zLjEwIE9iamVjdC5pcyh2YWx1ZTEsIHZhbHVlMilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHsgaXM6IHJlcXVpcmUoJy4vX3NhbWUtdmFsdWUnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LmlzLmpzXG4vLyBtb2R1bGUgaWQgPSAyNDRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///244\n")},function(module,exports){eval("// 7.2.9 SameValue(x, y)\nmodule.exports = Object.is || function is(x, y) {\n // eslint-disable-next-line no-self-compare\n return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2FtZS12YWx1ZS5qcz9lMDg2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMi45IFNhbWVWYWx1ZSh4LCB5KVxubW9kdWxlLmV4cG9ydHMgPSBPYmplY3QuaXMgfHwgZnVuY3Rpb24gaXMoeCwgeSkge1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gIHJldHVybiB4ID09PSB5ID8geCAhPT0gMCB8fCAxIC8geCA9PT0gMSAvIHkgOiB4ICE9IHggJiYgeSAhPSB5O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fc2FtZS12YWx1ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjQ1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///245\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(0);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(111).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YuanM/OGViMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAxOS4xLjMuMTkgT2JqZWN0LnNldFByb3RvdHlwZU9mKE8sIHByb3RvKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbiRleHBvcnQoJGV4cG9ydC5TLCAnT2JqZWN0JywgeyBzZXRQcm90b3R5cGVPZjogcmVxdWlyZSgnLi9fc2V0LXByb3RvJykuc2V0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gMjQ2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///246\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.3.6 Object.prototype.toString()\nvar classof = __webpack_require__(75);\nvar test = {};\ntest[__webpack_require__(10)('toStringTag')] = 'z';\nif (test + '' != '[object z]') {\n __webpack_require__(24)(Object.prototype, 'toString', function toString() {\n return '[object ' + classof(this) + ']';\n }, true);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZy5qcz84MTg2Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDE5LjEuMy42IE9iamVjdC5wcm90b3R5cGUudG9TdHJpbmcoKVxudmFyIGNsYXNzb2YgPSByZXF1aXJlKCcuL19jbGFzc29mJyk7XG52YXIgdGVzdCA9IHt9O1xudGVzdFtyZXF1aXJlKCcuL193a3MnKSgndG9TdHJpbmdUYWcnKV0gPSAneic7XG5pZiAodGVzdCArICcnICE9ICdbb2JqZWN0IHpdJykge1xuICByZXF1aXJlKCcuL19yZWRlZmluZScpKE9iamVjdC5wcm90b3R5cGUsICd0b1N0cmluZycsIGZ1bmN0aW9uIHRvU3RyaW5nKCkge1xuICAgIHJldHVybiAnW29iamVjdCAnICsgY2xhc3NvZih0aGlzKSArICddJztcbiAgfSwgdHJ1ZSk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm9iamVjdC50by1zdHJpbmcuanNcbi8vIG1vZHVsZSBpZCA9IDI0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///247\n")},function(module,exports,__webpack_require__){eval("// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Function', { bind: __webpack_require__(161) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24uYmluZC5qcz9kZDBhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjIuMy4yIC8gMTUuMy40LjUgRnVuY3Rpb24ucHJvdG90eXBlLmJpbmQodGhpc0FyZywgYXJncy4uLilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnRnVuY3Rpb24nLCB7IGJpbmQ6IHJlcXVpcmUoJy4vX2JpbmQnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24uYmluZC5qc1xuLy8gbW9kdWxlIGlkID0gMjQ4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///248\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(13).f;\nvar FProto = Function.prototype;\nvar nameRE = /^\\s*function ([^ (]*)/;\nvar NAME = 'name';\n\n// 19.2.4.2 name\nNAME in FProto || __webpack_require__(12) && dP(FProto, NAME, {\n configurable: true,\n get: function () {\n try {\n return ('' + this).match(nameRE)[1];\n } catch (e) {\n return '';\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qcz8xMmU1Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgRlByb3RvID0gRnVuY3Rpb24ucHJvdG90eXBlO1xudmFyIG5hbWVSRSA9IC9eXFxzKmZ1bmN0aW9uIChbXiAoXSopLztcbnZhciBOQU1FID0gJ25hbWUnO1xuXG4vLyAxOS4yLjQuMiBuYW1lXG5OQU1FIGluIEZQcm90byB8fCByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmIGRQKEZQcm90bywgTkFNRSwge1xuICBjb25maWd1cmFibGU6IHRydWUsXG4gIGdldDogZnVuY3Rpb24gKCkge1xuICAgIHRyeSB7XG4gICAgICByZXR1cm4gKCcnICsgdGhpcykubWF0Y2gobmFtZVJFKVsxXTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gJyc7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24ubmFtZS5qc1xuLy8gbW9kdWxlIGlkID0gMjQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///249\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar isObject = __webpack_require__(9);\nvar getPrototypeOf = __webpack_require__(30);\nvar HAS_INSTANCE = __webpack_require__(10)('hasInstance');\nvar FunctionProto = Function.prototype;\n// 19.2.3.6 Function.prototype[@@hasInstance](V)\nif (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(13).f(FunctionProto, HAS_INSTANCE, { value: function (O) {\n if (typeof this != 'function' || !isObject(O)) return false;\n if (!isObject(this.prototype)) return O instanceof this;\n // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:\n while (O = getPrototypeOf(O)) if (this.prototype === O) return true;\n return false;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZnVuY3Rpb24uaGFzLWluc3RhbmNlLmpzPzNkYjMiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGlzT2JqZWN0ID0gcmVx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YXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///250\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseInt = __webpack_require__(163);\n// 18.2.5 parseInt(string, radix)\n$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucGFyc2UtaW50LmpzPzRiZTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcGFyc2VJbnQgPSByZXF1aXJlKCcuL19wYXJzZS1pbnQnKTtcbi8vIDE4LjIuNSBwYXJzZUludChzdHJpbmcsIHJhZGl4KVxuJGV4cG9ydCgkZXhwb3J0LkcgKyAkZXhwb3J0LkYgKiAocGFyc2VJbnQgIT0gJHBhcnNlSW50KSwgeyBwYXJzZUludDogJHBhcnNlSW50IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5wYXJzZS1pbnQuanNcbi8vIG1vZHVsZSBpZCA9IDI1MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///251\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseFloat = __webpack_require__(164);\n// 18.2.4 parseFloat(string)\n$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucGFyc2UtZmxvYXQuanM/MTJmMSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRwYXJzZUZsb2F0ID0gcmVxdWlyZSgnLi9fcGFyc2UtZmxvYXQnKTtcbi8vIDE4LjIuNCBwYXJzZUZsb2F0KHN0cmluZylcbiRleHBvcnQoJGV4cG9ydC5HICsgJGV4cG9ydC5GICogKHBhcnNlRmxvYXQgIT0gJHBhcnNlRmxvYXQpLCB7IHBhcnNlRmxvYXQ6ICRwYXJzZUZsb2F0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5wYXJzZS1mbG9hdC5qc1xuLy8gbW9kdWxlIGlkID0gMjUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///252\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(7);\nvar has = __webpack_require__(27);\nvar cof = __webpack_require__(34);\nvar inheritIfRequired = __webpack_require__(113);\nvar toPrimitive = __webpack_require__(36);\nvar fails = __webpack_require__(8);\nvar gOPN = __webpack_require__(57).f;\nvar gOPD = __webpack_require__(29).f;\nvar dP = __webpack_require__(13).f;\nvar $trim = __webpack_require__(65).trim;\nvar NUMBER = 'Number';\nvar $Number = global[NUMBER];\nvar Base = $Number;\nvar proto = $Number.prototype;\n// Opera ~12 has broken Object#toString\nvar BROKEN_COF = cof(__webpack_require__(56)(proto)) == NUMBER;\nvar TRIM = 'trim' in String.prototype;\n\n// 7.1.3 ToNumber(argument)\nvar toNumber = function (argument) {\n var it = toPrimitive(argument, false);\n if (typeof it == 'string' && it.length > 2) {\n it = TRIM ? it.trim() : $trim(it, 3);\n var first = it.charCodeAt(0);\n var third, radix, maxCode;\n if (first === 43 || first === 45) {\n third = it.charCodeAt(2);\n if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix\n } else if (first === 48) {\n switch (it.charCodeAt(1)) {\n case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i\n case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i\n default: return +it;\n }\n for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {\n code = digits.charCodeAt(i);\n // parseInt parses a string to a first unavailable symbol\n // but ToNumber should return NaN if a string contains unavailable symbols\n if (code < 48 || code > maxCode) return NaN;\n } return parseInt(digits, radix);\n }\n } return +it;\n};\n\nif (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {\n $Number = function Number(value) {\n var it = arguments.length < 1 ? 0 : value;\n var that = this;\n return that instanceof $Number\n // check on 1..constructor(foo) case\n && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)\n ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);\n };\n for (var keys = __webpack_require__(12) ? gOPN(Base) : (\n // ES3:\n 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +\n // ES6 (in case, if modules with ES6 Number statics required before):\n 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +\n 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'\n ).split(','), j = 0, key; keys.length > j; j++) {\n if (has(Base, key = keys[j]) && !has($Number, key)) {\n dP($Number, key, gOPD(Base, key));\n }\n }\n $Number.prototype = proto;\n proto.constructor = $Number;\n __webpack_require__(24)(global, NUMBER, $Number);\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmNvbnN0cnVjdG9yLmpzPzQwMWIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGhhcyA9IHJlcXVpcmUoJy4vX2hhcycpO1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xudmFyIGluaGVyaXRJZlJlcXVpcmVkID0gcmVxdWlyZSgnLi9faW5oZXJpdC1pZi1yZXF1aXJlZCcpO1xudmFyIHRvUHJpbWl0aXZlID0gcmVxdWlyZSgnLi9fdG8tcHJpbWl0aXZlJyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyIGdPUE4gPSByZXF1aXJlKCcuL19vYmplY3QtZ29wbicpLmY7XG52YXIgZ09QRCA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJykuZjtcbnZhciBkUCA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgJHRyaW0gPSByZXF1aXJlKCcuL19zdHJpbmctdHJpbScpLnRyaW07XG52YXIgTlVNQkVSID0gJ051bWJlcic7XG52YXIgJE51bWJlciA9IGdsb2JhbFtOVU1CRVJdO1xudmFyIEJhc2UgPSAkTnVtYmVyO1xudmFyIHByb3RvID0gJE51bWJlci5wcm90b3R5cGU7XG4vLyBPcGVyYSB+MTIgaGFzI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dWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///253\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toInteger = __webpack_require__(38);\nvar aNumberValue = __webpack_require__(165);\nvar repeat = __webpack_require__(114);\nvar $toFixed = 1.0.toFixed;\nvar floor = Math.floor;\nvar data = [0, 0, 0, 0, 0, 0];\nvar ERROR = 'Number.toFixed: incorrect invocation!';\nvar ZERO = '0';\n\nvar multiply = function (n, c) {\n var i = -1;\n var c2 = c;\n while (++i < 6) {\n c2 += n * data[i];\n data[i] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n};\nvar divide = function (n) {\n var i = 6;\n var c = 0;\n while (--i >= 0) {\n c += data[i];\n data[i] = floor(c / n);\n c = (c % n) * 1e7;\n }\n};\nvar numToString = function () {\n var i = 6;\n var s = '';\n while (--i >= 0) {\n if (s !== '' || i === 0 || data[i] !== 0) {\n var t = String(data[i]);\n s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;\n }\n } return s;\n};\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\n$export($export.P + $export.F * (!!$toFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !__webpack_require__(8)(function () {\n // V8 ~ Android 4.3-\n $toFixed.call({});\n})), 'Number', {\n toFixed: function toFixed(fractionDigits) {\n var x = aNumberValue(this, ERROR);\n var f = toInteger(fractionDigits);\n var s = '';\n var m = ZERO;\n var e, z, j, k;\n if (f < 0 || f > 20) throw RangeError(ERROR);\n // eslint-disable-next-line no-self-compare\n if (x != x) return 'NaN';\n if (x <= -1e21 || x >= 1e21) return String(x);\n if (x < 0) {\n s = '-';\n x = -x;\n }\n if (x > 1e-21) {\n e = log(x * pow(2, 69, 1)) - 69;\n z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = f;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n m = numToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n m = numToString() + repeat.call(ZERO, f);\n }\n }\n if (f > 0) {\n k = m.length;\n m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));\n } else {\n m = s + m;\n } return m;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnRvLWZpeGVkLmpzPzQxNjIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgYU51bWJlclZhbHVlID0gcmVxdWlyZSgnLi9fYS1udW1iZXItdmFsdWUnKTtcbnZhciByZXBlYXQgPSByZXF1aXJlKCcuL19zdHJpbmctcmVwZWF0Jyk7XG52YXIgJHRvRml4ZWQgPSAxLjAudG9GaXhlZDtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG52YXIgZGF0YSA9IFswLCAwLCAwLCAwLCAwLCAwXTtcbnZhciBFUlJPUiA9ICdOdW1iZXIudG9GaXhlZDogaW5jb3JyZWN0IGludm9jYXRpb24hJztcbnZhciBaRVJPID0gJzAnO1xuXG52YXIgbXVsdGlwbHkgPSBmdW5jdGlvbiAobiwgYykge1xuICB2YXIgaSA9IC0xO1xuICB2YXIgYzIgPSBjO1xuICB3aGlsZSAoKytpIDwgNikge1xuICAgIGMyICs9IG4gKiBkYXRhW2ldO1xuICAgIGRhdGFbaV0gPSBjMiAlIDFlNztcbiAgICBjMiA9IGZsb29yKGMyIC8gMWU3KTtcbiAgfVxufTtcbnZhciBkaXZpZGUgPSBmdW5jdGlvbiAobikge1xuICB2YXIgaSA9IDY7XG4gIHZhciBjID0gMDtcbiAgd2hpbGUgKC0taSA+PSAwKSB7XG4gICAgYyArPSBkYXRhW2ldO1xuICAgIGRhdGFbaV0gPSBmbG9vcihjIC8gbik7XG4gICAgYyA9IChjICUgbikgKiAxZTc7X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QTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///254\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $fails = __webpack_require__(8);\nvar aNumberValue = __webpack_require__(165);\nvar $toPrecision = 1.0.toPrecision;\n\n$export($export.P + $export.F * ($fails(function () {\n // IE7-\n return $toPrecision.call(1, undefined) !== '1';\n}) || !$fails(function () {\n // V8 ~ Android 4.3-\n $toPrecision.call({});\n})), 'Number', {\n toPrecision: function toPrecision(precision) {\n var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');\n return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);\n }\n});\n//# sourceUR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y8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci50by1wcmVjaXNpb24uanNcbi8vIG1vZHVsZSBpZCA9IDI1NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///255\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.1 Number.EPSILON\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmVwc2lsb24uanM/NGFkYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuMSBOdW1iZXIuRVBTSUxPTlxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdOdW1iZXInLCB7IEVQU0lMT046IE1hdGgucG93KDIsIC01MikgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5lcHNpbG9uLmpzXG4vLyBtb2R1bGUgaWQgPSAyNTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///256\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.2 Number.isFinite(number)\nvar $export = __webpack_require__(0);\nvar _isFinite = __webpack_require__(7).isFinite;\n\n$export($export.S, 'Number', {\n isFinite: function isFinite(it) {\n return typeof it == 'number' && _isFinite(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWZpbml0ZS5qcz9jYWU1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi4yIE51bWJlci5pc0Zpbml0ZShudW1iZXIpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIF9pc0Zpbml0ZSA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpLmlzRmluaXRlO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ051bWJlcicsIHtcbiAgaXNGaW5pdGU6IGZ1bmN0aW9uIGlzRmluaXRlKGl0KSB7XG4gICAgcmV0dXJuIHR5cGVvZiBpdCA9PSAnbnVtYmVyJyAmJiBfaXNGaW5pdGUoaXQpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWZpbml0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjU3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///257\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { isInteger: __webpack_require__(166) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWludGVnZXIuanM/NWVkOCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuMyBOdW1iZXIuaXNJbnRlZ2VyKG51bWJlcilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTnVtYmVyJywgeyBpc0ludGVnZXI6IHJlcXVpcmUoJy4vX2lzLWludGVnZXInKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDI1OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///258\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.4 Number.isNaN(number)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', {\n isNaN: function isNaN(number) {\n // eslint-disable-next-line no-self-compare\n return number != number;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLW5hbi5qcz8yYzZlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi40IE51bWJlci5pc05hTihudW1iZXIpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ051bWJlcicsIHtcbiAgaXNOYU46IGZ1bmN0aW9uIGlzTmFOKG51bWJlcikge1xuICAgIC8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBuby1zZWxmLWNvbXBhcmVcbiAgICByZXR1cm4gbnVtYmVyICE9IG51bWJlcjtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5pcy1uYW4uanNcbi8vIG1vZHVsZSBpZCA9IDI1OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///259\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.5 Number.isSafeInteger(number)\nvar $export = __webpack_require__(0);\nvar isInteger = __webpack_require__(166);\nvar abs = Math.abs;\n\n$export($export.S, 'Number', {\n isSafeInteger: function isSafeInteger(number) {\n return isInteger(number) && abs(number) <= 0x1fffffffffffff;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLmlzLXNhZmUtaW50ZWdlci5qcz8wMzU5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi41IE51bWJlci5pc1NhZmVJbnRlZ2VyKG51bWJlcilcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgaXNJbnRlZ2VyID0gcmVxdWlyZSgnLi9faXMtaW50ZWdlcicpO1xudmFyIGFicyA9IE1hdGguYWJzO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ051bWJlcicsIHtcbiAgaXNTYWZlSW50ZWdlcjogZnVuY3Rpb24gaXNTYWZlSW50ZWdlcihudW1iZXIpIHtcbiAgICByZXR1cm4gaXNJbnRlZ2VyKG51bWJlcikgJiYgYWJzKG51bWJlcikgPD0gMHgxZmZmZmZmZmZmZmZmZjtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5pcy1zYWZlLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDI2MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///260\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.6 Number.MAX_SAFE_INTEGER\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLm1heC1zYWZlLWludGVnZXIuanM/NWEyMiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuNiBOdW1iZXIuTUFYX1NBRkVfSU5URUdFUlxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdOdW1iZXInLCB7IE1BWF9TQUZFX0lOVEVHRVI6IDB4MWZmZmZmZmZmZmZmZmYgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm51bWJlci5tYXgtc2FmZS1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSAyNjFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///261\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.10 Number.MIN_SAFE_INTEGER\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLm1pbi1zYWZlLWludGVnZXIuanM/Njg5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4xLjIuMTAgTnVtYmVyLk1JTl9TQUZFX0lOVEVHRVJcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTnVtYmVyJywgeyBNSU5fU0FGRV9JTlRFR0VSOiAtMHgxZmZmZmZmZmZmZmZmZiB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLm1pbi1zYWZlLWludGVnZXIuanNcbi8vIG1vZHVsZSBpZCA9IDI2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///262\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseFloat = __webpack_require__(164);\n// 20.1.2.12 Number.parseFloat(string)\n$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWZsb2F0LmpzPzZhNWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcGFyc2VGbG9hdCA9IHJlcXVpcmUoJy4vX3BhcnNlLWZsb2F0Jyk7XG4vLyAyMC4xLjIuMTIgTnVtYmVyLnBhcnNlRmxvYXQoc3RyaW5nKVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAoTnVtYmVyLnBhcnNlRmxvYXQgIT0gJHBhcnNlRmxvYXQpLCAnTnVtYmVyJywgeyBwYXJzZUZsb2F0OiAkcGFyc2VGbG9hdCB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWZsb2F0LmpzXG4vLyBtb2R1bGUgaWQgPSAyNjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///263\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $parseInt = __webpack_require__(163);\n// 20.1.2.13 Number.parseInt(string, radix)\n$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWludC5qcz83NTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJHBhcnNlSW50ID0gcmVxdWlyZSgnLi9fcGFyc2UtaW50Jyk7XG4vLyAyMC4xLjIuMTMgTnVtYmVyLnBhcnNlSW50KHN0cmluZywgcmFkaXgpXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIChOdW1iZXIucGFyc2VJbnQgIT0gJHBhcnNlSW50KSwgJ051bWJlcicsIHsgcGFyc2VJbnQ6ICRwYXJzZUludCB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubnVtYmVyLnBhcnNlLWludC5qc1xuLy8gbW9kdWxlIGlkID0gMjY0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///264\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.3 Math.acosh(x)\nvar $export = __webpack_require__(0);\nvar log1p = __webpack_require__(167);\nvar sqrt = Math.sqrt;\nvar $acosh = Math.acosh;\n\n$export($export.S + $export.F * !($acosh\n // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509\n && Math.floor($acosh(Number.MAX_VALUE)) == 710\n // Tor Browser bug: Math.acosh(Infinity) -> NaN\n && $acosh(Infinity) == Infinity\n), 'Math', {\n acosh: function acosh(x) {\n return (x = +x) < 1 ? NaN : x > 94906265.62425156\n ? Math.log(x) + Math.LN2\n : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5hY29zaC5qcz9iZjY5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4zIE1hdGguYWNvc2goeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgbG9nMXAgPSByZXF1aXJlKCcuL19tYXRoLWxvZzFwJyk7XG52YXIgc3FydCA9IE1hdGguc3FydDtcbnZhciAkYWNvc2ggPSBNYXRoLmFjb3NoO1xuXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqICEoJGFjb3NoXG4gIC8vIFY4IGJ1ZzogaHR0cHM6Ly9jb2RlLmdvb2dsZS5jb20vcC92OC9pc3N1ZXMvZGV0YWlsP2lkPTM1MDlcbiAgJiYgTWF0aC5mbG9vcigkYWNvc2goTnVtYmVyLk1BWF9WQUxVRSkpID09IDcxMFxuICAvLyBUb3IgQnJvd3NlciBidWc6IE1hdGguYWNvc2goSW5maW5pdHkpIC0+IE5hTlxuICAmJiAkYWNvc2goSW5maW5pdHkpID09IEluZmluaXR5XG4pLCAnTWF0aCcsIHtcbiAgYWNvc2g6IGZ1bmN0aW9uIGFjb3NoKHgpIHtcbiAgICByZXR1cm4gKHggPSAreCkgPCAxID8gTmFOIDogeCA+IDk0OTA2MjY1LjYyNDI1MTU2XG4gICAgICA/IE1hdGgubG9nKHgpICsgTWF0aC5MTjJcbiAgICAgIDogbG9nMXAoeCAtIDEgKyBzcXJ0KHggLSAxKSAqIHNxcnQoeCArIDEpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGguYWNvc2guanNcbi8vIG1vZHVsZSBpZCA9IDI2NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///265\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.5 Math.asinh(x)\nvar $export = __webpack_require__(0);\nvar $asinh = Math.asinh;\n\nfunction asinh(x) {\n return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));\n}\n\n// Tor Browser bug: Math.asinh(0) -> -0\n$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5hc2luaC5qcz9lYzliIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi41IE1hdGguYXNpbmgoeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGFzaW5oID0gTWF0aC5hc2luaDtcblxuZnVuY3Rpb24gYXNpbmgoeCkge1xuICByZXR1cm4gIWlzRmluaXRlKHggPSAreCkgfHwgeCA9PSAwID8geCA6IHggPCAwID8gLWFzaW5oKC14KSA6IE1hdGgubG9nKHggKyBNYXRoLnNxcnQoeCAqIHggKyAxKSk7XG59XG5cbi8vIFRvciBCcm93c2VyIGJ1ZzogTWF0aC5hc2luaCgwKSAtPiAtMFxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAhKCRhc2luaCAmJiAxIC8gJGFzaW5oKDApID4gMCksICdNYXRoJywgeyBhc2luaDogYXNpbmggfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGguYXNpbmguanNcbi8vIG1vZHVsZSBpZCA9IDI2NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///266\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.7 Math.atanh(x)\nvar $export = __webpack_require__(0);\nvar $atanh = Math.atanh;\n\n// Tor Browser bug: Math.atanh(-0) -> 0\n$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {\n atanh: function atanh(x) {\n return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5hdGFuaC5qcz85NzI4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi43IE1hdGguYXRhbmgoeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGF0YW5oID0gTWF0aC5hdGFuaDtcblxuLy8gVG9yIEJyb3dzZXIgYnVnOiBNYXRoLmF0YW5oKC0wKSAtPiAwXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqICEoJGF0YW5oICYmIDEgLyAkYXRhbmgoLTApIDwgMCksICdNYXRoJywge1xuICBhdGFuaDogZnVuY3Rpb24gYXRhbmgoeCkge1xuICAgIHJldHVybiAoeCA9ICt4KSA9PSAwID8geCA6IE1hdGgubG9nKCgxICsgeCkgLyAoMSAtIHgpKSAvIDI7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmF0YW5oLmpzXG4vLyBtb2R1bGUgaWQgPSAyNjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///267\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.9 Math.cbrt(x)\nvar $export = __webpack_require__(0);\nvar sign = __webpack_require__(115);\n\n$export($export.S, 'Math', {\n cbrt: function cbrt(x) {\n return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jYnJ0LmpzPzkwMTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjkgTWF0aC5jYnJ0KHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHNpZ24gPSByZXF1aXJlKCcuL19tYXRoLXNpZ24nKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBjYnJ0OiBmdW5jdGlvbiBjYnJ0KHgpIHtcbiAgICByZXR1cm4gc2lnbih4ID0gK3gpICogTWF0aC5wb3coTWF0aC5hYnMoeCksIDEgLyAzKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGguY2JydC5qc1xuLy8gbW9kdWxlIGlkID0gMjY4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///268\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.11 Math.clz32(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n clz32: function clz32(x) {\n return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jbHozMi5qcz9jNGUzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xMSBNYXRoLmNsejMyKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGNsejMyOiBmdW5jdGlvbiBjbHozMih4KSB7XG4gICAgcmV0dXJuICh4ID4+Pj0gMCkgPyAzMSAtIE1hdGguZmxvb3IoTWF0aC5sb2coeCArIDAuNSkgKiBNYXRoLkxPRzJFKSA6IDMyO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jbHozMi5qc1xuLy8gbW9kdWxlIGlkID0gMjY5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///269\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.12 Math.cosh(x)\nvar $export = __webpack_require__(0);\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n cosh: function cosh(x) {\n return (exp(x = +x) + exp(-x)) / 2;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jb3NoLmpzPzJlNTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjEyIE1hdGguY29zaCh4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBleHAgPSBNYXRoLmV4cDtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBjb3NoOiBmdW5jdGlvbiBjb3NoKHgpIHtcbiAgICByZXR1cm4gKGV4cCh4ID0gK3gpICsgZXhwKC14KSkgLyAyO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5jb3NoLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///270\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.14 Math.expm1(x)\nvar $export = __webpack_require__(0);\nvar $expm1 = __webpack_require__(116);\n\n$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5leHBtMS5qcz9mNzEyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xNCBNYXRoLmV4cG0xKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRleHBtMSA9IHJlcXVpcmUoJy4vX21hdGgtZXhwbTEnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiAoJGV4cG0xICE9IE1hdGguZXhwbTEpLCAnTWF0aCcsIHsgZXhwbTE6ICRleHBtMSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5leHBtMS5qc1xuLy8gbW9kdWxlIGlkID0gMjcxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///271\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.16 Math.fround(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { fround: __webpack_require__(168) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5mcm91bmQuanM/OWJhNiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4yLjIuMTYgTWF0aC5mcm91bmQoeClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgZnJvdW5kOiByZXF1aXJlKCcuL19tYXRoLWZyb3VuZCcpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmZyb3VuZC5qc1xuLy8gbW9kdWxlIGlkID0gMjcyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///272\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])\nvar $export = __webpack_require__(0);\nvar abs = Math.abs;\n\n$export($export.S, 'Math', {\n hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars\n var sum = 0;\n var i = 0;\n var aLen = arguments.length;\n var larg = 0;\n var arg, div;\n while (i < aLen) {\n arg = abs(arguments[i++]);\n if (larg < arg) {\n div = larg / arg;\n sum = sum * div * div + 1;\n larg = arg;\n } else if (arg > 0) {\n div = arg / larg;\n sum += div * div;\n } else sum += arg;\n }\n return larg === Infinity ? Infinity : larg * Math.sqrt(sum);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5oeXBvdC5qcz9jMmJiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4xNyBNYXRoLmh5cG90KFt2YWx1ZTFbLCB2YWx1ZTJbLCDigKYgXV1dKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhYnMgPSBNYXRoLmFicztcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBoeXBvdDogZnVuY3Rpb24gaHlwb3QodmFsdWUxLCB2YWx1ZTIpIHsgLy8gZXNsaW50LWRpc2FibGUtbGluZSBuby11bnVzZW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20.2.2.18 Math.imul(x, y)\nvar $export = __webpack_require__(0);\nvar $imul = Math.imul;\n\n// some WebKit versions fails with big numbers, some has wrong arity\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n return $imul(0xffffffff, 5) != -5 || $imul.length != 2;\n}), 'Math', {\n imul: function imul(x, y) {\n var UINT16 = 0xffff;\n var xn = +x;\n var yn = +y;\n var xl = UINT16 & xn;\n var yl = UINT16 & yn;\n return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5pbXVsLmpzPzJlYTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjE4IE1hdGguaW11bCh4LCB5KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkaW11bCA9IE1hdGguaW11bDtcblxuLy8gc29tZSBXZWJLaXQgdmVyc2lvbnMgZmFpbHMgd2l0aCBiaWcgbnVtYmVycywgc29tZSBoYXMgd3JvbmcgYXJpdHlcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogcmVxdWlyZSgnLi9fZmFpbHMnKShmdW5jdGlvbiAoKSB7XG4gIHJldHVybiAkaW11bCgweGZmZmZmZmZmLCA1KSAhPSAtNSB8fCAkaW11bC5sZW5ndGggIT0gMjtcbn0pLCAnTWF0aCcsIHtcbiAgaW11bDogZnVuY3Rpb24gaW11bCh4LCB5KSB7XG4gICAgdmFyIFVJTlQxNiA9IDB4ZmZmZjtcbiAgICB2YXIgeG4gPSAreDtcbiAgICB2YXIgeW4gPSAreTtcbiAgICB2YXIgeGwgPSBVSU5UMTYgJiB4bjtcbiAgICB2YXIgeWwgPSBVSU5UMTYgJiB5bjtcbiAgICByZXR1cm4gMCB8IHhsICogeWwgKyAoKFVJTlQxNiAmIHhuID4+PiAxNikgKiB5bCArIHhsICogKFVJTlQxNiAmIHluID4+PiAxNikgPDwgMTYgPj4+IDApO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5pbXVsLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///274\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.21 Math.log10(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n log10: function log10(x) {\n return Math.log(x) * Math.LOG10E;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5sb2cxMC5qcz9kNjJhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4yMSBNYXRoLmxvZzEwKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGxvZzEwOiBmdW5jdGlvbiBsb2cxMCh4KSB7XG4gICAgcmV0dXJuIE1hdGgubG9nKHgpICogTWF0aC5MT0cxMEU7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5tYXRoLmxvZzEwLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///275\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.20 Math.log1p(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { log1p: __webpack_require__(167) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5sb2cxcC5qcz9hNTYxIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4yMCBNYXRoLmxvZzFwKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7IGxvZzFwOiByZXF1aXJlKCcuL19tYXRoLWxvZzFwJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGgubG9nMXAuanNcbi8vIG1vZHVsZSBpZCA9IDI3NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///276\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.22 Math.log2(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n log2: function log2(x) {\n return Math.log(x) / Math.LN2;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5sb2cyLmpzPzM3ODIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjIyIE1hdGgubG9nMih4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICBsb2cyOiBmdW5jdGlvbiBsb2cyKHgpIHtcbiAgICByZXR1cm4gTWF0aC5sb2coeCkgLyBNYXRoLkxOMjtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGgubG9nMi5qc1xuLy8gbW9kdWxlIGlkID0gMjc3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///277\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.28 Math.sign(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { sign: __webpack_require__(115) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaWduLmpzPzFlNWYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjI4IE1hdGguc2lnbih4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywgeyBzaWduOiByZXF1aXJlKCcuL19tYXRoLXNpZ24nKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaWduLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///278\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.30 Math.sinh(x)\nvar $export = __webpack_require__(0);\nvar expm1 = __webpack_require__(116);\nvar exp = Math.exp;\n\n// V8 near Chromium 38 has a problem with very small numbers\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n return !Math.sinh(-2e-17) != -2e-17;\n}), 'Math', {\n sinh: function sinh(x) {\n return Math.abs(x = +x) < 1\n ? (expm1(x) - expm1(-x)) / 2\n : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaW5oLmpzPzMyMzEiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjMwIE1hdGguc2luaCh4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBleHBtMSA9IHJlcXVpcmUoJy4vX21hdGgtZXhwbTEnKTtcbnZhciBleHAgPSBNYXRoLmV4cDtcblxuLy8gVjggbmVhciBDaHJvbWl1bSAzOCBoYXMgYSBwcm9ibGVtIHdpdGggdmVyeSBzbWFsbCBudW1iZXJzXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIHJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByZXR1cm4gIU1hdGguc2luaCgtMmUtMTcpICE9IC0yZS0xNztcbn0pLCAnTWF0aCcsIHtcbiAgc2luaDogZnVuY3Rpb24gc2luaCh4KSB7XG4gICAgcmV0dXJuIE1hdGguYWJzKHggPSAreCkgPCAxXG4gICAgICA/IChleHBtMSh4KSAtIGV4cG0xKC14KSkgLyAyXG4gICAgICA6IChleHAoeCAtIDEpIC0gZXhwKC14IC0gMSkpICogKE1hdGguRSAvIDIpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC5zaW5oLmpzXG4vLyBtb2R1bGUgaWQgPSAyNzlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///279\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.33 Math.tanh(x)\nvar $export = __webpack_require__(0);\nvar expm1 = __webpack_require__(116);\nvar exp = Math.exp;\n\n$export($export.S, 'Math', {\n tanh: function tanh(x) {\n var a = expm1(x = +x);\n var b = expm1(-x);\n return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC50YW5oLmpzPzQ5MTAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMi4yLjMzIE1hdGgudGFuaCh4KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBleHBtMSA9IHJlcXVpcmUoJy4vX21hdGgtZXhwbTEnKTtcbnZhciBleHAgPSBNYXRoLmV4cDtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdNYXRoJywge1xuICB0YW5oOiBmdW5jdGlvbiB0YW5oKHgpIHtcbiAgICB2YXIgYSA9IGV4cG0xKHggPSAreCk7XG4gICAgdmFyIGIgPSBleHBtMSgteCk7XG4gICAgcmV0dXJuIGEgPT0gSW5maW5pdHkgPyAxIDogYiA9PSBJbmZpbml0eSA/IC0xIDogKGEgLSBiKSAvIChleHAoeCkgKyBleHAoLXgpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2Lm1hdGgudGFuaC5qc1xuLy8gbW9kdWxlIGlkID0gMjgwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///280\n")},function(module,exports,__webpack_require__){eval("// 20.2.2.34 Math.trunc(x)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n trunc: function trunc(it) {\n return (it > 0 ? Math.floor : Math.ceil)(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC50cnVuYy5qcz8xZjQ5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjIuMi4zNCBNYXRoLnRydW5jKHgpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIHRydW5jOiBmdW5jdGlvbiB0cnVuYyhpdCkge1xuICAgIHJldHVybiAoaXQgPiAwID8gTWF0aC5mbG9vciA6IE1hdGguY2VpbCkoaXQpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYubWF0aC50cnVuYy5qc1xuLy8gbW9kdWxlIGlkID0gMjgxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///281\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar fromCharCode = String.fromCharCode;\nvar $fromCodePoint = String.fromCodePoint;\n\n// length should be 1, old FF problem\n$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {\n // 21.1.2.2 String.fromCodePoint(...codePoints)\n fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars\n var res = [];\n var aLen = arguments.length;\n var i = 0;\n var code;\n while (aLen > i) {\n code = +arguments[i++];\n if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');\n res.push(code < 0x10000\n ? fromCharCode(code)\n : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)\n );\n } return res.join('');\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZyb20tY29kZS1wb2ludC5qcz82ZWEzIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbnZhciBmcm9tQ2hhckNvZGUgPSBTdHJpbmcuZnJvbUNoYXJDb2RlO1xudmFyICRmcm9tQ29kZVBvaW50ID0gU3RyaW5nLmZyb21Db2RlUG9pbnQ7XG5cbi8vIGxlbmd0aCBzaG91bGQgYmUgMSwgb2xkIEZGIHByb2JsZW1cbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogKCEhJGZyb21Db2RlUG9pbnQgJiYgJGZyb21Db2RlUG9pbnQubGVuZ3RoICE9IDEpLCAnU3RyaW5nJywge1xuICAvLyAyMS4xLjIuMiBTdHJpbmcuZnJvbUNvZGVQb2ludCguLi5jb2RlUG9pbnRzKVxuICBmcm9tQ29kZVBvaW50OiBmdW5jdGlvbiBmcm9tQ29kZVBvaW50KHgpI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__){eval("var $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(28);\nvar toLength = __webpack_require__(14);\n\n$export($export.S, 'String', {\n // 21.1.2.4 String.raw(callSite, ...substitutions)\n raw: function raw(callSite) {\n var tpl = toIObject(callSite.raw);\n var len = toLength(tpl.length);\n var aLen = arguments.length;\n var res = [];\n var i = 0;\n while (len > i) {\n res.push(String(tpl[i++]));\n if (i < aLen) res.push(String(arguments[i]));\n } return res.join('');\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJhdy5qcz8xNzdiIl0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnU3RyaW5nJywge1xuICAvLyAyMS4xLjIuNCBTdHJpbmcucmF3KGNhbGxTaXRlLCAuLi5zdWJzdGl0dXRpb25zKVxuICByYXc6IGZ1bmN0aW9uIHJhdyhjYWxsU2l0ZSkge1xuICAgIHZhciB0cGwgPSB0b0lPYmplY3QoY2FsbFNpdGUucmF3KTtcbiAgICB2YXIgbGVuID0gdG9MZW5ndGgodHBsLmxlbmd0aCk7XG4gICAgdmFyIGFMZW4gPSBhcmd1bWVudHMubGVuZ3RoO1xuICAgIHZhciByZXMgPSBbXTtcbiAgICB2YXIgaSA9IDA7XG4gICAgd2hpbGUgKGxlbiA+IGkpIHtcbiAgICAgIHJlcy5wdXNoKFN0cmluZyh0cGxbaSsrXSkpO1xuICAgICAgaWYgKGkgPCBhTGVuKSByZXMucHVzaChTdHJpbmcoYXJndW1lbnRzW2ldKSk7XG4gICAgfSByZXR1cm4gcmVzLmpvaW4oJycpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJhdy5qc1xuLy8gbW9kdWxlIGlkID0gMjgzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///283\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 21.1.3.25 String.prototype.trim()\n__webpack_require__(65)('trim', function ($trim) {\n return function trim() {\n return $trim(this, 3);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnRyaW0uanM/OWExOSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyAyMS4xLjMuMjUgU3RyaW5nLnByb3RvdHlwZS50cmltKClcbnJlcXVpcmUoJy4vX3N0cmluZy10cmltJykoJ3RyaW0nLCBmdW5jdGlvbiAoJHRyaW0pIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIHRyaW0oKSB7XG4gICAgcmV0dXJuICR0cmltKHRoaXMsIDMpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy50cmltLmpzXG4vLyBtb2R1bGUgaWQgPSAyODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///284\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $at = __webpack_require__(117)(true);\n\n// 21.1.3.27 String.prototype[@@iterator]()\n__webpack_require__(118)(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n this._i = 0; // next index\n// 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return { value: undefined, done: true };\n point = $at(O, index);\n this._i += point.length;\n return { value: point, done: false };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yLmpzP2Q0MGQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRhdCA9IHJlcXVpcmUoJy4vX3N0cmluZy1hdCcpKHRydWUpO1xuXG4vLyAyMS4xLjMuMjcgU3RyaW5nLnByb3RvdHlwZVtAQGl0ZXJhdG9yXSgpXG5yZXF1aXJlKCcuL19pdGVyLWRlZmluZScpKFN0cmluZywgJ1N0cmluZycsIGZ1bmN0aW9uIChpdGVyYXRlZCkge1xuICB0aGlzLl90ID0gU3RyaW5nKGl0ZXJhdGVkKTsgLy8gdGFyZ2V0XG4gIHRoaXMuX2kgPSAwOyAgICAgICAgICAgICAgICAvLyBuZXh0IGluZGV4XG4vLyAyMS4xLjUuMi4xICVTdHJpbmdJdGVyYXRvclByb3RvdHlwZSUubmV4dCgpXG59LCBmdW5jdGlvbiAoKSB7XG4gIHZhciBPID0gdGhpcy5fdDtcbiAgdmFyIGluZGV4ID0gdGhpcy5faTtcbiAgdmFyIHBvaW50O1xuICBpZiAoaW5kZXggPj0gTy5sZW5ndGgpIHJldHVybiB7IHZhbHVlOiB1bmRlZmluZWQsIGRvbmU6IHRydWUgfTtcbiAgcG9pbnQgPSAkYXQoTywgaW5kZXgpO1xuICB0aGlzLl9pICs9IHBvaW50Lmxlbmd0aDtcbiAgcmV0dXJuIHsgdmFsdWU6IHBvaW50LCBkb25lOiBmYWxzZSB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gMjg1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///285\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $at = __webpack_require__(117)(false);\n$export($export.P, 'String', {\n // 21.1.3.3 String.prototype.codePointAt(pos)\n codePointAt: function codePointAt(pos) {\n return $at(this, pos);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmNvZGUtcG9pbnQtYXQuanM/NDVhNyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRhdCA9IHJlcXVpcmUoJy4vX3N0cmluZy1hdCcpKGZhbHNlKTtcbiRleHBvcnQoJGV4cG9ydC5QLCAnU3RyaW5nJywge1xuICAvLyAyMS4xLjMuMyBTdHJpbmcucHJvdG90eXBlLmNvZGVQb2ludEF0KHBvcylcbiAgY29kZVBvaW50QXQ6IGZ1bmN0aW9uIGNvZGVQb2ludEF0KHBvcykge1xuICAgIHJldHVybiAkYXQodGhpcywgcG9zKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5jb2RlLXBvaW50LWF0LmpzXG4vLyBtb2R1bGUgaWQgPSAyODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///286\n")},function(module,exports,__webpack_require__){"use strict";eval("// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])\n\nvar $export = __webpack_require__(0);\nvar toLength = __webpack_require__(14);\nvar context = __webpack_require__(120);\nvar ENDS_WITH = 'endsWith';\nvar $endsWith = ''[ENDS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(121)(ENDS_WITH), 'String', {\n endsWith: function endsWith(searchString /* , endPosition = @length */) {\n var that = context(this, searchString, ENDS_WITH);\n var endPosition = arguments.length > 1 ? arguments[1] : undefined;\n var len = toLength(that.length);\n var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);\n var search = String(searchString);\n return $endsWith\n ? $endsWith.call(that, search, end)\n : that.slice(end - search.length, end) === search;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmVuZHMtd2l0aC5qcz82MzU0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIxLjEuMy42IFN0cmluZy5wcm90b3R5cGUuZW5kc1dpdGgoc2VhcmNoU3RyaW5nIFssIGVuZFBvc2l0aW9uXSlcbid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBjb250ZXh0ID0gcmVxdWlyZSgnLi9fc3RyaW5nLWNvbnRleHQnKTtcbnZhciBFTkRTX1dJVEggPSAnZW5kc1dpdGgnO1xudmFyICRlbmRzV2l0aCA9ICcnW0VORFNfV0lUSF07XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogcmVxdWlyZSgnLi9fZmFpbHMtaXMtcmVnZXhwJykoRU5EU19XSVRIKSwgJ1N0cmluZycsIHtcbiAgZW5kc1dpdGg6IGZ1bmN0aW9uIGVuZHNXaXRoKHNlYXJjaFN0cmluZyAvKiAsIGVuZFBvc2l0aW9uID0gQGxlbmd0aCAqLykge1xuICAgIHZhciB0aGF0ID0gY29udGV4dCh0aGlzLCBzZWFyY2hTdHJpbmcsIEVORFNfV0lUSCk7XG4gICAgdmFyIGVuZFBvc2l0aW9uID0gYXJndW1lbnRzLmxlbmd0aCA+IDEgPyBhcmd1bWVudHNbMV0gOiB1bmRlZmluZWQ7XG4gICAgdmFyIGxlbiA9IHRvTGVuZ3RoKHRoYXQubGVuZ3RoKTtcbiAgICB2YXIgZW5kID0gZW5kUG9zaXRpb24gPT09IHVuZGVmaW5lZCA/IGxlbiA6IE1hdGgubWluKHRvTGVuZ3RoKGVuZFBvc2l0aW9uKSwgbGVuKTtcbiAgICB2YXIgc2VhcmNoID0gU3RyaW5nKHNlYXJjaFN0cmluZyk7XG4gICAgcmV0dXJuICRlbmRzV2l0aFxuICAgICAgPyAkZW5kc1dpdGguY2FsbCh0aGF0LCBzZWFyY2gsIGVuZClcbiAgICAgIDogdGhhdC5zbGljZShlbmQgLSBzZWFyY2gubGVuZ3RoLCBlbmQpID09PSBzZWFyY2g7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuZW5kcy13aXRoLmpzXG4vLyBtb2R1bGUgaWQgPSAyODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///287\n")},function(module,exports,__webpack_require__){"use strict";eval("// 21.1.3.7 String.prototype.includes(searchString, position = 0)\n\nvar $export = __webpack_require__(0);\nvar context = __webpack_require__(120);\nvar INCLUDES = 'includes';\n\n$export($export.P + $export.F * __webpack_require__(121)(INCLUDES), 'String', {\n includes: function includes(searchString /* , position = 0 */) {\n return !!~context(this, searchString, INCLUDES)\n .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///288\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n\n$export($export.P, 'String', {\n // 21.1.3.13 String.prototype.repeat(count)\n repeat: __webpack_require__(114)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJlcGVhdC5qcz9iNmE0Il0sInNvdXJjZXNDb250ZW50IjpbInZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnU3RyaW5nJywge1xuICAvLyAyMS4xLjMuMTMgU3RyaW5nLnByb3RvdHlwZS5yZXBlYXQoY291bnQpXG4gIHJlcGVhdDogcmVxdWlyZSgnLi9fc3RyaW5nLXJlcGVhdCcpXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnJlcGVhdC5qc1xuLy8gbW9kdWxlIGlkID0gMjg5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///289\n")},function(module,exports,__webpack_require__){"use strict";eval("// 21.1.3.18 String.prototype.startsWith(searchString [, position ])\n\nvar $export = __webpack_require__(0);\nvar toLength = __webpack_require__(14);\nvar context = __webpack_require__(120);\nvar STARTS_WITH = 'startsWith';\nvar $startsWith = ''[STARTS_WITH];\n\n$export($export.P + $export.F * __webpack_require__(121)(STARTS_WITH), 'String', {\n startsWith: function startsWith(searchString /* , position = 0 */) {\n var that = context(this, searchString, STARTS_WITH);\n var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));\n var search = String(searchString);\n return $startsWith\n ? $startsWith.call(that, search, index)\n : that.slice(index, index + search.length) === search;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN0YXJ0cy13aXRoLmpzPzBhZjUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjEuMS4zLjE4IFN0cmluZy5wcm90b3R5cGUuc3RhcnRzV2l0aChzZWFyY2hTdHJpbmcgWywgcG9zaXRpb24gXSlcbid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBjb250ZXh0ID0gcmVxdWlyZSgnLi9fc3RyaW5nLWNvbnRleHQnKTtcbnZhciBTVEFSVFNfV0lUSCA9ICdzdGFydHNXaXRoJztcbnZhciAkc3RhcnRzV2l0aCA9ICcnW1NUQVJUU19XSVRIXTtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiByZXF1aXJlKCcuL19mYWlscy1pcy1yZWdleHAnKShTVEFSVFNfV0lUSCksICdTdHJpbmcnLCB7XG4gIHN0YXJ0c1dpdGg6IGZ1bmN0aW9uIHN0YXJ0c1dpdGgoc2VhcmNoU3RyaW5nIC8qICwgcG9zaXRpb24gPSAwICovKSB7XG4gICAgdmFyIHRoYXQgPSBjb250ZXh0KHRoaXMsIHNlYXJjaFN0cmluZywgU1RBUlRTX1dJVEgpO1xuICAgIHZhciBpbmRleCA9IHRvTGVuZ3RoKE1hdGgubWluKGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkLCB0aGF0Lmxlbmd0aCkpO1xuICAgIHZhciBzZWFyY2ggPSBTdHJpbmcoc2VhcmNoU3RyaW5nKTtcbiAgICByZXR1cm4gJHN0YXJ0c1dpdGhcbiAgICAgID8gJHN0YXJ0c1dpdGguY2FsbCh0aGF0LCBzZWFyY2gsIGluZGV4KVxuICAgICAgOiB0aGF0LnNsaWNlKGluZGV4LCBpbmRleCArIHNlYXJjaC5sZW5ndGgpID09PSBzZWFyY2g7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuc3RhcnRzLXdpdGguanNcbi8vIG1vZHVsZSBpZCA9IDI5MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///290\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.2 String.prototype.anchor(name)\n__webpack_require__(25)('anchor', function (createHTML) {\n return function anchor(name) {\n return createHTML(this, 'a', 'name', name);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmFuY2hvci5qcz9mMGRhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjIgU3RyaW5nLnByb3RvdHlwZS5hbmNob3IobmFtZSlcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ2FuY2hvcicsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBhbmNob3IobmFtZSkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICdhJywgJ25hbWUnLCBuYW1lKTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuYW5jaG9yLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///291\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.3 String.prototype.big()\n__webpack_require__(25)('big', function (createHTML) {\n return function big() {\n return createHTML(this, 'big', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJpZy5qcz80NzhhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjMgU3RyaW5nLnByb3RvdHlwZS5iaWcoKVxucmVxdWlyZSgnLi9fc3RyaW5nLWh0bWwnKSgnYmlnJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGJpZygpIHtcbiAgICByZXR1cm4gY3JlYXRlSFRNTCh0aGlzLCAnYmlnJywgJycsICcnKTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5zdHJpbmcuYmlnLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///292\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.4 String.prototype.blink()\n__webpack_require__(25)('blink', function (createHTML) {\n return function blink() {\n return createHTML(this, 'blink', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJsaW5rLmpzP2UxMTkiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuNCBTdHJpbmcucHJvdG90eXBlLmJsaW5rKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ2JsaW5rJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGJsaW5rKCkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICdibGluaycsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJsaW5rLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///293\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.5 String.prototype.bold()\n__webpack_require__(25)('bold', function (createHTML) {\n return function bold() {\n return createHTML(this, 'b', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmJvbGQuanM/ODhjZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBCLjIuMy41IFN0cmluZy5wcm90b3R5cGUuYm9sZCgpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdib2xkJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGJvbGQoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2InLCAnJywgJycpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5ib2xkLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///294\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.6 String.prototype.fixed()\n__webpack_require__(25)('fixed', function (createHTML) {\n return function fixed() {\n return createHTML(this, 'tt', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZpeGVkLmpzPzI3ZTgiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuNiBTdHJpbmcucHJvdG90eXBlLmZpeGVkKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ2ZpeGVkJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGZpeGVkKCkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICd0dCcsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZpeGVkLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///295\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.7 String.prototype.fontcolor(color)\n__webpack_require__(25)('fontcolor', function (createHTML) {\n return function fontcolor(color) {\n return createHTML(this, 'font', 'color', color);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZvbnRjb2xvci5qcz9mMzZhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjcgU3RyaW5nLnByb3RvdHlwZS5mb250Y29sb3IoY29sb3IpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdmb250Y29sb3InLCBmdW5jdGlvbiAoY3JlYXRlSFRNTCkge1xuICByZXR1cm4gZnVuY3Rpb24gZm9udGNvbG9yKGNvbG9yKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2ZvbnQnLCAnY29sb3InLCBjb2xvcik7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZvbnRjb2xvci5qc1xuLy8gbW9kdWxlIGlkID0gMjk2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///296\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.8 String.prototype.fontsize(size)\n__webpack_require__(25)('fontsize', function (createHTML) {\n return function fontsize(size) {\n return createHTML(this, 'font', 'size', size);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmZvbnRzaXplLmpzPzVmZjEiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuOCBTdHJpbmcucHJvdG90eXBlLmZvbnRzaXplKHNpemUpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdmb250c2l6ZScsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBmb250c2l6ZShzaXplKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2ZvbnQnLCAnc2l6ZScsIHNpemUpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5mb250c2l6ZS5qc1xuLy8gbW9kdWxlIGlkID0gMjk3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///297\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.9 String.prototype.italics()\n__webpack_require__(25)('italics', function (createHTML) {\n return function italics() {\n return createHTML(this, 'i', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLml0YWxpY3MuanM/Nzk1MiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBCLjIuMy45IFN0cmluZy5wcm90b3R5cGUuaXRhbGljcygpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdpdGFsaWNzJywgZnVuY3Rpb24gKGNyZWF0ZUhUTUwpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGl0YWxpY3MoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ2knLCAnJywgJycpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5pdGFsaWNzLmpzXG4vLyBtb2R1bGUgaWQgPSAyOThcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///298\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.10 String.prototype.link(url)\n__webpack_require__(25)('link', function (createHTML) {\n return function link(url) {\n return createHTML(this, 'a', 'href', url);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLmxpbmsuanM/NTA5OCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBCLjIuMy4xMCBTdHJpbmcucHJvdG90eXBlLmxpbmsodXJsKVxucmVxdWlyZSgnLi9fc3RyaW5nLWh0bWwnKSgnbGluaycsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBsaW5rKHVybCkge1xuICAgIHJldHVybiBjcmVhdGVIVE1MKHRoaXMsICdhJywgJ2hyZWYnLCB1cmwpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5saW5rLmpzXG4vLyBtb2R1bGUgaWQgPSAyOTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///299\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.11 String.prototype.small()\n__webpack_require__(25)('small', function (createHTML) {\n return function small() {\n return createHTML(this, 'small', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnNtYWxsLmpzPzQ5NGYiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gQi4yLjMuMTEgU3RyaW5nLnByb3RvdHlwZS5zbWFsbCgpXG5yZXF1aXJlKCcuL19zdHJpbmctaHRtbCcpKCdzbWFsbCcsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzbWFsbCgpIHtcbiAgICByZXR1cm4gY3JlYXRlSFRNTCh0aGlzLCAnc21hbGwnLCAnJywgJycpO1xuICB9O1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnN0cmluZy5zbWFsbC5qc1xuLy8gbW9kdWxlIGlkID0gMzAwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///300\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.12 String.prototype.strike()\n__webpack_require__(25)('strike', function (createHTML) {\n return function strike() {\n return createHTML(this, 'strike', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN0cmlrZS5qcz9lNjJjIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjEyIFN0cmluZy5wcm90b3R5cGUuc3RyaWtlKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ3N0cmlrZScsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzdHJpa2UoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ3N0cmlrZScsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN0cmlrZS5qc1xuLy8gbW9kdWxlIGlkID0gMzAxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///301\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.13 String.prototype.sub()\n__webpack_require__(25)('sub', function (createHTML) {\n return function sub() {\n return createHTML(this, 'sub', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1Yi5qcz8xMTZhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjEzIFN0cmluZy5wcm90b3R5cGUuc3ViKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ3N1YicsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzdWIoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ3N1YicsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1Yi5qc1xuLy8gbW9kdWxlIGlkID0gMzAyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///302\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// B.2.3.14 String.prototype.sup()\n__webpack_require__(25)('sup', function (createHTML) {\n return function sup() {\n return createHTML(this, 'sup', '', '');\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1cC5qcz8yNzZhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIEIuMi4zLjE0IFN0cmluZy5wcm90b3R5cGUuc3VwKClcbnJlcXVpcmUoJy4vX3N0cmluZy1odG1sJykoJ3N1cCcsIGZ1bmN0aW9uIChjcmVhdGVIVE1MKSB7XG4gIHJldHVybiBmdW5jdGlvbiBzdXAoKSB7XG4gICAgcmV0dXJuIGNyZWF0ZUhUTUwodGhpcywgJ3N1cCcsICcnLCAnJyk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuc3RyaW5nLnN1cC5qc1xuLy8gbW9kdWxlIGlkID0gMzAzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///303\n")},function(module,exports,__webpack_require__){eval("// 20.3.3.1 / 15.9.4.4 Date.now()\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS5ub3cuanM/NDFhMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMC4zLjMuMSAvIDE1LjkuNC40IERhdGUubm93KClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnRGF0ZScsIHsgbm93OiBmdW5jdGlvbiAoKSB7IHJldHVybiBuZXcgRGF0ZSgpLmdldFRpbWUoKTsgfSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS5ub3cuanNcbi8vIG1vZHVsZSBpZCA9IDMwNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///304\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar toPrimitive = __webpack_require__(36);\n\n$export($export.P + $export.F * __webpack_require__(8)(function () {\n return new Date(NaN).toJSON() !== null\n || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;\n}), 'Date', {\n // eslint-disable-next-line no-unused-vars\n toJSON: function toJSON(key) {\n var O = toObject(this);\n var pv = toPrimitive(O);\n return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1qc29uLmpzP2YxZjgiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBv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J9\n//# sourceURL=webpack-internal:///305\n")},function(module,exports,__webpack_require__){eval("// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar $export = __webpack_require__(0);\nvar toISOString = __webpack_require__(307);\n\n// PhantomJS / old WebKit has a broken implementations\n$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {\n toISOString: toISOString\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1pc28tc3RyaW5nLmpzPzUxYjUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMy40LjM2IC8gMTUuOS41LjQzIERhdGUucHJvdG90eXBlLnRvSVNPU3RyaW5nKClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9JU09TdHJpbmcgPSByZXF1aXJlKCcuL19kYXRlLXRvLWlzby1zdHJpbmcnKTtcblxuLy8gUGhhbnRvbUpTIC8gb2xkIFdlYktpdCBoYXMgYSBicm9rZW4gaW1wbGVtZW50YXRpb25zXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIChEYXRlLnByb3RvdHlwZS50b0lTT1N0cmluZyAhPT0gdG9JU09TdHJpbmcpLCAnRGF0ZScsIHtcbiAgdG9JU09TdHJpbmc6IHRvSVNPU3RyaW5nXG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1pc28tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSAzMDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///306\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()\nvar fails = __webpack_require__(8);\nvar getTime = Date.prototype.getTime;\nvar $toISOString = Date.prototype.toISOString;\n\nvar lz = function (num) {\n return num > 9 ? num : '0' + num;\n};\n\n// PhantomJS / old WebKit has a broken implementations\nmodule.exports = (fails(function () {\n return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';\n}) || !fails(function () {\n $toISOString.call(new Date(NaN));\n})) ? function toISOString() {\n if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');\n var d = this;\n var y = d.getUTCFullYear();\n var m = d.getUTCMilliseconds();\n var s = y < 0 ? '-' : y > 9999 ? '+' : '';\n return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +\n '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +\n 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +\n ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';\n} : $toISOString;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGF0ZS10by1pc28tc3RyaW5nLmpzPzYzYjQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gMjAuMy40LjM2IC8gMTUuOS41LjQzIERhdGUucHJvdG90eXBlLnRvSVNPU3RyaW5nKClcbnZhciBmYWlscyA9IHJlcXVpcmUoJy4vX2ZhaWxzJyk7XG52YXIgZ2V0VGltZSA9IERhdG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seihkLmdldFVUQ1NlY29uZHMoKSkgKyAnLicgKyAobSA+IDk5ID8gbSA6ICcwJyArIGx6KG0pKSArICdaJztcbn0gOiAkdG9JU09TdHJpbmc7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvX2RhdGUtdG8taXNvLXN0cmluZy5qc1xuLy8gbW9kdWxlIGlkID0gMzA3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///307\n")},function(module,exports,__webpack_require__){eval("var DateProto = Date.prototype;\nvar INVALID_DATE = 'Invalid Date';\nvar TO_STRING = 'toString';\nvar $toString = DateProto[TO_STRING];\nvar getTime = DateProto.getTime;\nif (new Date(NaN) + '' != INVALID_DATE) {\n __webpack_require__(24)(DateProto, TO_STRING, function toString() {\n var value = getTime.call(this);\n // eslint-disable-next-line no-self-compare\n return value === value ? $toString.call(this) : INVALID_DATE;\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1zdHJpbmcuanM/NDY0ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgRGF0ZVByb3RvID0gRGF0ZS5wcm90b3R5cGU7XG52YXIgSU5WQUxJRF9EQVRFID0gJ0ludmFsaWQgRGF0ZSc7XG52YXIgVE9fU1RSSU5HID0gJ3RvU3RyaW5nJztcbnZhciAkdG9TdHJpbmcgPSBEYXRlUHJvdG9bVE9fU1RSSU5HXTtcbnZhciBnZXRUaW1lID0gRGF0ZVByb3RvLmdldFRpbWU7XG5pZiAobmV3IERhdGUoTmFOKSArICcnICE9IElOVkFMSURfREFURSkge1xuICByZXF1aXJlKCcuL19yZWRlZmluZScpKERhdGVQcm90bywgVE9fU1RSSU5HLCBmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICB2YXIgdmFsdWUgPSBnZXRUaW1lLmNhbGwodGhpcyk7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXNlbGYtY29tcGFyZVxuICAgIHJldHVybiB2YWx1ZSA9PT0gdmFsdWUgPyAkdG9TdHJpbmcuY2FsbCh0aGlzKSA6IElOVkFMSURfREFURTtcbiAgfSk7XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmRhdGUudG8tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSAzMDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///308\n")},function(module,exports,__webpack_require__){eval("var TO_PRIMITIVE = __webpack_require__(10)('toPrimitive');\nvar proto = Date.prototype;\n\nif (!(TO_PRIMITIVE in proto)) __webpack_require__(23)(proto, TO_PRIMITIVE, __webpack_require__(310));\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuZGF0ZS50by1wcmltaXRpdmUuanM/ZTEwZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgVE9fUFJJTUlUSVZFID0gcmVxdWlyZSgnLi9fd2tzJykoJ3RvUHJpbWl0aXZlJyk7XG52YXIgcHJvdG8gPSBEYXRlLnByb3RvdHlwZTtcblxuaWYgKCEoVE9fUFJJTUlUSVZFIGluIHByb3RvKSkgcmVxdWlyZSgnLi9faGlkZScpKHByb3RvLCBUT19QUklNSVRJVkUsIHJlcXVpcmUoJy4vX2RhdGUtdG8tcHJpbWl0aXZlJykpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5kYXRlLnRvLXByaW1pdGl2ZS5qc1xuLy8gbW9kdWxlIGlkID0gMzA5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///309\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar anObject = __webpack_require__(5);\nvar toPrimitive = __webpack_require__(36);\nvar NUMBER = 'number';\n\nmodule.exports = function (hint) {\n if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');\n return toPrimitive(anObject(this), hint != NUMBER);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGF0ZS10by1wcmltaXRpdmUuanM/OGMxZCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciB0b1ByaW1pdGl2ZSA9IHJlcXVpcmUoJy4vX3RvLXByaW1pdGl2ZScpO1xudmFyIE5VTUJFUiA9ICdudW1iZXInO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChoaW50KSB7XG4gIGlmIChoaW50ICE9PSAnc3RyaW5nJyAmJiBoaW50ICE9PSBOVU1CRVIgJiYgaGludCAhPT0gJ2RlZmF1bHQnKSB0aHJvdyBUeXBlRXJyb3IoJ0luY29ycmVjdCBoaW50Jyk7XG4gIHJldHVybiB0b1ByaW1pdGl2ZShhbk9iamVjdCh0aGlzKSwgaGludCAhPSBOVU1CRVIpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fZGF0ZS10by1wcmltaXRpdmUuanNcbi8vIG1vZHVsZSBpZCA9IDMxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///310\n")},function(module,exports,__webpack_require__){eval("// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Array', { isArray: __webpack_require__(86) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaXMtYXJyYXkuanM/MjBjNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjIuMiAvIDE1LjQuMy4yIEFycmF5LmlzQXJyYXkoYXJnKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdBcnJheScsIHsgaXNBcnJheTogcmVxdWlyZSgnLi9faXMtYXJyYXknKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuaXMtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDMxMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///311\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar ctx = __webpack_require__(33);\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar call = __webpack_require__(169);\nvar isArrayIter = __webpack_require__(122);\nvar toLength = __webpack_require__(14);\nvar createProperty = __webpack_require__(123);\nvar getIterFn = __webpack_require__(124);\n\n$export($export.S + $export.F * !__webpack_require__(88)(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZnJvbS5qcz82ZGUxIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBjdHggPSByZXF1aXJlKCcuL19jdHgnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgdG9PYmplY3QgPSByZXF1aXJlKCcuL190by1vYmplY3QnKTtcbnZhciBjYWxsID0gcmVxdWlyZSgnLi9faXRlci1jYWxsJyk7XG52YXIgaXNBcnJheUl0ZXIgPSByZXF1aXJlKCcuL19pcy1hcnJheS1pdGVyJyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBjcmVhdGVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX2NyZWF0ZS1wcm9wZXJ0eScpO1xudmFyIGdldEl0ZXJGbiA9IHJlcXVpcmUoJy4vY29yZS5nZXQtaXRlcmF0b3ItbWV0aG9kJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2l0ZXItZGV0ZWN0JykoZnVuY3Rpb24gKGl0ZXIpIHsgQXJyYXkuZnJvbShpdGVyKTsgfSksICdBcnJheScsIHtcbiAgLy8gMjIuMS4yLjEgQXJyYXkuZnJvbShhcnJheUx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mRleCwgbWFwcGluZyA/IGNhbGwoaXRlcmF0b3IsIG1hcGZuLCBbc3RlcC52YWx1ZSwgaW5kZXhdLCB0cnVlKSA6IHN0ZXAudmFsdWUpO1xuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBsZW5ndGggPSB0b0xlbmd0aChPLmxlbmd0aCk7XG4gICAgICBmb3IgKHJlc3VsdCA9IG5ldyBDKGxlbmd0aCk7IGxlbmd0aCA+IGluZGV4OyBpbmRleCsrKSB7XG4gICAgICAgIGNyZWF0ZVByb3BlcnR5KHJlc3VsdCwgaW5kZXgsIG1hcHBpbmcgPyBtYXBmbihPW2luZGV4XSwgaW5kZXgpIDogT1tpbmRleF0pO1xuICAgICAgfVxuICAgIH1cbiAgICByZXN1bHQubGVuZ3RoID0gaW5kZXg7XG4gICAgcmV0dXJuIHJlc3VsdDtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDMxMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///312\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar createProperty = __webpack_require__(123);\n\n// WebKit Array.of isn't generic\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n function F() { /* empty */ }\n return !(Array.of.call(F) instanceof F);\n}), 'Array', {\n // 22.1.2.3 Array.of( ...items)\n of: function of(/* ...args */) {\n var index = 0;\n var aLen = arguments.length;\n var result = new (typeof this == 'function' ? this : Array)(aLen);\n while (aLen > index) createProperty(result, index, arguments[index++]);\n result.length = aLen;\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkub2YuanM/YzRjYSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNyZWF0ZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fY3JlYXRlLXByb3BlcnR5Jyk7XG5cbi8vIFdlYktpdCBBcnJheS5vZiBpc24ndCBnZW5lcmljXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqIHJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICBmdW5jdGlvbiBGKCkgeyAvKiBlbXB0eSAqLyB9XG4gIHJldHVybiAhKEFycmF5Lm9mLmNhbGwoRikgaW5zdGFuY2VvZiBGKTtcbn0pLCAnQXJyYXknLCB7XG4gIC8vIDIyLjEuMi4zIEFycmF5Lm9mKCAuLi5pdGVtcylcbiAgb2Y6IGZ1bmN0aW9uIG9mKC8qIC4uLmFyZ3MgKi8pIHtcbiAgICB2YXIgaW5kZXggPSAwO1xuICAgIHZhciBhTGVuID0gYXJndW1lbnRzLmxlbmd0aDtcbiAgICB2YXIgcmVzdWx0ID0gbmV3ICh0eXBlb2YgdGhpcyA9PSAnZnVuY3Rpb24nID8gdGhpcyA6IEFycmF5KShhTGVuKTtcbiAgICB3aGlsZSAoYUxlbiA+IGluZGV4KSBjcmVhdGVQcm9wZXJ0eShyZXN1bHQsIGluZGV4LCBhcmd1bWVudHNbaW5kZXgrK10pO1xuICAgIHJlc3VsdC5sZW5ndGggPSBhTGVuO1xuICAgIHJldHVybiByZXN1bHQ7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5vZi5qc1xuLy8gbW9kdWxlIGlkID0gMzEzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///313\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 22.1.3.13 Array.prototype.join(separator)\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(28);\nvar arrayJoin = [].join;\n\n// fallback for not array-like strings\n$export($export.P + $export.F * (__webpack_require__(73) != Object || !__webpack_require__(35)(arrayJoin)), 'Array', {\n join: function join(separator) {\n return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuam9pbi5qcz84ZjhkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIyLjEuMy4xMyBBcnJheS5wcm90b3R5cGUuam9pbihzZXBhcmF0b3IpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciBhcnJheUpvaW4gPSBbXS5qb2luO1xuXG4vLyBmYWxsYmFjayBmb3Igbm90IGFycmF5LWxpa2Ugc3RyaW5nc1xuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAocmVxdWlyZSgnLi9faW9iamVjdCcpICE9IE9iamVjdCB8fCAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKGFycmF5Sm9pbikpLCAnQXJyYXknLCB7XG4gIGpvaW46IGZ1bmN0aW9uIGpvaW4oc2VwYXJhdG9yKSB7XG4gICAgcmV0dXJuIGFycmF5Sm9pbi5jYWxsKHRvSU9iamVjdCh0aGlzKSwgc2VwYXJhdG9yID09PSB1bmRlZmluZWQgPyAnLCcgOiBzZXBhcmF0b3IpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuam9pbi5qc1xuLy8gbW9kdWxlIGlkID0gMzE0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///314\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar html = __webpack_require__(110);\nvar cof = __webpack_require__(34);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\nvar arraySlice = [].slice;\n\n// fallback for not array-like ES3 strings and DOM objects\n$export($export.P + $export.F * __webpack_require__(8)(function () {\n if (html) arraySlice.call(html);\n}), 'Array', {\n slice: function slice(begin, end) {\n var len = toLength(this.length);\n var klass = cof(this);\n end = end === undefined ? len : end;\n if (klass == 'Array') return arraySlice.call(this, begin, end);\n var start = toAbsoluteIndex(begin, len);\n var upTo = toAbsoluteIndex(end, len);\n var size = toLength(upTo - start);\n var cloned = new Array(size);\n var i = 0;\n for (; i < size; i++) cloned[i] = klass == 'String'\n ? this.charAt(start + i)\n : this[start + i];\n return cloned;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc2xpY2UuanM/ZjM1NyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGh0bWwgPSByZXF1aXJlKCcuL19odG1sJyk7XG52YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xudmFyIGFycmF5U2xpY2UgPSBbXS5zbGljZTtcblxuLy8gZmFsbGJhY2sgZm9yIG5vdCBhcnJheS1saWtlIEVTMyBzdHJpbmdzIGFuZCBET00gb2JqZWN0c1xuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiByZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgaWYgKGh0bWwpIGFycmF5U2xpY2UuY2FsbChodG1sKTtcb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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///315\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(20);\nvar toObject = __webpack_require__(19);\nvar fails = __webpack_require__(8);\nvar $sort = [].sort;\nvar test = [1, 2, 3];\n\n$export($export.P + $export.F * (fails(function () {\n // IE8-\n test.sort(undefined);\n}) || !fails(function () {\n // V8 bug\n test.sort(null);\n // Old WebKit\n}) || !__webpack_require__(35)($sort)), 'Array', {\n // 22.1.3.25 Array.prototype.sort(comparefn)\n sort: function sort(comparefn) {\n return comparefn === undefined\n ? $sort.call(toObject(this))\n : $sort.call(toObject(this), aFunction(comparefn));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29ydC5qcz9iODM2Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgYUZ1bmN0aW9uID0gcmVxdWlyZSgnLi9fYS1mdW5jdGlvbicpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgZmFpbHMgPSByZXF1aXJlKCcuL19mYWlscycpO1xudmFyICRzb3J0ID0gW10uc29ydDtcbnZhciB0ZXN0ID0gWzEsIDIsIDNdO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIChmYWlscyhmdW5jdGlvbiAoKSB7XG4gIC8vIElFOC1cbiAgdGVzdC5zb3J0KHVuZGVmaW5lZCk7XG59KSB8fCAhZmFpbHMoZnVuY3Rpb24gKCkge1xuICAvLyBWOCBidWdcbiAgdGVzdC5zb3J0KG51bGwpO1xuICAvLyBPbGQgV2ViS2l0XG59KSB8fCAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKCRzb3J0KSksICdBcnJheScsIHtcbiAgLy8gMjIuMS4zLjI1IEFycmF5LnByb3RvdHlwZS5zb3J0KGNvbXBhcmVmbilcbiAgc29ydDogZnVuY3Rpb24gc29ydChjb21wYXJlZm4pIHtcbiAgICByZXR1cm4gY29tcGFyZWZuID09PSB1bmRlZmluZWRcbiAgICAgID8gJHNvcnQuY2FsbCh0b09iamVjdCh0aGlzKSlcbiAgICAgIDogJHNvcnQuY2FsbCh0b09iamVjdCh0aGlzKSwgYUZ1bmN0aW9uKGNvbXBhcmVmbikpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29ydC5qc1xuLy8gbW9kdWxlIGlkID0gMzE2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///316\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $forEach = __webpack_require__(40)(0);\nvar STRICT = __webpack_require__(35)([].forEach, true);\n\n$export($export.P + $export.F * !STRICT, 'Array', {\n // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])\n forEach: function forEach(callbackfn /* , thisArg */) {\n return $forEach(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZm9yLWVhY2guanM/MDg0MyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRmb3JFYWNoID0gcmVxdWlyZSgnLi9fYXJyYXktbWV0aG9kcycpKDApO1xudmFyIFNUUklDVCA9IHJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5mb3JFYWNoLCB0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAhU1RSSUNULCAnQXJyYXknLCB7XG4gIC8vIDIyLjEuMy4xMCAvIDE1LjQuNC4xOCBBcnJheS5wcm90b3R5cGUuZm9yRWFjaChjYWxsYmFja2ZuIFssIHRoaXNBcmddKVxuICBmb3JFYWNoOiBmdW5jdGlvbiBmb3JFYWNoKGNhbGxiYWNrZm4gLyogLCB0aGlzQXJnICovKSB7XG4gICAgcmV0dXJuICRmb3JFYWNoKHRoaXMsIGNhbGxiYWNrZm4sIGFyZ3VtZW50c1sxXSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5mb3ItZWFjaC5qc1xuLy8gbW9kdWxlIGlkID0gMzE3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///317\n")},function(module,exports,__webpack_require__){eval("var isObject = __webpack_require__(9);\nvar isArray = __webpack_require__(86);\nvar SPECIES = __webpack_require__(10)('species');\n\nmodule.exports = function (original) {\n var C;\n if (isArray(original)) {\n C = original.constructor;\n // cross-realm fallback\n if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;\n if (isObject(C)) {\n C = C[SPECIES];\n if (C === null) C = undefined;\n }\n } return C === undefined ? Array : C;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fYXJyYXktc3BlY2llcy1jb25zdHJ1Y3Rvci5qcz82ZThhIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGlzQXJyYXkgPSByZXF1aXJlKCcuL19pcy1hcnJheScpO1xudmFyIFNQRUNJRVMgPSByZXF1aXJlKCcuL193a3MnKSgnc3BlY2llcycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChvcmlnaW5hbCkge1xuICB2YXIgQztcbiAgaWYgKGlzQXJyYXkob3JpZ2luYWwpKSB7XG4gICAgQyA9IG9yaWdpbmFsLmNvbnN0cnVjdG9yO1xuICAgIC8vIGNyb3NzLXJlYWxtIGZhbGxiYWNrXG4gICAgaWYgKHR5cGVvZiBDID09ICdmdW5jdGlvbicgJiYgKEMgPT09IEFycmF5IHx8IGlzQXJyYXkoQy5wcm90b3R5cGUpKSkgQyA9IHVuZGVmaW5lZDtcbiAgICBpZiAoaXNPYmplY3QoQykpIHtcbiAgICAgIEMgPSBDW1NQRUNJRVNdO1xuICAgICAgaWYgKEMgPT09IG51bGwpIEMgPSB1bmRlZmluZWQ7XG4gICAgfVxuICB9IHJldHVybiBDID09PSB1bmRlZmluZWQgPyBBcnJheSA6IEM7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL19hcnJheS1zcGVjaWVzLWNvbnN0cnVjdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSAzMThcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///318\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $map = __webpack_require__(40)(1);\n\n$export($export.P + $export.F * !__webpack_require__(35)([].map, true), 'Array', {\n // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])\n map: function map(callbackfn /* , thisArg */) {\n return $map(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkubWFwLmpzP2MzYTUiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkbWFwID0gcmVxdWlyZSgnLi9fYXJyYXktbWV0aG9kcycpKDEpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqICFyZXF1aXJlKCcuL19zdHJpY3QtbWV0aG9kJykoW10ubWFwLCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuMTUgLyAxNS40LjQuMTkgQXJyYXkucHJvdG90eXBlLm1hcChjYWxsYmFja2ZuIFssIHRoaXNBcmddKVxuICBtYXA6IGZ1bmN0aW9uIG1hcChjYWxsYmFja2ZuIC8qICwgdGhpc0FyZyAqLykge1xuICAgIHJldHVybiAkbWFwKHRoaXMsIGNhbGxiYWNrZm4sIGFyZ3VtZW50c1sxXSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5tYXAuanNcbi8vIG1vZHVsZSBpZCA9IDMxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///319\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $filter = __webpack_require__(40)(2);\n\n$export($export.P + $export.F * !__webpack_require__(35)([].filter, true), 'Array', {\n // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])\n filter: function filter(callbackfn /* , thisArg */) {\n return $filter(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmlsdGVyLmpzPzdjZTciXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkZmlsdGVyID0gcmVxdWlyZSgnLi9fYXJyYXktbWV0aG9kcycpKDIpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqICFyZXF1aXJlKCcuL19zdHJpY3QtbWV0aG9kJykoW10uZmlsdGVyLCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuNyAvIDE1LjQuNC4yMCBBcnJheS5wcm90b3R5cGUuZmlsdGVyKGNhbGxiYWNrZm4gWywgdGhpc0FyZ10pXG4gIGZpbHRlcjogZnVuY3Rpb24gZmlsdGVyKGNhbGxiYWNrZm4gLyogLCB0aGlzQXJnICovKSB7XG4gICAgcmV0dXJuICRmaWx0ZXIodGhpcywgY2FsbGJhY2tmbiwgYXJndW1lbnRzWzFdKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmZpbHRlci5qc1xuLy8gbW9kdWxlIGlkID0gMzIwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///320\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $some = __webpack_require__(40)(3);\n\n$export($export.P + $export.F * !__webpack_require__(35)([].some, true), 'Array', {\n // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])\n some: function some(callbackfn /* , thisArg */) {\n return $some(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29tZS5qcz9jMTU3Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJHNvbWUgPSByZXF1aXJlKCcuL19hcnJheS1tZXRob2RzJykoMyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5zb21lLCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuMjMgLyAxNS40LjQuMTcgQXJyYXkucHJvdG90eXBlLnNvbWUoY2FsbGJhY2tmbiBbLCB0aGlzQXJnXSlcbiAgc29tZTogZnVuY3Rpb24gc29tZShjYWxsYmFja2ZuIC8qICwgdGhpc0FyZyAqLykge1xuICAgIHJldHVybiAkc29tZSh0aGlzLCBjYWxsYmFja2ZuLCBhcmd1bWVudHNbMV0pO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc29tZS5qc1xuLy8gbW9kdWxlIGlkID0gMzIxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///321\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $every = __webpack_require__(40)(4);\n\n$export($export.P + $export.F * !__webpack_require__(35)([].every, true), 'Array', {\n // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])\n every: function every(callbackfn /* , thisArg */) {\n return $every(this, callbackfn, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZXZlcnkuanM/MzY0YSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRldmVyeSA9IHJlcXVpcmUoJy4vX2FycmF5LW1ldGhvZHMnKSg0KTtcblxuJGV4cG9ydCgkZXhwb3J0LlAgKyAkZXhwb3J0LkYgKiAhcmVxdWlyZSgnLi9fc3RyaWN0LW1ldGhvZCcpKFtdLmV2ZXJ5LCB0cnVlKSwgJ0FycmF5Jywge1xuICAvLyAyMi4xLjMuNSAvIDE1LjQuNC4xNiBBcnJheS5wcm90b3R5cGUuZXZlcnkoY2FsbGJhY2tmbiBbLCB0aGlzQXJnXSlcbiAgZXZlcnk6IGZ1bmN0aW9uIGV2ZXJ5KGNhbGxiYWNrZm4gLyogLCB0aGlzQXJnICovKSB7XG4gICAgcmV0dXJuICRldmVyeSh0aGlzLCBjYWxsYmFja2ZuLCBhcmd1bWVudHNbMV0pO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZXZlcnkuanNcbi8vIG1vZHVsZSBpZCA9IDMyMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///322\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $reduce = __webpack_require__(170);\n\n$export($export.P + $export.F * !__webpack_require__(35)([].reduce, true), 'Array', {\n // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])\n reduce: function reduce(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], false);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkucmVkdWNlLmpzP2MyNzQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcmVkdWNlID0gcmVxdWlyZSgnLi9fYXJyYXktcmVkdWNlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5yZWR1Y2UsIHRydWUpLCAnQXJyYXknLCB7XG4gIC8vIDIyLjEuMy4xOCAvIDE1LjQuNC4yMSBBcnJheS5wcm90b3R5cGUucmVkdWNlKGNhbGxiYWNrZm4gWywgaW5pdGlhbFZhbHVlXSlcbiAgcmVkdWNlOiBmdW5jdGlvbiByZWR1Y2UoY2FsbGJhY2tmbiAvKiAsIGluaXRpYWxWYWx1ZSAqLykge1xuICAgIHJldHVybiAkcmVkdWNlKHRoaXMsIGNhbGxiYWNrZm4sIGFyZ3VtZW50cy5sZW5ndGgsIGFyZ3VtZW50c1sxXSwgZmFsc2UpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkucmVkdWNlLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///323\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $reduce = __webpack_require__(170);\n\n$export($export.P + $export.F * !__webpack_require__(35)([].reduceRight, true), 'Array', {\n // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])\n reduceRight: function reduceRight(callbackfn /* , initialValue */) {\n return $reduce(this, callbackfn, arguments.length, arguments[1], true);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkucmVkdWNlLXJpZ2h0LmpzPzk2NDQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkcmVkdWNlID0gcmVxdWlyZSgnLi9fYXJyYXktcmVkdWNlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3N0cmljdC1tZXRob2QnKShbXS5yZWR1Y2VSaWdodCwgdHJ1ZSksICdBcnJheScsIHtcbiAgLy8gMjIuMS4zLjE5IC8gMTUuNC40LjIyIEFycmF5LnByb3RvdHlwZS5yZWR1Y2VSaWdodChjYWxsYmFja2ZuIFssIGluaXRpYWxWYWx1ZV0pXG4gIHJlZHVjZVJpZ2h0OiBmdW5jdGlvbiByZWR1Y2VSaWdodChjYWxsYmFja2ZuIC8qICwgaW5pdGlhbFZhbHVlICovKSB7XG4gICAgcmV0dXJuICRyZWR1Y2UodGhpcywgY2FsbGJhY2tmbiwgYXJndW1lbnRzLmxlbmd0aCwgYXJndW1lbnRzWzFdLCB0cnVlKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LnJlZHVjZS1yaWdodC5qc1xuLy8gbW9kdWxlIGlkID0gMzI0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///324\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar $indexOf = __webpack_require__(84)(false);\nvar $native = [].indexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(35)($native)), 'Array', {\n // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])\n indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {\n return NEGATIVE_ZERO\n // convert -0 to +0\n ? $native.apply(this, arguments) || 0\n : $indexOf(this, searchElement, arguments[1]);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2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3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmluZGV4LW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///325\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toIObject = __webpack_require__(28);\nvar toInteger = __webpack_require__(38);\nvar toLength = __webpack_require__(14);\nvar $native = [].lastIndexOf;\nvar NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;\n\n$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(35)($native)), 'Array', {\n // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])\n lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {\n // convert -0 to +0\n if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;\n var O = toIObject(this);\n var length = toLength(O.length);\n var index = length - 1;\n if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));\n if (index < 0) index = length + index;\n for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;\n return -1;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkubGFzdC1pbmRleC1vZi5qcz9hMDcyIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb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bmRleDtcbiAgICBmb3IgKDtpbmRleCA+PSAwOyBpbmRleC0tKSBpZiAoaW5kZXggaW4gTykgaWYgKE9baW5kZXhdID09PSBzZWFyY2hFbGVtZW50KSByZXR1cm4gaW5kZXggfHwgMDtcbiAgICByZXR1cm4gLTE7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5sYXN0LWluZGV4LW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///326\n")},function(module,exports,__webpack_require__){eval("// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Array', { copyWithin: __webpack_require__(171) });\n\n__webpack_require__(49)('copyWithin');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuY29weS13aXRoaW4uanM/ZjZmNyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyMi4xLjMuMyBBcnJheS5wcm90b3R5cGUuY29weVdpdGhpbih0YXJnZXQsIHN0YXJ0LCBlbmQgPSB0aGlzLmxlbmd0aClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QLCAnQXJyYXknLCB7IGNvcHlXaXRoaW46IHJlcXVpcmUoJy4vX2FycmF5LWNvcHktd2l0aGluJykgfSk7XG5cbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKCdjb3B5V2l0aGluJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmNvcHktd2l0aGluLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///327\n")},function(module,exports,__webpack_require__){eval("// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)\nvar $export = __webpack_require__(0);\n\n$export($export.P, 'Array', { fill: __webpack_require__(126) });\n\n__webpack_require__(49)('fill');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmlsbC5qcz8zNjhlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIyLjEuMy42IEFycmF5LnByb3RvdHlwZS5maWxsKHZhbHVlLCBzdGFydCA9IDAsIGVuZCA9IHRoaXMubGVuZ3RoKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAsICdBcnJheScsIHsgZmlsbDogcmVxdWlyZSgnLi9fYXJyYXktZmlsbCcpIH0pO1xuXG5yZXF1aXJlKCcuL19hZGQtdG8tdW5zY29wYWJsZXMnKSgnZmlsbCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5hcnJheS5maWxsLmpzXG4vLyBtb2R1bGUgaWQgPSAzMjhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///328\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)\nvar $export = __webpack_require__(0);\nvar $find = __webpack_require__(40)(5);\nvar KEY = 'find';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n find: function find(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(49)(KEY);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmluZC5qcz81YTk0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIyLjEuMy44IEFycmF5LnByb3RvdHlwZS5maW5kKHByZWRpY2F0ZSwgdGhpc0FyZyA9IHVuZGVmaW5lZClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGZpbmQgPSByZXF1aXJlKCcuL19hcnJheS1tZXRob2RzJykoNSk7XG52YXIgS0VZID0gJ2ZpbmQnO1xudmFyIGZvcmNlZCA9IHRydWU7XG4vLyBTaG91bGRuJ3Qgc2tpcCBob2xlc1xuaWYgKEtFWSBpbiBbXSkgQXJyYXkoMSlbS0VZXShmdW5jdGlvbiAoKSB7IGZvcmNlZCA9IGZhbHNlOyB9KTtcbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5GICogZm9yY2VkLCAnQXJyYXknLCB7XG4gIGZpbmQ6IGZ1bmN0aW9uIGZpbmQoY2FsbGJhY2tmbiAvKiAsIHRoYXQgPSB1bmRlZmluZWQgKi8pIHtcbiAgICByZXR1cm4gJGZpbmQodGhpcywgY2FsbGJhY2tmbiwgYXJndW1lbnRzLmxlbmd0aCA+IDEgPyBhcmd1bWVudHNbMV0gOiB1bmRlZmluZWQpO1xuICB9XG59KTtcbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKEtFWSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LmZpbmQuanNcbi8vIG1vZHVsZSBpZCA9IDMyOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///329\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)\nvar $export = __webpack_require__(0);\nvar $find = __webpack_require__(40)(6);\nvar KEY = 'findIndex';\nvar forced = true;\n// Shouldn't skip holes\nif (KEY in []) Array(1)[KEY](function () { forced = false; });\n$export($export.P + $export.F * forced, 'Array', {\n findIndex: function findIndex(callbackfn /* , that = undefined */) {\n return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n__webpack_require__(49)(KEY);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmluZC1pbmRleC5qcz81M2FhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIDIyLjEuMy45IEFycmF5LnByb3RvdHlwZS5maW5kSW5kZXgocHJlZGljYXRlLCB0aGlzQXJnID0gdW5kZWZpbmVkKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkZmluZCA9IHJlcXVpcmUoJy4vX2FycmF5LW1ldGhvZHMnKSg2KTtcbnZhciBLRVkgPSAnZmluZEluZGV4JztcbnZhciBmb3JjZWQgPSB0cnVlO1xuLy8gU2hvdWxkbid0IHNraXAgaG9sZXNcbmlmIChLRVkgaW4gW10pIEFycmF5KDEpW0tFWV0oZnVuY3Rpb24gKCkgeyBmb3JjZWQgPSBmYWxzZTsgfSk7XG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIGZvcmNlZCwgJ0FycmF5Jywge1xuICBmaW5kSW5kZXg6IGZ1bmN0aW9uIGZpbmRJbmRleChjYWxsYmFja2ZuIC8qICwgdGhhdCA9IHVuZGVmaW5lZCAqLykge1xuICAgIHJldHVybiAkZmluZCh0aGlzLCBjYWxsYmFja2ZuLCBhcmd1bWVudHMubGVuZ3RoID4gMSA/IGFyZ3VtZW50c1sxXSA6IHVuZGVmaW5lZCk7XG4gIH1cbn0pO1xucmVxdWlyZSgnLi9fYWRkLXRvLXVuc2NvcGFibGVzJykoS0VZKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuZmluZC1pbmRleC5qc1xuLy8gbW9kdWxlIGlkID0gMzMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///330\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(58)('Array');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYuYXJyYXkuc3BlY2llcy5qcz80M2YwIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3NldC1zcGVjaWVzJykoJ0FycmF5Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LmFycmF5LnNwZWNpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDMzMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///331\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(7);\nvar inheritIfRequired = __webpack_require__(113);\nvar dP = __webpack_require__(13).f;\nvar gOPN = __webpack_require__(57).f;\nvar isRegExp = __webpack_require__(87);\nvar $flags = __webpack_require__(89);\nvar $RegExp = global.RegExp;\nvar Base = $RegExp;\nvar proto = $RegExp.prototype;\nvar re1 = /a/g;\nvar re2 = /a/g;\n// \"new\" creates a new object, old webkit buggy here\nvar CORRECT_NEW = new $RegExp(re1) !== re1;\n\nif (__webpack_require__(12) && (!CORRECT_NEW || __webpack_require__(8)(function () {\n re2[__webpack_require__(10)('match')] = false;\n // RegExp constructor can alter flags and IsRegExp works correct with @@match\n return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';\n}))) {\n $RegExp = function RegExp(p, f) {\n var tiRE = this instanceof $RegExp;\n var piRE = isRegExp(p);\n var fiU = f === undefined;\n return !tiRE && piRE && p.constructor === $RegExp && fiU ? p\n : inheritIfRequired(CORRECT_NEW\n ? new Base(piRE && !fiU ? p.source : p, f)\n : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)\n , tiRE ? this : proto, $RegExp);\n };\n var proxy = function (key) {\n key in $RegExp || dP($RegExp, key, {\n configurable: true,\n get: function () { return Base[key]; },\n set: function (it) { Base[key] = it; }\n });\n };\n for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);\n proto.constructor = $RegExp;\n $RegExp.prototype = proto;\n __webpack_require__(24)(global, 'RegExp', $RegExp);\n}\n\n__webpack_require__(58)('RegExp');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLmNvbnN0cnVjdG9yLmpzPzk2NzYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIGluaGVyaXRJZlJlcXVpcmVkID0gcmVxdWlyZSgnLi9faW5oZXJpdC1pZi1yZXF1aXJlZCcpO1xudmFyIGRQID0gcmVxdWlyZSgnLi9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Ni5yZWdleHAuY29uc3RydWN0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDMzMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///332\n")},function(module,exports,__webpack_require__){"use strict";eval("\n__webpack_require__(173);\nvar anObject = __webpack_require__(5);\nvar $flags = __webpack_require__(89);\nvar DESCRIPTORS = __webpack_require__(12);\nvar TO_STRING = 'toString';\nvar $toString = /./[TO_STRING];\n\nvar define = function (fn) {\n __webpack_require__(24)(RegExp.prototype, TO_STRING, fn, true);\n};\n\n// 21.2.5.14 RegExp.prototype.toString()\nif (__webpack_require__(8)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {\n define(function toString() {\n var R = anObject(this);\n return '/'.concat(R.source, '/',\n 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);\n });\n// FF44- RegExp#toString has a wrong name\n} else if ($toString.name != TO_STRING) {\n define(function toString() {\n return $toString.call(this);\n });\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVn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fU1RSSU5HKSB7XG4gIGRlZmluZShmdW5jdGlvbiB0b1N0cmluZygpIHtcbiAgICByZXR1cm4gJHRvU3RyaW5nLmNhbGwodGhpcyk7XG4gIH0pO1xufVxuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAudG8tc3RyaW5nLmpzXG4vLyBtb2R1bGUgaWQgPSAzMzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///333\n")},function(module,exports,__webpack_require__){eval("// @@match logic\n__webpack_require__(90)('match', 1, function (defined, MATCH, $match) {\n // 21.1.3.11 String.prototype.match(regexp)\n return [function match(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[MATCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));\n }, $match];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLm1hdGNoLmpzPzMxZjciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gQEBtYXRjaCBsb2dpY1xucmVxdWlyZSgnLi9fZml4LXJlLXdrcycpKCdtYXRjaCcsIDEsIGZ1bmN0aW9uIChkZWZpbmVkLCBNQVRDSCwgJG1hdGNoKSB7XG4gIC8vIDIxLjEuMy4xMSBTdHJpbmcucHJvdG90eXBlLm1hdGNoKHJlZ2V4cClcbiAgcmV0dXJuIFtmdW5jdGlvbiBtYXRjaChyZWdleHApIHtcbiAgICAndXNlIHN0cmljdCc7XG4gICAgdmFyIE8gPSBkZWZpbmVkKHRoaXMpO1xuICAgIHZhciBmbiA9IHJlZ2V4cCA9PSB1bmRlZmluZWQgPyB1bmRlZmluZWQgOiByZWdleHBbTUFUQ0hdO1xuICAgIHJldHVybiBmbiAhPT0gdW5kZWZpbmVkID8gZm4uY2FsbChyZWdleHAsIE8pIDogbmV3IFJlZ0V4cChyZWdleHApW01BVENIXShTdHJpbmcoTykpO1xuICB9LCAkbWF0Y2hdO1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZ2V4cC5tYXRjaC5qc1xuLy8gbW9kdWxlIGlkID0gMzM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///334\n")},function(module,exports,__webpack_require__){eval("// @@replace logic\n__webpack_require__(90)('replace', 2, function (defined, REPLACE, $replace) {\n // 21.1.3.14 String.prototype.replace(searchValue, replaceValue)\n return [function replace(searchValue, replaceValue) {\n 'use strict';\n var O = defined(this);\n var fn = searchValue == undefined ? undefined : searchValue[REPLACE];\n return fn !== undefined\n ? fn.call(searchValue, O, replaceValue)\n : $replace.call(String(O), searchValue, replaceValue);\n }, $replace];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxl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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///335\n")},function(module,exports,__webpack_require__){eval("// @@search logic\n__webpack_require__(90)('search', 1, function (defined, SEARCH, $search) {\n // 21.1.3.15 String.prototype.search(regexp)\n return [function search(regexp) {\n 'use strict';\n var O = defined(this);\n var fn = regexp == undefined ? undefined : regexp[SEARCH];\n return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));\n }, $search];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnNlYXJjaC5qcz9hYjA0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIEBAc2VhcmNoIGxvZ2ljXG5yZXF1aXJlKCcuL19maXgtcmUtd2tzJykoJ3NlYXJjaCcsIDEsIGZ1bmN0aW9uIChkZWZpbmVkLCBTRUFSQ0gsICRzZWFyY2gpIHtcbiAgLy8gMjEuMS4zLjE1IFN0cmluZy5wcm90b3R5cGUuc2VhcmNoKHJlZ2V4cClcbiAgcmV0dXJuIFtmdW5jdGlvbiBzZWFyY2gocmVnZXhwKSB7XG4gICAgJ3VzZSBzdHJpY3QnO1xuICAgIHZhciBPID0gZGVmaW5lZCh0aGlzKTtcbiAgICB2YXIgZm4gPSByZWdleHAgPT0gdW5kZWZpbmVkID8gdW5kZWZpbmVkIDogcmVnZXhwW1NFQVJDSF07XG4gICAgcmV0dXJuIGZuICE9PSB1bmRlZmluZWQgPyBmbi5jYWxsKHJlZ2V4cCwgTykgOiBuZXcgUmVnRXhwKHJlZ2V4cClbU0VBUkNIXShTdHJpbmcoTykpO1xuICB9LCAkc2VhcmNoXTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWdleHAuc2VhcmNoLmpzXG4vLyBtb2R1bGUgaWQgPSAzMzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///336\n")},function(module,exports,__webpack_require__){eval("// @@split logic\n__webpack_require__(90)('split', 2, function (defined, SPLIT, $split) {\n 'use strict';\n var isRegExp = __webpack_require__(87);\n var _split = $split;\n var $push = [].push;\n var $SPLIT = 'split';\n var LENGTH = 'length';\n var LAST_INDEX = 'lastIndex';\n if (\n 'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||\n 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||\n 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||\n '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||\n '.'[$SPLIT](/()()/)[LENGTH] > 1 ||\n ''[$SPLIT](/.?/)[LENGTH]\n ) {\n var NPCG = /()??/.exec('')[1] === undefined; // nonparticipating capturing group\n // based on es5-shim implementation, need to rework it\n $split = function (separator, limit) {\n var string = String(this);\n if (separator === undefined && limit === 0) return [];\n // If `separator` is not a regex, use native split\n if (!isRegExp(separator)) return _split.call(string, separator, limit);\n var output = [];\n var flags = (separator.ignoreCase ? 'i' : '') +\n (separator.multiline ? 'm' : '') +\n (separator.unicode ? 'u' : '') +\n (separator.sticky ? 'y' : '');\n var lastLastIndex = 0;\n var splitLimit = limit === undefined ? 4294967295 : limit >>> 0;\n // Make `global` and avoid `lastIndex` issues by working with a copy\n var separatorCopy = new RegExp(separator.source, flags + 'g');\n var separator2, match, lastIndex, lastLength, i;\n // Doesn't need flags gy, but they don't hurt\n if (!NPCG) separator2 = new RegExp('^' + separatorCopy.source + '$(?!\\\\s)', flags);\n while (match = separatorCopy.exec(string)) {\n // `separatorCopy.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0][LENGTH];\n if (lastIndex > lastLastIndex) {\n output.push(string.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for NPCG\n // eslint-disable-next-line no-loop-func\n if (!NPCG && match[LENGTH] > 1) match[0].replace(separator2, function () {\n for (i = 1; i < arguments[LENGTH] - 2; i++) if (arguments[i] === undefined) match[i] = undefined;\n });\n if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));\n lastLength = match[0][LENGTH];\n lastLastIndex = lastIndex;\n if (output[LENGTH] >= splitLimit) break;\n }\n if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop\n }\n if (lastLastIndex === string[LENGTH]) {\n if (lastLength || !separatorCopy.test('')) output.push('');\n } else output.push(string.slice(lastLastIndex));\n return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;\n };\n // Chakra, V8\n } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {\n $split = function (separator, limit) {\n return separator === undefined && limit === 0 ? [] : _split.call(this, separator, limit);\n };\n }\n // 21.1.3.17 String.prototype.split(separator, limit)\n return [function split(separator, limit) {\n var O = defined(this);\n var fn = separator == undefined ? undefined : separator[SPLIT];\n return fn !== undefined ? fn.call(separator, O, limit) : $split.call(String(O), separator, limit);\n }, $split];\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVnZXhwLnNwbGl0LmpzPzk4OWMiXSwic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,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(48);\nvar global = __webpack_require__(7);\nvar ctx = __webpack_require__(33);\nvar classof = __webpack_require__(75);\nvar $export = __webpack_require__(0);\nvar isObject = __webpack_require__(9);\nvar aFunction = __webpack_require__(20);\nvar anInstance = __webpack_require__(59);\nvar forOf = __webpack_require__(60);\nvar speciesConstructor = __webpack_require__(91);\nvar task = __webpack_require__(128).set;\nvar microtask = __webpack_require__(129)();\nvar newPromiseCapabilityModule = __webpack_require__(130);\nvar perform = __webpack_require__(174);\nvar userAgent = __webpack_require__(92);\nvar promiseResolve = __webpack_require__(175);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(10)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(61)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(64)($Promise, PROMISE);\n__webpack_require__(58)(PROMISE);\nWrapper = __webpack_require__(32)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(88)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoi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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///338\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar weak = __webpack_require__(180);\nvar validate = __webpack_require__(67);\nvar WEAK_SET = 'WeakSet';\n\n// 23.4 WeakSet Objects\n__webpack_require__(93)(WEAK_SET, function (get) {\n return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };\n}, {\n // 23.4.3.1 WeakSet.prototype.add(value)\n add: function add(value) {\n return weak.def(validate(this, WEAK_SET), value, true);\n }\n}, weak, false, true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYud2Vhay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("\nvar $export = __webpack_require__(0);\nvar $typed = __webpack_require__(94);\nvar buffer = __webpack_require__(131);\nvar anObject = __webpack_require__(5);\nvar toAbsoluteIndex = __webpack_require__(55);\nvar toLength = __webpack_require__(14);\nvar isObject = __webpack_require__(9);\nvar ArrayBuffer = __webpack_require__(7).ArrayBuffer;\nvar speciesConstructor = __webpack_require__(91);\nvar $ArrayBuffer = buffer.ArrayBuffer;\nvar $DataView = buffer.DataView;\nvar $isView = $typed.ABV && ArrayBuffer.isView;\nvar $slice = $ArrayBuffer.prototype.slice;\nvar VIEW = $typed.VIEW;\nvar ARRAY_BUFFER = 'ArrayBuffer';\n\n$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });\n\n$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {\n // 24.1.3.1 ArrayBuffer.isView(arg)\n isView: function isView(it) {\n return $isView && $isView(it) || isObject(it) && VIEW in it;\n }\n});\n\n$export($export.P + $export.U + $export.F * __webpack_require__(8)(function () {\n return !new $ArrayBuffer(2).slice(1, undefined).byteLength;\n}), ARRAY_BUFFER, {\n // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)\n slice: function slice(start, end) {\n if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix\n var len = anObject(this).byteLength;\n var first = toAbsoluteIndex(start, len);\n var fin = toAbsoluteIndex(end === undefined ? len : end, len);\n var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));\n var viewS = new $DataView(this);\n var viewT = new $DataView(result);\n var index = 0;\n while (first < fin) {\n viewT.setUint8(index++, viewS.getUint8(first++));\n } return result;\n }\n});\n\n__webpack_require__(58)(ARRAY_BUFFER);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2Nvc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ywgJEFycmF5QnVmZmVyKSkodG9MZW5ndGgoZmluIC0gZmlyc3QpKTtcbiAgICB2YXIgdmlld1MgPSBuZXcgJERhdGFWaWV3KHRoaXMpO1xuICAgIHZhciB2aWV3VCA9IG5ldyAkRGF0YVZpZXcocmVzdWx0KTtcbiAgICB2YXIgaW5kZXggPSAwO1xuICAgIHdoaWxlIChmaXJzdCA8IGZpbikge1xuICAgICAgdmlld1Quc2V0VWludDgoaW5kZXgrKywgdmlld1MuZ2V0VWludDgoZmlyc3QrKykpO1xuICAgIH0gcmV0dXJuIHJlc3VsdDtcbiAgfVxufSk7XG5cbnJlcXVpcmUoJy4vX3NldC1zcGVjaWVzJykoQVJSQVlfQlVGRkVSKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuYXJyYXktYnVmZmVyLmpzXG4vLyBtb2R1bGUgaWQgPSAzNDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///340\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\n$export($export.G + $export.W + $export.F * !__webpack_require__(94).ABV, {\n DataView: __webpack_require__(131).DataView\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZGF0YS12aWV3LmpzP2Q2ZTIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbiRleHBvcnQoJGV4cG9ydC5HICsgJGV4cG9ydC5XICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX3R5cGVkJykuQUJWLCB7XG4gIERhdGFWaWV3OiByZXF1aXJlKCcuL190eXBlZC1idWZmZXInKS5EYXRhVmlld1xufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnR5cGVkLmRhdGEtdmlldy5qc1xuLy8gbW9kdWxlIGlkID0gMzQxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///341\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Int8', 1, function (init) {\n return function Int8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50OC1hcnJheS5qcz9lNzY1Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ0ludDgnLCAxLCBmdW5jdGlvbiAoaW5pdCkge1xuICByZXR1cm4gZnVuY3Rpb24gSW50OEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50OC1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzQyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///342\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Uint8', 1, function (init) {\n return function Uint8Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtYXJyYXkuanM/NGM1NSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL190eXBlZC1hcnJheScpKCdVaW50OCcsIDEsIGZ1bmN0aW9uIChpbml0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBVaW50OEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDM0M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///343\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Uint8', 1, function (init) {\n return function Uint8ClampedArray(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n}, true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtY2xhbXBlZC1hcnJheS5qcz8zMzI4Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ1VpbnQ4JywgMSwgZnVuY3Rpb24gKGluaXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFVpbnQ4Q2xhbXBlZEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59LCB0cnVlKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDgtY2xhbXBlZC1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzQ0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///344\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Int16', 2, function (init) {\n return function Int16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MTYtYXJyYXkuanM/YWFkNCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL190eXBlZC1hcnJheScpKCdJbnQxNicsIDIsIGZ1bmN0aW9uIChpbml0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBJbnQxNkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MTYtYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDM0NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///345\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Uint16', 2, function (init) {\n return function Uint16Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDE2LWFycmF5LmpzPzRjNzkiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fdHlwZWQtYXJyYXknKSgnVWludDE2JywgMiwgZnVuY3Rpb24gKGluaXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFVpbnQxNkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDE2LWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNDZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///346\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Int32', 4, function (init) {\n return function Int32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MzItYXJyYXkuanM/MmI0MiJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL190eXBlZC1hcnJheScpKCdJbnQzMicsIDQsIGZ1bmN0aW9uIChpbml0KSB7XG4gIHJldHVybiBmdW5jdGlvbiBJbnQzMkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuaW50MzItYXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDM0N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///347\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Uint32', 4, function (init) {\n return function Uint32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDMyLWFycmF5LmpzPzM1ZjYiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fdHlwZWQtYXJyYXknKSgnVWludDMyJywgNCwgZnVuY3Rpb24gKGluaXQpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIFVpbnQzMkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQudWludDMyLWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNDhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///348\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Float32', 4, function (init) {\n return function Float32Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQzMi1hcnJheS5qcz83NTNjIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ0Zsb2F0MzInLCA0LCBmdW5jdGlvbiAoaW5pdCkge1xuICByZXR1cm4gZnVuY3Rpb24gRmxvYXQzMkFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQzMi1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///349\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(43)('Float64', 8, function (init) {\n return function Float64Array(data, byteOffset, length) {\n return init(this, data, byteOffset, length);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQ2NC1hcnJheS5qcz9mYWY1Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3R5cGVkLWFycmF5JykoJ0Zsb2F0NjQnLCA4LCBmdW5jdGlvbiAoaW5pdCkge1xuICByZXR1cm4gZnVuY3Rpb24gRmxvYXQ2NEFycmF5KGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCkge1xuICAgIHJldHVybiBpbml0KHRoaXMsIGRhdGEsIGJ5dGVPZmZzZXQsIGxlbmd0aCk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYudHlwZWQuZmxvYXQ2NC1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gMzUwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///350\n")},function(module,exports,__webpack_require__){eval("// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)\nvar $export = __webpack_require__(0);\nvar aFunction = __webpack_require__(20);\nvar anObject = __webpack_require__(5);\nvar rApply = (__webpack_require__(7).Reflect || {}).apply;\nvar fApply = Function.apply;\n// MS Edge argumentsList argument is optional\n$export($export.S + $export.F * !__webpack_require__(8)(function () {\n rApply(function () { /* empty */ });\n}), 'Reflect', {\n apply: function apply(target, thisArgument, argumentsList) {\n var T = aFunction(target);\n var L = anObject(argumentsList);\n return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5hcHBseS5qcz8wOTU0Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDI2LjEuMSBSZWZsZWN0LmFwcGx5KHRhcmdldCwgdGhpc0FyZ3VtZW50LCBhcmd1bWVudHNMaXN0KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciByQXBwbHkgPSAocmVxdWlyZSgnLi9fZ2xvYmFsJykuUmVmbGVjdCB8fCB7fSkuYXBwbHk7XG52YXIgZkFwcGx5ID0gRnVuY3Rpb24uYXBwbHk7XG4vLyBNUyBFZGdlIGFyZ3VtZW50c0xpc3QgYXJndW1lbnQgaXMgb3B0aW9uYWxcbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GICogIXJlcXVpcmUoJy4vX2ZhaWxzJykoZnVuY3Rpb24gKCkge1xuICByQXBwbHkoZnVuY3Rpb24gKCkgeyAvKiBlbXB0eSAqLyB9KTtcbn0pLCAnUmVmbGVjdCcsIHtcbiAgYXBwbHk6IGZ1bmN0aW9uIGFwcGx5KHRhcmdldCwgdGhpc0FyZ3VtZW50LCBhcmd1bWVudHNMaXN0KSB7XG4gICAgdmFyIFQgPSBhRnVuY3Rpb24odGFyZ2V0KTtcbiAgICB2YXIgTCA9IGFuT2JqZWN0KGFyZ3VtZW50c0xpc3QpO1xuICAgIHJldHVybiByQXBwbHkgPyByQXBwbHkoVCwgdGhpc0FyZ3VtZW50LCBMKSA6IGZBcHBseS5jYWxsKFQsIHRoaXNBcmd1bWVudCwgTCk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmFwcGx5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///351\n")},function(module,exports,__webpack_require__){eval("// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])\nvar $export = __webpack_require__(0);\nvar create = __webpack_require__(56);\nvar aFunction = __webpack_require__(20);\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\nvar fails = __webpack_require__(8);\nvar bind = __webpack_require__(161);\nvar rConstruct = (__webpack_require__(7).Reflect || {}).construct;\n\n// MS Edge supports only 2 arguments and argumentsList argument is optional\n// FF Nightly sets third argument as `new.target`, but does not create `this` from it\nvar NEW_TARGET_BUG = fails(function () {\n function F() { /* empty */ }\n return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);\n});\nvar ARGS_BUG = !fails(function () {\n rConstruct(function () { /* empty */ });\n});\n\n$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {\n construct: function construct(Target, args /* , newTarget */) {\n aFunction(Target);\n anObject(args);\n var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);\n if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);\n if (Target == newTarget) {\n // w/o altered newTarget, optimization for 0-4 arguments\n switch (args.length) {\n case 0: return new Target();\n case 1: return new Target(args[0]);\n case 2: return new Target(args[0], args[1]);\n case 3: return new Target(args[0], args[1], args[2]);\n case 4: return new Target(args[0], args[1], args[2], args[3]);\n }\n // w/o altered newTarget, lot of arguments case\n var $args = [null];\n $args.push.apply($args, args);\n return new (bind.apply(Target, $args))();\n }\n // with altered newTarget, not support built-in constructors\n var proto = newTarget.prototype;\n var instance = create(isObject(proto) ? proto : Object.prototype);\n var result = Function.apply.call(Target, instance, args);\n return isObject(result) ? result : instance;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5jb25zdHJ1Y3QuanM/YmU2NCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjIgUmVmbGVjdC5jb25zdHJ1Y3QodGFyZ2V0LCBhcmd1bWVudHNMaXN0IFssIG5ld1RhcmdldF0pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNyZWF0ZSA9IHJlcXVpcmUoJy4vX29iamVjdC1jcmVhdGUnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBpc09iamVjdCA9IHJlcXVpcmUoJy4vX2lzLW9iamVjdCcpO1xudmFyIGZhaWxzID0gcmVxdWlyZSgnLi9fZmFpbHMnKTtcbnZhciBiaW5kID0gc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c3VsdCA9IEZ1bmN0aW9uLmFwcGx5LmNhbGwoVGFyZ2V0LCBpbnN0YW5jZSwgYXJncyk7XG4gICAgcmV0dXJuIGlzT2JqZWN0KHJlc3VsdCkgPyByZXN1bHQgOiBpbnN0YW5jZTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZmxlY3QuY29uc3RydWN0LmpzXG4vLyBtb2R1bGUgaWQgPSAzNTJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///352\n")},function(module,exports,__webpack_require__){eval("// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)\nvar dP = __webpack_require__(13);\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar toPrimitive = __webpack_require__(36);\n\n// MS Edge has broken Reflect.defineProperty - throwing instead of returning false\n$export($export.S + $export.F * __webpack_require__(8)(function () {\n // eslint-disable-next-line no-undef\n Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });\n}), 'Reflect', {\n defineProperty: function defineProperty(target, propertyKey, attributes) {\n anObject(target);\n propertyKey = toPrimitive(propertyKey, true);\n anObject(attributes);\n try {\n dP.f(target, propertyKey, attributes);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5kZWZpbmUtcHJvcGVydHkuanM/ZTE5NSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjMgUmVmbGVjdC5kZWZpbmVQcm9wZXJ0eSh0YXJnZXQsIHByb3BlcnR5S2V5LCBhdHRyaWJ1dGVzKVxudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcblxuLy8gTVMgRWRnZSBoYXMgYnJva2VuIFJlZmxlY3QuZGVmaW5lUHJvcGVydHkgLSB0aHJvd2luZyBpbnN0ZWFkIG9mIHJldHVybmluZyBmYWxzZVxuJGV4cG9ydCgkZXhwb3J0LlMgKyAkZXhwb3J0LkYgKiByZXF1aXJlKCcuL19mYWlscycpKGZ1bmN0aW9uICgpIHtcbiAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIG5vLXVuZGVmXG4gIFJlZmxlY3QuZGVmaW5lUHJvcGVydHkoZFAuZih7fSwgMSwgeyB2YWx1ZTogMSB9KSwgMSwgeyB2YWx1ZTogMiB9KTtcbn0pLCAnUmVmbGVjdCcsIHtcbiAgZGVmaW5lUHJvcGVydHk6IGZ1bmN0aW9uIGRlZmluZVByb3BlcnR5KHRhcmdldCwgcHJvcGVydHlLZXksIGF0dHJpYnV0ZXMpIHtcbiAgICBhbk9iamVjdCh0YXJnZXQpO1xuICAgIHByb3BlcnR5S2V5ID0gdG9QcmltaXRpdmUocHJvcGVydHlLZXksIHRydWUpO1xuICAgIGFuT2JqZWN0KGF0dHJpYnV0ZXMpO1xuICAgIHRyeSB7XG4gICAgICBkUC5mKHRhcmdldCwgcHJvcGVydHlLZXksIGF0dHJpYnV0ZXMpO1xuICAgICAgcmV0dXJuIHRydWU7XG4gICAgfSBjYXRjaCAoZSkge1xuICAgICAgcmV0dXJuIGZhbHNlO1xuICAgIH1cbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM2LnJlZmxlY3QuZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSAzNTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///353\n")},function(module,exports,__webpack_require__){eval("// 26.1.4 Reflect.deleteProperty(target, propertyKey)\nvar $export = __webpack_require__(0);\nvar gOPD = __webpack_require__(29).f;\nvar anObject = __webpack_require__(5);\n\n$export($export.S, 'Reflect', {\n deleteProperty: function deleteProperty(target, propertyKey) {\n var desc = gOPD(anObject(target), propertyKey);\n return desc && !desc.configurable ? false : delete target[propertyKey];\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlI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")},function(module,exports,__webpack_require__){"use strict";eval("\n// 26.1.5 Reflect.enumerate(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar Enumerate = function (iterated) {\n this._t = anObject(iterated); // target\n this._i = 0; // next index\n var keys = this._k = []; // keys\n var key;\n for (key in iterated) keys.push(key);\n};\n__webpack_require__(119)(Enumerate, 'Object', function () {\n var that = this;\n var keys = that._k;\n var key;\n do {\n if (that._i >= keys.length) return { value: undefined, done: true };\n } while (!((key = keys[that._i++]) in that._t));\n return { value: key, done: false };\n});\n\n$export($export.S, 'Reflect', {\n enumerate: function enumerate(target) {\n return new Enumerate(target);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5lbnVtZXJhdGUuanM/NWZiNiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyAyNi4xLjUgUmVmbGVjdC5lbnVtZXJhdGUodGFyZ2V0KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIEVudW1lcmF0ZSA9IGZ1bmN0aW9uIChpdGVyYXRlZCkge1xuICB0aGlzLl90ID0gYW5PYmplY3QoaXRlcmF0ZWQpOyAvLyB0YXJnZXRcbiAgdGhpcy5faSA9IDA7ICAgICAgICAgICAgICAgICAgLy8gbmV4dCBpbmRleFxuICB2YXIga2V5cyA9IHRoaXMuX2sgPSBbXTsgICAgICAvLyBrZXlzXG4gIHZhciBrZXk7XG4gIGZvciAoa2V5IGluIGl0ZXJhdGVkKSBrZXlzLnB1c2goa2V5KTtcbn07XG5yZXF1aXJlKCcuL19pdGVyLWNyZWF0ZScpKEVudW1lcmF0ZSwgJ09iamVjdCcsIGZ1bmN0aW9uICgpIHtcbiAgdmFyIHRoYXQgPSB0aGlzO1xuICB2YXIga2V5cyA9IHRoYXQuX2s7XG4gIHZhciBrZXk7XG4gIGRvIHtcbiAgICBpZiAodGhhdC5faSA+PSBrZXlzLmxlbmd0aCkgcmV0dXJuIHsgdmFsdWU6IHVuZGVmaW5lZCwgZG9uZTogdHJ1ZSB9O1xuICB9IHdoaWxlICghKChrZXkgPSBrZXlzW3RoYXQuX2krK10pIGluIHRoYXQuX3QpKTtcbiAgcmV0dXJuIHsgdmFsdWU6IGtleSwgZG9uZTogZmFsc2UgfTtcbn0pO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1JlZmxlY3QnLCB7XG4gIGVudW1lcmF0ZTogZnVuY3Rpb24gZW51bWVyYXRlKHRhcmdldCkge1xuICAgIHJldHVybiBuZXcgRW51bWVyYXRlKHRhcmdldCk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmVudW1lcmF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gMzU1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///355\n")},function(module,exports,__webpack_require__){eval("// 26.1.6 Reflect.get(target, propertyKey [, receiver])\nvar gOPD = __webpack_require__(29);\nvar getPrototypeOf = __webpack_require__(30);\nvar has = __webpack_require__(27);\nvar $export = __webpack_require__(0);\nvar isObject = __webpack_require__(9);\nvar anObject = __webpack_require__(5);\n\nfunction get(target, propertyKey /* , receiver */) {\n var receiver = arguments.length < 3 ? target : arguments[2];\n var desc, proto;\n if (anObject(target) === receiver) return target[propertyKey];\n if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')\n ? desc.value\n : desc.get !== undefined\n ? desc.get.call(receiver)\n : undefined;\n if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);\n}\n\n$export($export.S, 'Reflect', { get: get });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5nZXQuanM/NDhmYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjYgUmVmbGVjdC5nZXQodGFyZ2V0LCBwcm9wZXJ0eUtleSBbLCByZWNlaXZlcl0pXG52YXIgZ09QRCA9IHJlcXVpcmUoJy4vX29iamVjdC1nb3BkJyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcblxuZnVuY3Rpb24gZ2V0KHRhcmdldCwgcHJvcGVydHlLZXkgLyogLCByZWNlaXZlciAqLykge1xuICB2YXIgcmVjZWl2ZXIgPSBhcmd1bWVudHMubGVuZ3RoIDwgMyA/IHRhcmdldCA6IGFyZ3VtZW50c1syXTtcbiAgdmFyIGRlc2MsIHByb3RvO1xuICBpZiAoYW5PYmplY3QodGFyZ2V0KSA9PT0gcmVjZWl2ZXIpIHJldHVybiB0YXJnZXRbcHJvcGVydHlLZXldO1xuICBpZiAoZGVzYyA9IGdPUEQuZih0YXJnZXQsIHByb3BlcnR5S2V5KSkgcmV0dXJuIGhhcyhkZXNjLCAndmFsdWUnKVxuICAgID8gZGVzYy52YWx1ZVxuICAgIDogZGVzYy5nZXQgIT09IHVuZGVmaW5lZFxuICAgICAgPyBkZXNjLmdldC5jYWxsKHJlY2VpdmVyKVxuICAgICAgOiB1bmRlZmluZWQ7XG4gIGlmIChpc09iamVjdChwcm90byA9IGdldFByb3RvdHlwZU9mKHRhcmdldCkpKSByZXR1cm4gZ2V0KHByb3RvLCBwcm9wZXJ0eUtleSwgcmVjZWl2ZXIpO1xufVxuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1JlZmxlY3QnLCB7IGdldDogZ2V0IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmdldC5qc1xuLy8gbW9kdWxlIGlkID0gMzU2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///356\n")},function(module,exports,__webpack_require__){eval("// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)\nvar gOPD = __webpack_require__(29);\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\n\n$export($export.S, 'Reflect', {\n getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {\n return gOPD.f(anObject(target), propertyKey);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanM/MDM5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjcgUmVmbGVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodGFyZ2V0LCBwcm9wZXJ0eUtleSlcbnZhciBnT1BEID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdSZWZsZWN0Jywge1xuICBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3I6IGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcih0YXJnZXQsIHByb3BlcnR5S2V5KSB7XG4gICAgcmV0dXJuIGdPUEQuZihhbk9iamVjdCh0YXJnZXQpLCBwcm9wZXJ0eUtleSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gMzU3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///357\n")},function(module,exports,__webpack_require__){eval("// 26.1.8 Reflect.getPrototypeOf(target)\nvar $export = __webpack_require__(0);\nvar getProto = __webpack_require__(30);\nvar anObject = __webpack_require__(5);\n\n$export($export.S, 'Reflect', {\n getPrototypeOf: function getPrototypeOf(target) {\n return getProto(anObject(target));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5nZXQtcHJvdG90eXBlLW9mLmpzPzNlZTQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjYuMS44IFJlZmxlY3QuZ2V0UHJvdG90eXBlT2YodGFyZ2V0KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBnZXRQcm90byA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1JlZmxlY3QnLCB7XG4gIGdldFByb3RvdHlwZU9mOiBmdW5jdGlvbiBnZXRQcm90b3R5cGVPZih0YXJnZXQpIHtcbiAgICByZXR1cm4gZ2V0UHJvdG8oYW5PYmplY3QodGFyZ2V0KSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmdldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDM1OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///358\n")},function(module,exports,__webpack_require__){eval("// 26.1.9 Reflect.has(target, propertyKey)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Reflect', {\n has: function has(target, propertyKey) {\n return propertyKey in target;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5oYXMuanM/NzY2ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjkgUmVmbGVjdC5oYXModGFyZ2V0LCBwcm9wZXJ0eUtleSlcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHtcbiAgaGFzOiBmdW5jdGlvbiBoYXModGFyZ2V0LCBwcm9wZXJ0eUtleSkge1xuICAgIHJldHVybiBwcm9wZXJ0eUtleSBpbiB0YXJnZXQ7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0Lmhhcy5qc1xuLy8gbW9kdWxlIGlkID0gMzU5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///359\n")},function(module,exports,__webpack_require__){eval("// 26.1.10 Reflect.isExtensible(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar $isExtensible = Object.isExtensible;\n\n$export($export.S, 'Reflect', {\n isExtensible: function isExtensible(target) {\n anObject(target);\n return $isExtensible ? $isExtensible(target) : true;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5pcy1leHRlbnNpYmxlLmpzPzI0NmQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjYuMS4xMCBSZWZsZWN0LmlzRXh0ZW5zaWJsZSh0YXJnZXQpXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgJGlzRXh0ZW5zaWJsZSA9IE9iamVjdC5pc0V4dGVuc2libGU7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHtcbiAgaXNFeHRlbnNpYmxlOiBmdW5jdGlvbiBpc0V4dGVuc2libGUodGFyZ2V0KSB7XG4gICAgYW5PYmplY3QodGFyZ2V0KTtcbiAgICByZXR1cm4gJGlzRXh0ZW5zaWJsZSA/ICRpc0V4dGVuc2libGUodGFyZ2V0KSA6IHRydWU7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNi5yZWZsZWN0LmlzLWV4dGVuc2libGUuanNcbi8vIG1vZHVsZSBpZCA9IDM2MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///360\n")},function(module,exports,__webpack_require__){eval("// 26.1.11 Reflect.ownKeys(target)\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Reflect', { ownKeys: __webpack_require__(182) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5vd24ta2V5cy5qcz80NzBlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDI2LjEuMTEgUmVmbGVjdC5vd25LZXlzKHRhcmdldClcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVmbGVjdCcsIHsgb3duS2V5czogcmVxdWlyZSgnLi9fb3duLWtleXMnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5vd24ta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gMzYxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///361\n")},function(module,exports,__webpack_require__){eval("// 26.1.12 Reflect.preventExtensions(target)\nvar $export = __webpack_require__(0);\nvar anObject = __webpack_require__(5);\nvar $preventExtensions = Object.preventExtensions;\n\n$export($export.S, 'Reflect', {\n preventExtensions: function preventExtensions(target) {\n anObject(target);\n try {\n if ($preventExtensions) $preventExtensions(target);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5wcmV2ZW50LWV4dGVuc2lvbnMuanM/ZjY2MSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAyNi4xLjEyIFJlZmxlY3QucHJldmVudEV4dGVuc2lvbnModGFyZ2V0KVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyICRwcmV2ZW50RXh0ZW5zaW9ucyA9IE9iamVjdC5wcmV2ZW50RXh0ZW5zaW9ucztcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdSZWZsZWN0Jywge1xuICBwcmV2ZW50RXh0ZW5zaW9uczogZnVuY3Rpb24gcHJldmVudEV4dGVuc2lvbnModGFyZ2V0KSB7XG4gICAgYW5PYmplY3QodGFyZ2V0KTtcbiAgICB0cnkge1xuICAgICAgaWYgKCRwcmV2ZW50RXh0ZW5zaW9ucykgJHByZXZlbnRFeHRlbnNpb25zKHRhcmdldCk7XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5wcmV2ZW50LWV4dGVuc2lvbnMuanNcbi8vIG1vZHVsZSBpZCA9IDM2MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///362\n")},function(module,exports,__webpack_require__){eval("// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])\nvar dP = __webpack_require__(13);\nvar gOPD = __webpack_require__(29);\nvar getPrototypeOf = __webpack_require__(30);\nvar has = __webpack_require__(27);\nvar $export = __webpack_require__(0);\nvar createDesc = __webpack_require__(52);\nvar anObject = __webpack_require__(5);\nvar isObject = __webpack_require__(9);\n\nfunction set(target, propertyKey, V /* , receiver */) {\n var receiver = arguments.length < 4 ? target : arguments[3];\n var ownDesc = gOPD.f(anObject(target), propertyKey);\n var existingDescriptor, proto;\n if (!ownDesc) {\n if (isObject(proto = getPrototypeOf(target))) {\n return set(proto, propertyKey, V, receiver);\n }\n ownDesc = createDesc(0);\n }\n if (has(ownDesc, 'value')) {\n if (ownDesc.writable === false || !isObject(receiver)) return false;\n if (existingDescriptor = gOPD.f(receiver, propertyKey)) {\n if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;\n existingDescriptor.value = V;\n dP.f(receiver, propertyKey, existingDescriptor);\n } else dP.f(receiver, propertyKey, createDesc(0, V));\n return true;\n }\n return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);\n}\n\n$export($export.S, 'Reflect', { set: set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5zZXQuanM/NmQ0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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///363\n")},function(module,exports,__webpack_require__){eval("// 26.1.14 Reflect.setPrototypeOf(target, proto)\nvar $export = __webpack_require__(0);\nvar setProto = __webpack_require__(111);\n\nif (setProto) $export($export.S, 'Reflect', {\n setPrototypeOf: function setPrototypeOf(target, proto) {\n setProto.check(target, proto);\n try {\n setProto.set(target, proto);\n return true;\n } catch (e) {\n return false;\n }\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5zZXQtcHJvdG90eXBlLW9mLmpzPzk5M2EiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjYuMS4xNCBSZWZsZWN0LnNldFByb3RvdHlwZU9mKHRhcmdldCwgcHJvdG8pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHNldFByb3RvID0gcmVxdWlyZSgnLi9fc2V0LXByb3RvJyk7XG5cbmlmIChzZXRQcm90bykgJGV4cG9ydCgkZXhwb3J0LlMsICdSZWZsZWN0Jywge1xuICBzZXRQcm90b3R5cGVPZjogZnVuY3Rpb24gc2V0UHJvdG90eXBlT2YodGFyZ2V0LCBwcm90bykge1xuICAgIHNldFByb3RvLmNoZWNrKHRhcmdldCwgcHJvdG8pO1xuICAgIHRyeSB7XG4gICAgICBzZXRQcm90by5zZXQodGFyZ2V0LCBwcm90byk7XG4gICAgICByZXR1cm4gdHJ1ZTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICByZXR1cm4gZmFsc2U7XG4gICAgfVxuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczYucmVmbGVjdC5zZXQtcHJvdG90eXBlLW9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzNjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///364\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/Array.prototype.includes\nvar $export = __webpack_require__(0);\nvar $includes = __webpack_require__(84)(true);\n\n$export($export.P, 'Array', {\n includes: function includes(el /* , fromIndex = 0 */) {\n return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);\n }\n});\n\n__webpack_require__(49)('includes');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXJyYXkuaW5jbHVkZXMuanM/ODFiYyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9BcnJheS5wcm90b3R5cGUuaW5jbHVkZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGluY2x1ZGVzID0gcmVxdWlyZSgnLi9fYXJyYXktaW5jbHVkZXMnKSh0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAsICdBcnJheScsIHtcbiAgaW5jbHVkZXM6IGZ1bmN0aW9uIGluY2x1ZGVzKGVsIC8qICwgZnJvbUluZGV4ID0gMCAqLykge1xuICAgIHJldHVybiAkaW5jbHVkZXModGhpcywgZWwsIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkKTtcbiAgfVxufSk7XG5cbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKCdpbmNsdWRlcycpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5hcnJheS5pbmNsdWRlcy5qc1xuLy8gbW9kdWxlIGlkID0gMzY1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///365\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap\nvar $export = __webpack_require__(0);\nvar flattenIntoArray = __webpack_require__(183);\nvar toObject = __webpack_require__(19);\nvar toLength = __webpack_require__(14);\nvar aFunction = __webpack_require__(20);\nvar arraySpeciesCreate = __webpack_require__(125);\n\n$export($export.P, 'Array', {\n flatMap: function flatMap(callbackfn /* , thisArg */) {\n var O = toObject(this);\n var sourceLen, A;\n aFunction(callbackfn);\n sourceLen = toLength(O.length);\n A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);\n return A;\n }\n});\n\n__webpack_require__(49)('flatMap');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWx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4gQTtcbiAgfVxufSk7XG5cbnJlcXVpcmUoJy4vX2FkZC10by11bnNjb3BhYmxlcycpKCdmbGF0TWFwJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LmFycmF5LmZsYXQtbWFwLmpzXG4vLyBtb2R1bGUgaWQgPSAzNjZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///366\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten\nvar $export = __webpack_require__(0);\nvar flattenIntoArray = __webpack_require__(183);\nvar toObject = __webpack_require__(19);\nvar toLength = __webpack_require__(14);\nvar toInteger = __webpack_require__(38);\nvar arraySpeciesCreate = __webpack_require__(125);\n\n$export($export.P, 'Array', {\n flatten: function flatten(/* depthArg = 1 */) {\n var depthArg = arguments[0];\n var O = toObject(this);\n var sourceLen = toLength(O.length);\n var A = arraySpeciesCreate(O, 0);\n flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));\n return A;\n }\n});\n\n__webpack_require__(49)('flatten');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXJyYXkuZmxhdHRlbi5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Ly8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LmFycmF5LmZsYXR0ZW4uanNcbi8vIG1vZHVsZSBpZCA9IDM2N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///367\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/mathiasbynens/String.prototype.at\nvar $export = __webpack_require__(0);\nvar $at = __webpack_require__(117)(true);\n\n$export($export.P, 'String', {\n at: function at(pos) {\n return $at(this, pos);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLmF0LmpzP2ZiNmYiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gaHR0cHM6Ly9naXRodWIuY29tL21hdGhpYXNieW5lbnMvU3RyaW5nLnByb3RvdHlwZS5hdFxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkYXQgPSByZXF1aXJlKCcuL19zdHJpbmctYXQnKSh0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlAsICdTdHJpbmcnLCB7XG4gIGF0OiBmdW5jdGlvbiBhdChwb3MpIHtcbiAgICByZXR1cm4gJGF0KHRoaXMsIHBvcyk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcuYXQuanNcbi8vIG1vZHVsZSBpZCA9IDM2OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///368\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(0);\nvar $pad = __webpack_require__(184);\nvar userAgent = __webpack_require__(92);\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padStart: function padStart(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnBhZC1zdGFydC5qcz9iMjY0Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLXN0cmluZy1wYWQtc3RhcnQtZW5kXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRwYWQgPSByZXF1aXJlKCcuL19zdHJpbmctcGFkJyk7XG52YXIgdXNlckFnZW50ID0gcmVxdWlyZSgnLi9fdXNlci1hZ2VudCcpO1xuXG4vLyBodHRwczovL2dpdGh1Yi5jb20vemxvaXJvY2svY29yZS1qcy9pc3N1ZXMvMjgwXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuRiAqIC9WZXJzaW9uXFwvMTBcXC5cXGQrKFxcLlxcZCspPyBTYWZhcmlcXC8vLnRlc3QodXNlckFnZW50KSwgJ1N0cmluZycsIHtcbiAgcGFkU3RhcnQ6IGZ1bmN0aW9uIHBhZFN0YXJ0KG1heExlbmd0aCAvKiAsIGZpbGxTdHJpbmcgPSAnICcgKi8pIHtcbiAgICByZXR1cm4gJHBhZCh0aGlzLCBtYXhMZW5ndGgsIGFyZ3VtZW50cy5sZW5ndGggPiAxID8gYXJndW1lbnRzWzFdIDogdW5kZWZpbmVkLCB0cnVlKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN0cmluZy5wYWQtc3RhcnQuanNcbi8vIG1vZHVsZSBpZCA9IDM2OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///369\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-string-pad-start-end\nvar $export = __webpack_require__(0);\nvar $pad = __webpack_require__(184);\nvar userAgent = __webpack_require__(92);\n\n// https://github.com/zloirock/core-js/issues/280\n$export($export.P + $export.F * /Version\\/10\\.\\d+(\\.\\d+)? Safari\\//.test(userAgent), 'String', {\n padEnd: function padEnd(maxLength /* , fillString = ' ' */) {\n return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);\n }\n});\n//#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b2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///370\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n__webpack_require__(65)('trimLeft', function ($trim) {\n return function trimLeft() {\n return $trim(this, 1);\n };\n}, 'trimStart');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnRyaW0tbGVmdC5qcz9jNjdmIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9zZWJtYXJrYmFnZS9lY21hc2NyaXB0LXN0cmluZy1sZWZ0LXJpZ2h0LXRyaW1cbnJlcXVpcmUoJy4vX3N0cmluZy10cmltJykoJ3RyaW1MZWZ0JywgZnVuY3Rpb24gKCR0cmltKSB7XG4gIHJldHVybiBmdW5jdGlvbiB0cmltTGVmdCgpIHtcbiAgICByZXR1cm4gJHRyaW0odGhpcywgMSk7XG4gIH07XG59LCAndHJpbVN0YXJ0Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN0cmluZy50cmltLWxlZnQuanNcbi8vIG1vZHVsZSBpZCA9IDM3MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///371\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/sebmarkbage/ecmascript-string-left-right-trim\n__webpack_require__(65)('trimRight', function ($trim) {\n return function trimRight() {\n return $trim(this, 2);\n };\n}, 'trimEnd');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLnRyaW0tcmlnaHQuanM/MmQxMiJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vc2VibWFya2JhZ2UvZWNtYXNjcmlwdC1zdHJpbmctbGVmdC1yaWdodC10cmltXG5yZXF1aXJlKCcuL19zdHJpbmctdHJpbScpKCd0cmltUmlnaHQnLCBmdW5jdGlvbiAoJHRyaW0pIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIHRyaW1SaWdodCgpIHtcbiAgICByZXR1cm4gJHRyaW0odGhpcywgMik7XG4gIH07XG59LCAndHJpbUVuZCcpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcudHJpbS1yaWdodC5qc1xuLy8gbW9kdWxlIGlkID0gMzcyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///372\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://tc39.github.io/String.prototype.matchAll/\nvar $export = __webpack_require__(0);\nvar defined = __webpack_require__(37);\nvar toLength = __webpack_require__(14);\nvar isRegExp = __webpack_require__(87);\nvar getFlags = __webpack_require__(89);\nvar RegExpProto = RegExp.prototype;\n\nvar $RegExpStringIterator = function (regexp, string) {\n this._r = regexp;\n this._s = string;\n};\n\n__webpack_require__(119)($RegExpStringIterator, 'RegExp String', function next() {\n var match = this._r.exec(this._s);\n return { value: match, done: match === null };\n});\n\n$export($export.P, 'String', {\n matchAll: function matchAll(regexp) {\n defined(this);\n if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');\n var S = String(this);\n var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);\n var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);\n rx.lastIndex = toLength(regexp.lastIndex);\n return new $RegExpStringIterator(rx, S);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3RyaW5nLm1hdGNoLWFsbC5qcz9iMWNlIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vU3RyaW5nLnByb3RvdHlwZS5tYXRjaEFsbC9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgZGVmaW5lZCA9IHJlcXVpcmUoJy4vX2RlZmluZWQnKTtcbnZhciB0b0xlbmd0aCA9IHJlcXVpcmUoJy4vX3RvLWxlbmd0aCcpO1xudmFyIGlzUmVnRXhwID0gcmVxdWlyZSgnLi9faXMtcmVnZXhwJyk7XG52YXIgZ2V0RmxhZ3MgPSByZXF1aXJlKCcuL19mbGFncycpO1xudmFyIFJlZ0V4cFByb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RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5zdHJpbmcubWF0Y2gtYWxsLmpzXG4vLyBtb2R1bGUgaWQgPSAzNzNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///373\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(107)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3ltYm9sLmFzeW5jLWl0ZXJhdG9yLmpzP2Y1ODgiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi9fd2tzLWRlZmluZScpKCdhc3luY0l0ZXJhdG9yJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gMzc0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///374\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(107)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUuanM/YmVlZiJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL193a3MtZGVmaW5lJykoJ29ic2VydmFibGUnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUuanNcbi8vIG1vZHVsZSBpZCA9IDM3NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///375\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-getownpropertydescriptors\nvar $export = __webpack_require__(0);\nvar ownKeys = __webpack_require__(182);\nvar toIObject = __webpack_require__(28);\nvar gOPD = __webpack_require__(29);\nvar createProperty = __webpack_require__(123);\n\n$export($export.S, 'Object', {\n getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {\n var O = toIObject(object);\n var getDesc = gOPD.f;\n var keys = ownKeys(O);\n var result = {};\n var i = 0;\n var key, desc;\n while (keys.length > i) {\n desc = getDesc(O, key = keys[i++]);\n if (desc !== undefined) createProperty(result, key, desc);\n }\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmdldC1vd24tcHJ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Y29yZS1qcy9tb2R1bGVzL2VzNy5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9ycy5qc1xuLy8gbW9kdWxlIGlkID0gMzc2XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///376\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(0);\nvar $values = __webpack_require__(185)(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LnZhbHVlcy5qcz82MTU5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLW9iamVjdC12YWx1ZXMtZW50cmllc1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkdmFsdWVzID0gcmVxdWlyZSgnLi9fb2JqZWN0LXRvLWFycmF5JykoZmFsc2UpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ09iamVjdCcsIHtcbiAgdmFsdWVzOiBmdW5jdGlvbiB2YWx1ZXMoaXQpIHtcbiAgICByZXR1cm4gJHZhbHVlcyhpdCk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5vYmplY3QudmFsdWVzLmpzXG4vLyBtb2R1bGUgaWQgPSAzNzdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///377\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(0);\nvar $entries = __webpack_require__(185)(true);\n\n$export($export.S, 'Object', {\n entries: function entries(it) {\n return $entries(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmVudHJpZXMuanM/MTRhNyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1vYmplY3QtdmFsdWVzLWVudHJpZXNcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgJGVudHJpZXMgPSByZXF1aXJlKCcuL19vYmplY3QtdG8tYXJyYXknKSh0cnVlKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7XG4gIGVudHJpZXM6IGZ1bmN0aW9uIGVudHJpZXMoaXQpIHtcbiAgICByZXR1cm4gJGVudHJpZXMoaXQpO1xuICB9XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmVudHJpZXMuanNcbi8vIG1vZHVsZSBpZCA9IDM3OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///378\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar aFunction = __webpack_require__(20);\nvar $defineProperty = __webpack_require__(13);\n\n// B.2.2.2 Object.prototype.__defineGetter__(P, getter)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __defineGetter__: function __defineGetter__(P, getter) {\n $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzc5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0LmRlZmluZS1nZXR0ZXIuanM/YTE4YSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgYUZ1bmN0aW9uID0gcmVxdWlyZSgnLi9fYS1mdW5jdGlvbicpO1xudmFyICRkZWZpbmVQcm9wZXJ0eSA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpO1xuXG4vLyBCLjIuMi4yIE9iamVjdC5wcm90b3R5cGUuX19kZWZpbmVHZXR0ZXJfXyhQLCBnZXR0ZXIpXG5yZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICRleHBvcnQoJGV4cG9ydC5QICsgcmVxdWlyZSgnLi9fb2JqZWN0LWZvcmNlZC1wYW0nKSwgJ09iamVjdCcsIHtcbiAgX19kZWZpbmVHZXR0ZXJfXzogZnVuY3Rpb24gX19kZWZpbmVHZXR0ZXJfXyhQLCBnZXR0ZXIpIHtcbiAgICAkZGVmaW5lUHJvcGVydHkuZih0b09iamVjdCh0aGlzKSwgUCwgeyBnZXQ6IGFGdW5jdGlvbihnZXR0ZXIpLCBlbnVtZXJhYmxlOiB0cnVlLCBjb25maWd1cmFibGU6IHRydWUgfSk7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5vYmplY3QuZGVmaW5lLWdldHRlci5qc1xuLy8gbW9kdWxlIGlkID0gMzc5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///379\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar aFunction = __webpack_require__(20);\nvar $defineProperty = __webpack_require__(13);\n\n// B.2.2.3 Object.prototype.__defineSetter__(P, setter)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __defineSetter__: function __defineSetter__(P, setter) {\n $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2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tBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///380\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar toPrimitive = __webpack_require__(36);\nvar getPrototypeOf = __webpack_require__(30);\nvar getOwnPropertyDescriptor = __webpack_require__(29).f;\n\n// B.2.2.4 Object.prototype.__lookupGetter__(P)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __lookupGetter__: function __lookupGetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.get;\n } while (O = getPrototypeOf(O));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0Lmxvb2t1cC1nZXR0ZXIuanM/YzQyYSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBnZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcbnZhciBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IgPSByZXF1aXJlKCcuL19vYmplY3QtZ29wZCcpLmY7XG5cbi8vIEIuMi4yLjQgT2JqZWN0LnByb3RvdHlwZS5fX2xvb2t1cEdldHRlcl9fKFApXG5yZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICRleHBvcnQoJGV4cG9ydC5QICsgcmVxdWlyZSgnLi9fb2JqZWN0LWZvcmNlZC1wYW0nKSwgJ09iamVjdCcsIHtcbiAgX19sb29rdXBHZXR0ZXJfXzogZnVuY3Rpb24gX19sb29rdXBHZXR0ZXJfXyhQKSB7XG4gICAgdmFyIE8gPSB0b09iamVjdCh0aGlzKTtcbiAgICB2YXIgSyA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICAgIHZhciBEO1xuICAgIGRvIHtcbiAgICAgIGlmIChEID0gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIEspKSByZXR1cm4gRC5nZXQ7XG4gICAgfSB3aGlsZSAoTyA9IGdldFByb3RvdHlwZU9mKE8pKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm9iamVjdC5sb29rdXAtZ2V0dGVyLmpzXG4vLyBtb2R1bGUgaWQgPSAzODFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///381\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $export = __webpack_require__(0);\nvar toObject = __webpack_require__(19);\nvar toPrimitive = __webpack_require__(36);\nvar getPrototypeOf = __webpack_require__(30);\nvar getOwnPropertyDescriptor = __webpack_require__(29).f;\n\n// B.2.2.5 Object.prototype.__lookupSetter__(P)\n__webpack_require__(12) && $export($export.P + __webpack_require__(95), 'Object', {\n __lookupSetter__: function __lookupSetter__(P) {\n var O = toObject(this);\n var K = toPrimitive(P, true);\n var D;\n do {\n if (D = getOwnPropertyDescriptor(O, K)) return D.set;\n } while (O = getPrototypeOf(O));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JqZWN0Lmxvb2t1cC1zZXR0ZXIuanM/MDI0NCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgdG9QcmltaXRpdmUgPSByZXF1aXJlKCcuL190by1wcmltaXRpdmUnKTtcbnZhciBnZXRQcm90b3R5cGVPZiA9IHJlcXVpcmUoJy4vX29iamVjdC1ncG8nKTtcbnZhciBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IgPSByZXF1aXJlKCcuL19vYmplY3QtZ29wZCcpLmY7XG5cbi8vIEIuMi4yLjUgT2JqZWN0LnByb3RvdHlwZS5fX2xvb2t1cFNldHRlcl9fKFApXG5yZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpICYmICRleHBvcnQoJGV4cG9ydC5QICsgcmVxdWlyZSgnLi9fb2JqZWN0LWZvcmNlZC1wYW0nKSwgJ09iamVjdCcsIHtcbiAgX19sb29rdXBTZXR0ZXJfXzogZnVuY3Rpb24gX19sb29rdXBTZXR0ZXJfXyhQKSB7XG4gICAgdmFyIE8gPSB0b09iamVjdCh0aGlzKTtcbiAgICB2YXIgSyA9IHRvUHJpbWl0aXZlKFAsIHRydWUpO1xuICAgIHZhciBEO1xuICAgIGRvIHtcbiAgICAgIGlmIChEID0gZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE8sIEspKSByZXR1cm4gRC5zZXQ7XG4gICAgfSB3aGlsZSAoTyA9IGdldFByb3RvdHlwZU9mKE8pKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm9iamVjdC5sb29rdXAtc2V0dGVyLmpzXG4vLyBtb2R1bGUgaWQgPSAzODJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///382\n")},function(module,exports,__webpack_require__){eval("// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(0);\n\n$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(186)('Map') });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLnRvLWpzb24uanM/ODdiNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vRGF2aWRCcnVhbnQvTWFwLVNldC5wcm90b3R5cGUudG9KU09OXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuUiwgJ01hcCcsIHsgdG9KU09OOiByZXF1aXJlKCcuL19jb2xsZWN0aW9uLXRvLWpzb24nKSgnTWFwJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hcC50by1qc29uLmpzXG4vLyBtb2R1bGUgaWQgPSAzODNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///383\n")},function(module,exports,__webpack_require__){eval("// https://github.com/DavidBruant/Map-Set.prototype.toJSON\nvar $export = __webpack_require__(0);\n\n$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(186)('Set') });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0LnRvLWpzb24uanM/NmFiMSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vRGF2aWRCcnVhbnQvTWFwLVNldC5wcm90b3R5cGUudG9KU09OXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUCArICRleHBvcnQuUiwgJ1NldCcsIHsgdG9KU09OOiByZXF1aXJlKCcuL19jb2xsZWN0aW9uLXRvLWpzb24nKSgnU2V0JykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnNldC50by1qc29uLmpzXG4vLyBtb2R1bGUgaWQgPSAzODRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///384\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of\n__webpack_require__(96)('Map');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLm9mLmpzPzI0OWQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1zZXRtYXAtb2Zmcm9tLyNzZWMtbWFwLm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdNYXAnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///385\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of\n__webpack_require__(96)('Set');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0Lm9mLmpzP2E5OTYiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly90YzM5LmdpdGh1Yi5pby9wcm9wb3NhbC1zZXRtYXAtb2Zmcm9tLyNzZWMtc2V0Lm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdTZXQnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0Lm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///386\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of\n__webpack_require__(96)('WeakMap');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1tYXAub2YuanM/MmRhZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy13ZWFrbWFwLm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdXZWFrTWFwJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstbWFwLm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///387\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of\n__webpack_require__(96)('WeakSet');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1zZXQub2YuanM/MDRlNiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy13ZWFrc2V0Lm9mXG5yZXF1aXJlKCcuL19zZXQtY29sbGVjdGlvbi1vZicpKCdXZWFrU2V0Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstc2V0Lm9mLmpzXG4vLyBtb2R1bGUgaWQgPSAzODhcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///388\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from\n__webpack_require__(97)('Map');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLmZyb20uanM/ZTJiOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy1tYXAuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdNYXAnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWFwLmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM4OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///389\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from\n__webpack_require__(97)('Set');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0LmZyb20uanM/NjIwOCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3RjMzkuZ2l0aHViLmlvL3Byb3Bvc2FsLXNldG1hcC1vZmZyb20vI3NlYy1zZXQuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdTZXQnKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc2V0LmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM5MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///390\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from\n__webpack_require__(97)('WeakMap');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1tYXAuZnJvbS5qcz9lOTdjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtc2V0bWFwLW9mZnJvbS8jc2VjLXdlYWttYXAuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdXZWFrTWFwJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstbWFwLmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM5MVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///391\n")},function(module,exports,__webpack_require__){eval("// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from\n__webpack_require__(97)('WeakSet');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcud2Vhay1zZXQuZnJvbS5qcz9hOWQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vdGMzOS5naXRodWIuaW8vcHJvcG9zYWwtc2V0bWFwLW9mZnJvbS8jc2VjLXdlYWtzZXQuZnJvbVxucmVxdWlyZSgnLi9fc2V0LWNvbGxlY3Rpb24tZnJvbScpKCdXZWFrU2V0Jyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LndlYWstc2V0LmZyb20uanNcbi8vIG1vZHVsZSBpZCA9IDM5MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///392\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-global\nvar $export = __webpack_require__(0);\n\n$export($export.G, { global: __webpack_require__(7) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuZ2xvYmFsLmpzPzBkMDciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtZ2xvYmFsXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuRywgeyBnbG9iYWw6IHJlcXVpcmUoJy4vX2dsb2JhbCcpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5nbG9iYWwuanNcbi8vIG1vZHVsZSBpZCA9IDM5M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///393\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-global\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'System', { global: __webpack_require__(7) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuc3lzdGVtLmdsb2JhbC5qcz84ZmYyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLWdsb2JhbFxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdTeXN0ZW0nLCB7IGdsb2JhbDogcmVxdWlyZSgnLi9fZ2xvYmFsJykgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnN5c3RlbS5nbG9iYWwuanNcbi8vIG1vZHVsZSBpZCA9IDM5NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///394\n")},function(module,exports,__webpack_require__){eval("// https://github.com/ljharb/proposal-is-error\nvar $export = __webpack_require__(0);\nvar cof = __webpack_require__(34);\n\n$export($export.S, 'Error', {\n isError: function isError(it) {\n return cof(it) === 'Error';\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuZXJyb3IuaXMtZXJyb3IuanM/NTNlNSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vbGpoYXJiL3Byb3Bvc2FsLWlzLWVycm9yXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvZiA9IHJlcXVpcmUoJy4vX2NvZicpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ0Vycm9yJywge1xuICBpc0Vycm9yOiBmdW5jdGlvbiBpc0Vycm9yKGl0KSB7XG4gICAgcmV0dXJuIGNvZihpdCkgPT09ICdFcnJvcic7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5lcnJvci5pcy1lcnJvci5qc1xuLy8gbW9kdWxlIGlkID0gMzk1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///395\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n clamp: function clamp(x, lower, upper) {\n return Math.min(upper, Math.max(lower, x));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5jbGFtcC5qcz81ZmEzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgY2xhbXA6IGZ1bmN0aW9uIGNsYW1wKHgsIGxvd2VyLCB1cHBlcikge1xuICAgIHJldHVybiBNYXRoLm1pbih1cHBlciwgTWF0aC5tYXgobG93ZXIsIHgpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguY2xhbXAuanNcbi8vIG1vZHVsZSBpZCA9IDM5NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///396\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5kZWctcGVyLXJhZC5qcz81YjRhIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgREVHX1BFUl9SQUQ6IE1hdGguUEkgLyAxODAgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguZGVnLXBlci1yYWQuanNcbi8vIG1vZHVsZSBpZCA9IDM5N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///397\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar RAD_PER_DEG = 180 / Math.PI;\n\n$export($export.S, 'Math', {\n degrees: function degrees(radians) {\n return radians * RAD_PER_DEG;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5kZWdyZWVzLmpzP2I1YTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9yd2FsZHJvbi5naXRodWIuaW8vcHJvcG9zYWwtbWF0aC1leHRlbnNpb25zL1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBSQURfUEVSX0RFRyA9IDE4MCAvIE1hdGguUEk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgZGVncmVlczogZnVuY3Rpb24gZGVncmVlcyhyYWRpYW5zKSB7XG4gICAgcmV0dXJuIHJhZGlhbnMgKiBSQURfUEVSX0RFRztcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguZGVncmVlcy5qc1xuLy8gbW9kdWxlIGlkID0gMzk4XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///398\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar scale = __webpack_require__(188);\nvar fround = __webpack_require__(168);\n\n$export($export.S, 'Math', {\n fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {\n return fround(scale(x, inLow, inHigh, outLow, outHigh));\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5mc2NhbGUuanM/YmU3NSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL3J3YWxkcm9uLmdpdGh1Yi5pby9wcm9wb3NhbC1tYXRoLWV4dGVuc2lvbnMvXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIHNjYWxlID0gcmVxdWlyZSgnLi9fbWF0aC1zY2FsZScpO1xudmFyIGZyb3VuZCA9IHJlcXVpcmUoJy4vX21hdGgtZnJvdW5kJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgZnNjYWxlOiBmdW5jdGlvbiBmc2NhbGUoeCwgaW5Mb3csIGluSGlnaCwgb3V0TG93LCBvdXRIaWdoKSB7XG4gICAgcmV0dXJuIGZyb3VuZChzY2FsZSh4LCBpbkxvdywgaW5IaWdoLCBvdXRMb3csIG91dEhpZ2gpKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguZnNjYWxlLmpzXG4vLyBtb2R1bGUgaWQgPSAzOTlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///399\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n iaddh: function iaddh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5pYWRkaC5qcz80NzcyIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyZW5kYW5FaWNoLzQyOTRkNWMyMTJhNmQyMjU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGlhZGRoOiBmdW5jdGlvbiBpYWRkaCh4MCwgeDEsIHkwLCB5MSkge1xuICAgIHZhciAkeDAgPSB4MCA+Pj4gMDtcbiAgICB2YXIgJHgxID0geDEgPj4+IDA7XG4gICAgdmFyICR5MCA9IHkwID4+PiAwO1xuICAgIHJldHVybiAkeDEgKyAoeTEgPj4+IDApICsgKCgkeDAgJiAkeTAgfCAoJHgwIHwgJHkwKSAmIH4oJHgwICsgJHkwID4+PiAwKSkgPj4+IDMxKSB8IDA7XG4gIH1cbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5tYXRoLmlhZGRoLmpzXG4vLyBtb2R1bGUgaWQgPSA0MDBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///400\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n isubh: function isubh(x0, x1, y0, y1) {\n var $x0 = x0 >>> 0;\n var $x1 = x1 >>> 0;\n var $y0 = y0 >>> 0;\n return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5pc3ViaC5qcz9lYTIzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2lzdC5naXRodWIuY29tL0JyZW5kYW5FaWNoLzQyOTRkNWMyMTJhNmQyMjU0NzAzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7XG4gIGlzdWJoOiBmdW5jdGlvbiBpc3ViaCh4MCwgeDEsIHkwLCB5MSkge1xuICAgIHZhciAkeDAgPSB4MCA+Pj4gMDtcbiAgICB2YXIgJHgxID0geDEgPj4+IDA7XG4gICAgdmFyICR5MCA9IHkwID4+PiAwO1xuICAgIHJldHVybiAkeDEgLSAoeTEgPj4+IDApIC0gKCh+JHgwICYgJHkwIHwgfigkeDAgXiAkeTApICYgJHgwIC0gJHkwID4+PiAwKSA+Pj4gMzEpIHwgMDtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGguaXN1YmguanNcbi8vIG1vZHVsZSBpZCA9IDQwMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///401\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n imulh: function imulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >> 16;\n var v1 = $v >> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UIN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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///402\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5yYWQtcGVyLWRlZy5qcz9kZWNmIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgUkFEX1BFUl9ERUc6IDE4MCAvIE1hdGguUEkgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGgucmFkLXBlci1kZWcuanNcbi8vIG1vZHVsZSBpZCA9IDQwM1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///403\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\nvar DEG_PER_RAD = Math.PI / 180;\n\n$export($export.S, 'Math', {\n radians: function radians(degrees) {\n return degrees * DEG_PER_RAD;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5yYWRpYW5zLmpzPzE3NWIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9yd2FsZHJvbi5naXRodWIuaW8vcHJvcG9zYWwtbWF0aC1leHRlbnNpb25zL1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBERUdfUEVSX1JBRCA9IE1hdGguUEkgLyAxODA7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHtcbiAgcmFkaWFuczogZnVuY3Rpb24gcmFkaWFucyhkZWdyZWVzKSB7XG4gICAgcmV0dXJuIGRlZ3JlZXMgKiBERUdfUEVSX1JBRDtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3Lm1hdGgucmFkaWFucy5qc1xuLy8gbW9kdWxlIGlkID0gNDA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///404\n")},function(module,exports,__webpack_require__){eval("// https://rwaldron.github.io/proposal-math-extensions/\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { scale: __webpack_require__(188) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5zY2FsZS5qcz9iODQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vcndhbGRyb24uZ2l0aHViLmlvL3Byb3Bvc2FsLW1hdGgtZXh0ZW5zaW9ucy9cbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnTWF0aCcsIHsgc2NhbGU6IHJlcXVpcmUoJy4vX21hdGgtc2NhbGUnKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5zY2FsZS5qc1xuLy8gbW9kdWxlIGlkID0gNDA1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///405\n")},function(module,exports,__webpack_require__){eval("// https://gist.github.com/BrendanEich/4294d5c212a6d2254703\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', {\n umulh: function umulh(u, v) {\n var UINT16 = 0xffff;\n var $u = +u;\n var $v = +v;\n var u0 = $u & UINT16;\n var v0 = $v & UINT16;\n var u1 = $u >>> 16;\n var v1 = $v >>> 16;\n var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);\n return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4v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-internal:///406\n")},function(module,exports,__webpack_require__){eval("// http://jfbastien.github.io/papers/Math.signbit.html\nvar $export = __webpack_require__(0);\n\n$export($export.S, 'Math', { signbit: function signbit(x) {\n // eslint-disable-next-line no-self-compare\n return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcubWF0aC5zaWduYml0LmpzPzFmYmMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cDovL2pmYmFzdGllbi5naXRodWIuaW8vcGFwZXJzL01hdGguc2lnbmJpdC5odG1sXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ01hdGgnLCB7IHNpZ25iaXQ6IGZ1bmN0aW9uIHNpZ25iaXQoeCkge1xuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tc2VsZi1jb21wYXJlXG4gIHJldHVybiAoeCA9ICt4KSAhPSB4ID8geCA6IHggPT0gMCA/IDEgLyB4ID09IEluZmluaXR5IDogeCA+IDA7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5tYXRoLnNpZ25iaXQuanNcbi8vIG1vZHVsZSBpZCA9IDQwN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///407\n")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(0);\nvar core = __webpack_require__(32);\nvar global = __webpack_require__(7);\nvar speciesConstructor = __webpack_require__(91);\nvar promiseResolve = __webpack_require__(175);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucHJvbWlzZS5maW5hbGx5LmpzP2Y4Y2IiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtcHJvbWlzZS1maW5hbGx5XG4ndXNlIHN0cmljdCc7XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIGNvcmUgPSByZXF1aXJlKCcuL19jb3JlJyk7XG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgc3BlY2llc0NvbnN0cnVjdG9yID0gcmVxdWlyZSgnLi9fc3BlY2llcy1jb25zdHJ1Y3RvcicpO1xudmFyIHByb21pc2VSZXNvbHZlID0gcmVxdWlyZSgnLi9fcHJvbWlzZS1yZXNvbHZlJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5QICsgJGV4cG9ydC5SLCAnUHJvbWlzZScsIHsgJ2ZpbmFsbHknOiBmdW5jdGlvbiAob25GaW5hbGx5KSB7XG4gIHZhciBDID0gc3BlY2llc0NvbnN0cnVjdG9yKHRoaXMsIGNvcmUuUHJvbWlzZSB8fCBnbG9iYWwuUHJvbWlzZSk7XG4gIHZhciBpc0Z1bmN0aW9uID0gdHlwZW9mIG9uRmluYWxseSA9PSAnZnVuY3Rpb24nO1xuICByZXR1cm4gdGhpcy50aGVuKFxuICAgIGlzRnVuY3Rpb24gPyBmdW5jdGlvbiAoeCkge1xuICAgICAgcmV0dXJuIHByb21pc2VSZXNvbHZlKEMsIG9uRmluYWxseSgpKS50aGVuKGZ1bmN0aW9uICgpIHsgcmV0dXJuIHg7IH0pO1xuICAgIH0gOiBvbkZpbmFsbHksXG4gICAgaXNGdW5jdGlvbiA/IGZ1bmN0aW9uIChlKSB7XG4gICAgICByZXR1cm4gcHJvbWlzZVJlc29sdmUoQywgb25GaW5hbGx5KCkpLnRoZW4oZnVuY3Rpb24gKCkgeyB0aHJvdyBlOyB9KTtcbiAgICB9IDogb25GaW5hbGx5XG4gICk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5wcm9taXNlLmZpbmFsbHkuanNcbi8vIG1vZHVsZSBpZCA9IDQwOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///408\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(0);\nvar newPromiseCapability = __webpack_require__(130);\nvar perform = __webpack_require__(174);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucHJvbWlzZS50cnkuanM/NDFjNSJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1wcm9taXNlLXRyeVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBuZXdQcm9taXNlQ2FwYWJpbGl0eSA9IHJlcXVpcmUoJy4vX25ldy1wcm9taXNlLWNhcGFiaWxpdHknKTtcbnZhciBwZXJmb3JtID0gcmVxdWlyZSgnLi9fcGVyZm9ybScpO1xuXG4kZXhwb3J0KCRleHBvcnQuUywgJ1Byb21pc2UnLCB7ICd0cnknOiBmdW5jdGlvbiAoY2FsbGJhY2tmbikge1xuICB2YXIgcHJvbWlzZUNhcGFiaWxpdHkgPSBuZXdQcm9taXNlQ2FwYWJpbGl0eS5mKHRoaXMpO1xuICB2YXIgcmVzdWx0ID0gcGVyZm9ybShjYWxsYmFja2ZuKTtcbiAgKHJlc3VsdC5lID8gcHJvbWlzZUNhcGFiaWxpdHkucmVqZWN0IDogcHJvbWlzZUNhcGFiaWxpdHkucmVzb2x2ZSkocmVzdWx0LnYpO1xuICByZXR1cm4gcHJvbWlzZUNhcGFiaWxpdHkucHJvbWlzZTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnByb21pc2UudHJ5LmpzXG4vLyBtb2R1bGUgaWQgPSA0MDlcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///409\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar toMetaKey = metadata.key;\nvar ordinaryDefineOwnMetadata = metadata.set;\n\nmetadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {\n ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWZpbmUtbWV0YWRhdGEuanM/Yzg5ZCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xudmFyIG9yZGluYXJ5RGVmaW5lT3duTWV0YWRhdGEgPSBtZXRhZGF0YS5zZXQ7XG5cbm1ldGFkYXRhLmV4cCh7IGRlZmluZU1ldGFkYXRhOiBmdW5jdGlvbiBkZWZpbmVNZXRhZGF0YShtZXRhZGF0YUtleSwgbWV0YWRhdGFWYWx1ZSwgdGFyZ2V0LCB0YXJnZXRLZXkpIHtcbiAgb3JkaW5hcnlEZWZpbmVPd25NZXRhZGF0YShtZXRhZGF0YUtleSwgbWV0YWRhdGFWYWx1ZSwgYW5PYmplY3QodGFyZ2V0KSwgdG9NZXRhS2V5KHRhcmdldEtleSkpO1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWZpbmUtbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQxMFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///410\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar toMetaKey = metadata.key;\nvar getOrCreateMetadataMap = metadata.map;\nvar store = metadata.store;\n\nmetadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {\n var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);\n var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);\n if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;\n if (metadataMap.size) return true;\n var targetMetadata = store.get(target);\n targetMetadata['delete'](targetKey);\n return !!targetMetadata.size || store['delete'](target);\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5kZWxldGUtbWV0YWRhdGEuanM/ZGVhZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFu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pZCA9IDQxMVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///411\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar getPrototypeOf = __webpack_require__(30);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nvar ordinaryGetMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;\n};\n\nmetadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtbWV0YWRhdGEuanM/MzQ3NiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0UHJvdG90eXBlT2YgPSByZXF1aXJlKCcuL19vYmplY3QtZ3BvJyk7XG52YXIgb3JkaW5hcnlIYXNP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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///412\n")},function(module,exports,__webpack_require__){eval("var Set = __webpack_require__(178);\nvar from = __webpack_require__(187);\nvar metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar getPrototypeOf = __webpack_require__(30);\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nvar ordinaryMetadataKeys = function (O, P) {\n var oKeys = ordinaryOwnMetadataKeys(O, P);\n var parent = getPrototypeOf(O);\n if (parent === null) return oKeys;\n var pKeys = ordinaryMetadataKeys(parent, P);\n return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;\n};\n\nmetadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {\n return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtbWV0YWRhdGEta2V5cy5qcz9iZjc4Il0sInNvdXJjZXNDb250ZW50IjpbInZhciBTZXQgPSByZXF1aXJlKCcuL2VzNi5zZXQnKTtcbnZhciBmcm9tID0gcmVxdWlyZSgnLi9fYXJyYXktZnJvbS1pdGVyYWJsZScpO1xudmFyIG1ldGFkYXRhID0gcmVxdWlyZSgnLi9fbWV0YWRhdGEnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgn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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///413\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar ordinaryGetOwnMetadata = metadata.get;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryGetOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtb3duLW1ldGFkYXRhLmpzP2NkOTEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1ldGFkYXRhID0gcmVxdWlyZSgnLi9fbWV0YWRhdGEnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIG9yZGluYXJ5R2V0T3duTWV0YWRhdGEgPSBtZXRhZGF0YS5nZXQ7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xuXG5tZXRhZGF0YS5leHAoeyBnZXRPd25NZXRhZGF0YTogZnVuY3Rpb24gZ2V0T3duTWV0YWRhdGEobWV0YWRhdGFLZXksIHRhcmdldCAvKiAsIHRhcmdldEtleSAqLykge1xuICByZXR1cm4gb3JkaW5hcnlHZXRPd25NZXRhZGF0YShtZXRhZGF0YUtleSwgYW5PYmplY3QodGFyZ2V0KVxuICAgICwgYXJndW1lbnRzLmxlbmd0aCA8IDMgPyB1bmRlZmluZWQgOiB0b01ldGFLZXkoYXJndW1lbnRzWzJdKSk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5yZWZsZWN0LmdldC1vd24tbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQxNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///414\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar ordinaryOwnMetadataKeys = metadata.keys;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {\n return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5nZXQtb3duLW1ldGFkYXRhLWtleXMuanM/YmVjOCJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgbWV0YWRhdGEgPSByZXF1aXJlKCcuL19tZXRhZGF0YScpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgb3JkaW5hcnlPd25NZXRhZGF0YUtleXMgPSBtZXRhZGF0YS5rZXlzO1xudmFyIHRvTWV0YUtleSA9IG1ldGFkYXRhLmtleTtcblxubWV0YWRhdGEuZXhwKHsgZ2V0T3duTWV0YWRhdGFLZXlzOiBmdW5jdGlvbiBnZXRPd25NZXRhZGF0YUtleXModGFyZ2V0IC8qICwgdGFyZ2V0S2V5ICovKSB7XG4gIHJldHVybiBvcmRpbmFyeU93bk1ldGFkYXRhS2V5cyhhbk9iamVjdCh0YXJnZXQpLCBhcmd1bWVudHMubGVuZ3RoIDwgMiA/IHVuZGVmaW5lZCA6IHRvTWV0YUtleShhcmd1bWVudHNbMV0pKTtcbn0gfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnJlZmxlY3QuZ2V0LW93bi1tZXRhZGF0YS1rZXlzLmpzXG4vLyBtb2R1bGUgaWQgPSA0MTVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///415\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar getPrototypeOf = __webpack_require__(30);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nvar ordinaryHasMetadata = function (MetadataKey, O, P) {\n var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn) return true;\n var parent = getPrototypeOf(O);\n return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;\n};\n\nmetadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE2LmpzIiw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blxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LnJlZmxlY3QuaGFzLW1ldGFkYXRhLmpzXG4vLyBtb2R1bGUgaWQgPSA0MTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///416\n")},function(module,exports,__webpack_require__){eval("var metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar ordinaryHasOwnMetadata = metadata.has;\nvar toMetaKey = metadata.key;\n\nmetadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {\n return ordinaryHasOwnMetadata(metadataKey, anObject(target)\n , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5oYXMtb3duLW1ldGFkYXRhLmpzP2M4ZWIiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIG1ldGFkYXRhID0gcmVxdWlyZSgnLi9fbWV0YWRhdGEnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIG9yZGluYXJ5SGFzT3duTWV0YWRhdGEgPSBtZXRhZGF0YS5oYXM7XG52YXIgdG9NZXRhS2V5ID0gbWV0YWRhdGEua2V5O1xuXG5tZXRhZGF0YS5leHAoeyBoYXNPd25NZXRhZGF0YTogZnVuY3Rpb24gaGFzT3duTWV0YWRhdGEobWV0YWRhdGFLZXksIHRhcmdldCAvKiAsIHRhcmdldEtleSAqLykge1xuICByZXR1cm4gb3JkaW5hcnlIYXNPd25NZXRhZGF0YShtZXRhZGF0YUtleSwgYW5PYmplY3QodGFyZ2V0KVxuICAgICwgYXJndW1lbnRzLmxlbmd0aCA8IDMgPyB1bmRlZmluZWQgOiB0b01ldGFLZXkoYXJndW1lbnRzWzJdKSk7XG59IH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL2VzNy5yZWZsZWN0Lmhhcy1vd24tbWV0YWRhdGEuanNcbi8vIG1vZHVsZSBpZCA9IDQxN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///417\n")},function(module,exports,__webpack_require__){eval("var $metadata = __webpack_require__(44);\nvar anObject = __webpack_require__(5);\nvar aFunction = __webpack_require__(20);\nvar toMetaKey = $metadata.key;\nvar ordinaryDefineOwnMetadata = $metadata.set;\n\n$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {\n return function decorator(target, targetKey) {\n ordinaryDefineOwnMetadata(\n metadataKey, metadataValue,\n (targetKey !== undefined ? anObject : aFunction)(target),\n toMetaKey(targetKey)\n );\n };\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcucmVmbGVjdC5tZXRhZGF0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//# sourceURL=webpack-internal:///418\n")},function(module,exports,__webpack_require__){eval("// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask\nvar $export = __webpack_require__(0);\nvar microtask = __webpack_require__(129)();\nvar process = __webpack_require__(7).process;\nvar isNode = __webpack_require__(34)(process) == 'process';\n\n$export($export.G, {\n asap: function asap(fn) {\n var domain = isNode && process.domain;\n microtask(domain ? domain.bind(fn) : fn);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDE5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcuYXNhcC5qcz82OGNkIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGh0dHBzOi8vZ2l0aHViLmNvbS9yd2FsZHJvbi90YzM5LW5vdGVzL2Jsb2IvbWFzdGVyL2VzNi8yMDE0LTA5L3NlcHQtMjUubWQjNTEwLWdsb2JhbGFzYXAtZm9yLWVucXVldWluZy1hLW1pY3JvdGFza1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciBtaWNyb3Rhc2sgPSByZXF1aXJlKCcuL19taWNyb3Rhc2snKSgpO1xudmFyIHByb2Nlc3MgPSByZXF1aXJlKCcuL19nbG9iYWwnKS5wcm9jZXNzO1xudmFyIGlzTm9kZSA9IHJlcXVpcmUoJy4vX2NvZicpKHByb2Nlc3MpID09ICdwcm9jZXNzJztcblxuJGV4cG9ydCgkZXhwb3J0LkcsIHtcbiAgYXNhcDogZnVuY3Rpb24gYXNhcChmbikge1xuICAgIHZhciBkb21haW4gPSBpc05vZGUgJiYgcHJvY2Vzcy5kb21haW47XG4gICAgbWljcm90YXNrKGRvbWFpbiA/IGRvbWFpbi5iaW5kKGZuKSA6IGZuKTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvZXM3LmFzYXAuanNcbi8vIG1vZHVsZSBpZCA9IDQxOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///419\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/zenparsing/es-observable\nvar $export = __webpack_require__(0);\nvar global = __webpack_require__(7);\nvar core = __webpack_require__(32);\nvar microtask = __webpack_require__(129)();\nvar OBSERVABLE = __webpack_require__(10)('observable');\nvar aFunction = __webpack_require__(20);\nvar anObject = __webpack_require__(5);\nvar anInstance = __webpack_require__(59);\nvar redefineAll = __webpack_require__(61);\nvar hide = __webpack_require__(23);\nvar forOf = __webpack_require__(60);\nvar RETURN = forOf.RETURN;\n\nvar getMethod = function (fn) {\n return fn == null ? undefined : aFunction(fn);\n};\n\nvar cleanupSubscription = function (subscription) {\n var cleanup = subscription._c;\n if (cleanup) {\n subscription._c = undefined;\n cleanup();\n }\n};\n\nvar subscriptionClosed = function (subscription) {\n return subscription._o === undefined;\n};\n\nvar closeSubscription = function (subscription) {\n if (!subscriptionClosed(subscription)) {\n subscription._o = undefined;\n cleanupSubscription(subscription);\n }\n};\n\nvar Subscription = function (observer, subscriber) {\n anObject(observer);\n this._c = undefined;\n this._o = observer;\n observer = new SubscriptionObserver(this);\n try {\n var cleanup = subscriber(observer);\n var subscription = cleanup;\n if (cleanup != null) {\n if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };\n else aFunction(cleanup);\n this._c = cleanup;\n }\n } catch (e) {\n observer.error(e);\n return;\n } if (subscriptionClosed(this)) cleanupSubscription(this);\n};\n\nSubscription.prototype = redefineAll({}, {\n unsubscribe: function unsubscribe() { closeSubscription(this); }\n});\n\nvar SubscriptionObserver = function (subscription) {\n this._s = subscription;\n};\n\nSubscriptionObserver.prototype = redefineAll({}, {\n next: function next(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n try {\n var m = getMethod(observer.next);\n if (m) return m.call(observer, value);\n } catch (e) {\n try {\n closeSubscription(subscription);\n } finally {\n throw e;\n }\n }\n }\n },\n error: function error(value) {\n var subscription = this._s;\n if (subscriptionClosed(subscription)) throw value;\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.error);\n if (!m) throw value;\n value = m.call(observer, value);\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n },\n complete: function complete(value) {\n var subscription = this._s;\n if (!subscriptionClosed(subscription)) {\n var observer = subscription._o;\n subscription._o = undefined;\n try {\n var m = getMethod(observer.complete);\n value = m ? m.call(observer, value) : undefined;\n } catch (e) {\n try {\n cleanupSubscription(subscription);\n } finally {\n throw e;\n }\n } cleanupSubscription(subscription);\n return value;\n }\n }\n});\n\nvar $Observable = function Observable(subscriber) {\n anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);\n};\n\nredefineAll($Observable.prototype, {\n subscribe: function subscribe(observer) {\n return new Subscription(observer, this._f);\n },\n forEach: function forEach(fn) {\n var that = this;\n return new (core.Promise || global.Promise)(function (resolve, reject) {\n aFunction(fn);\n var subscription = that.subscribe({\n next: function (value) {\n try {\n return fn(value);\n } catch (e) {\n reject(e);\n subscription.unsubscribe();\n }\n },\n error: reject,\n complete: resolve\n });\n });\n }\n});\n\nredefineAll($Observable, {\n from: function from(x) {\n var C = typeof this === 'function' ? this : $Observable;\n var method = getMethod(anObject(x)[OBSERVABLE]);\n if (method) {\n var observable = anObject(method.call(x));\n return observable.constructor === C ? observable : new C(function (observer) {\n return observable.subscribe(observer);\n });\n }\n return new C(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n try {\n if (forOf(x, false, function (it) {\n observer.next(it);\n if (done) return RETURN;\n }) === RETURN) return;\n } catch (e) {\n if (done) throw e;\n observer.error(e);\n return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n },\n of: function of() {\n for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];\n return new (typeof this === 'function' ? this : $Observable)(function (observer) {\n var done = false;\n microtask(function () {\n if (!done) {\n for (var j = 0; j < items.length; ++j) {\n observer.next(items[j]);\n if (done) return;\n } observer.complete();\n }\n });\n return function () { done = true; };\n });\n }\n});\n\nhide($Observable.prototype, OBSERVABLE, function () { return this; });\n\n$export($export.G, { Observable: $Observable });\n\n__webpack_require__(58)('Observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9lczcub2JzZXJ2YWJsZS5qcz85ZTFkIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS96ZW5wYXJzaW5nL2VzLW9ic2VydmFibGVcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBtaWNyb3Rhc2sgPSByZXF1aXJlKCcuL19taWNyb3Rhc2snKSgpO1xudmFyIE9CU0VSVkFCTEUgPSByZXF1aXJlKCcuL193a3MnKSgnb2JzZXJ2YWJsZScpO1xudmFyIGFGdW5jdGlvbiA9IHJlcXVpcmUoJy4vX2EtZnVuY3Rpb24nKTt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YmxlIDogbmV3IEMoZnVuY3Rpb24gKG9ic2VydmVyKSB7XG4gICAgICAgIHJldHVybiBvYnNlcnZhYmxlLnN1YnNjcmliZShvYnNlcnZlcik7XG4gICAgICB9KTtcbiAgICB9XG4gICAgcmV0dXJuIG5ldyBDKGZ1bmN0aW9uIChvYnNlcnZlcikge1xuICAgICAgdmFyIGRvbmUgPSBmYWxzZTtcbiAgICAgIG1pY3JvdGFzayhmdW5jdGlvbiAoKSB7XG4gICAgICAgIGlmICghZG9uZSkge1xuICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICBpZiAoZm9yT2YoeCwgZmFsc2UsIGZ1bmN0aW9uIChpdCkge1xuICAgICAgICAgICAgICBvYnNlcnZlci5uZXh0KGl0KTtcbiAgICAgICAgICAgICAgaWYgKGRvbmUpIHJldHVybiBSRVRVUk47XG4gICAgICAgICAgICB9KSA9PT0gUkVUVVJOKSByZXR1cm47XG4gICAgICAgICAgfSBjYXRjaCAoZSkge1xuICAgICAgICAgICAgaWYgKGRvbmUpIHRocm93IGU7XG4gICAgICAgICAgICBvYnNlcnZlci5lcnJvcihlKTtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICB9IG9ic2VydmVyLmNvbXBsZXRlKCk7XG4gICAgICAgIH1cbiAgICAgIH0pO1xuICAgICAgcmV0dXJuIGZ1bmN0aW9uICgpIHsgZG9uZSA9IHRydWU7IH07XG4gICAgfSk7XG4gIH0sXG4gIG9mOiBmdW5jdGlvbiBvZigpIHtcbiAgICBmb3IgKHZhciBpID0gMCwgbCA9IGFyZ3VtZW50cy5sZW5ndGgsIGl0ZW1zID0gbmV3IEFycmF5KGwpOyBpIDwgbDspIGl0ZW1zW2ldID0gYXJndW1lbnRzW2krK107XG4gICAgcmV0dXJuIG5ldyAodHlwZW9mIHRoaXMgPT09ICdmdW5jdGlvbicgPyB0aGlzIDogJE9ic2VydmFibGUpKGZ1bmN0aW9uIChvYnNlcnZlcikge1xuICAgICAgdmFyIGRvbmUgP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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///420\n")},function(module,exports,__webpack_require__){eval("// ie9- setTimeout & setInterval additional parameters fix\nvar global = __webpack_require__(7);\nvar $export = __webpack_require__(0);\nvar userAgent = __webpack_require__(92);\nvar slice = [].slice;\nvar MSIE = /MSIE .\\./.test(userAgent); // <- dirty ie9- check\nvar wrap = function (set) {\n return function (fn, time /* , ...args */) {\n var boundArgs = arguments.length > 2;\n var args = boundArgs ? slice.call(arguments, 2) : false;\n return set(boundArgs ? function () {\n // eslint-disable-next-line no-new-func\n (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);\n } : fn, time);\n };\n};\n$export($export.G + $export.B + $export.F * MSIE, {\n setTimeout: wrap(global.setTimeout),\n setInterval: wrap(global.setInterval)\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIudGltZXJzLmpzP2JmYzUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaWU5LSBzZXRUaW1lb3V0ICYgc2V0SW50ZXJ2YWwgYWRkaXRpb25hbCBwYXJhbWV0ZXJzIGZpeFxudmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciB1c2VyQWdlbnQgPSByZXF1aXJlKCcuL191c2VyLWFnZW50Jyk7XG52YXIgc2xpY2UgPSBbXS5zbGljZTtcbnZhciBNU0lFID0gL01TSUUgLlxcLi8udGVzdCh1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tBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///421\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(0);\nvar $task = __webpack_require__(128);\n$export($export.G + $export.B, {\n setImmediate: $task.set,\n clearImmediate: $task.clear\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIuaW1tZWRpYXRlLmpzPzc2MjciXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZhciAkdGFzayA9IHJlcXVpcmUoJy4vX3Rhc2snKTtcbiRleHBvcnQoJGV4cG9ydC5HICsgJGV4cG9ydC5CLCB7XG4gIHNldEltbWVkaWF0ZTogJHRhc2suc2V0LFxuICBjbGVhckltbWVkaWF0ZTogJHRhc2suY2xlYXJcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9tb2R1bGVzL3dlYi5pbW1lZGlhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDQyMlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///422\n")},function(module,exports,__webpack_require__){eval("var $iterators = __webpack_require__(127);\nvar getKeys = __webpack_require__(54);\nvar redefine = __webpack_require__(24);\nvar global = __webpack_require__(7);\nvar hide = __webpack_require__(23);\nvar Iterators = __webpack_require__(66);\nvar wks = __webpack_require__(10);\nvar ITERATOR = wks('iterator');\nvar TO_STRING_TAG = wks('toStringTag');\nvar ArrayValues = Iterators.Array;\n\nvar DOMIterables = {\n CSSRuleList: true, // TODO: Not spec compliant, should be false.\n CSSStyleDeclaration: false,\n CSSValueList: false,\n ClientRectList: false,\n DOMRectList: false,\n DOMStringList: false,\n DOMTokenList: true,\n DataTransferItemList: false,\n FileList: false,\n HTMLAllCollection: false,\n HTMLCollection: false,\n HTMLFormElement: false,\n HTMLSelectElement: false,\n MediaList: true, // TODO: Not spec compliant, should be false.\n MimeTypeArray: false,\n NamedNodeMap: false,\n NodeList: true,\n PaintRequestList: false,\n Plugin: false,\n PluginArray: false,\n SVGLengthList: false,\n SVGNumberList: false,\n SVGPathSegList: false,\n SVGPointList: false,\n SVGStringList: false,\n SVGTransformList: false,\n SourceBufferList: false,\n StyleSheetList: true, // TODO: Not spec compliant, should be false.\n TextTrackCueList: false,\n TextTrackList: false,\n TouchList: false\n};\n\nfor (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {\n var NAME = collections[i];\n var explicit = DOMIterables[NAME];\n var Collection = global[NAME];\n var proto = Collection && Collection.prototype;\n var key;\n if (proto) {\n if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);\n if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);\n Iterators[NAME] = ArrayValues;\n if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);\n }\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy93ZWIuZG9tLml0ZXJhYmxlLmpzPzdmMWQiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRpdGVyYXRvcnMgPSByZXF1aXJlKCcuL2VzNi5hcnJheS5pdGVyYXRvcicpO1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta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hpZGUocHJvdG8sIFRPX1NUUklOR19UQUcsIE5BTUUpO1xuICAgIEl0ZXJhdG9yc1tOQU1FXSA9IEFycmF5VmFsdWVzO1xuICAgIGlmIChleHBsaWNpdCkgZm9yIChrZXkgaW4gJGl0ZXJhdG9ycykgaWYgKCFwcm90b1trZXldKSByZWRlZmluZShwcm90bywga2V5LCAkaXRlcmF0b3JzW2tleV0sIHRydWUpO1xuICB9XG59XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZS5qc1xuLy8gbW9kdWxlIGlkID0gNDIzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///423\n")},function(module,exports,__webpack_require__){eval('/* WEBPACK VAR INJECTION */(function(global) {/**\n * Copyright (c) 2014, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * https://raw.github.com/facebook/regenerator/master/LICENSE file. An\n * additional grant of patent rights can be found in the PATENTS file in\n * the same directory.\n */\n\n!(function(global) {\n "use strict";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === "function" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || "@@iterator";\n var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";\n var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";\n\n var inModule = typeof module === "object";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we\'re in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don\'t bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we\'re in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there\'s no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don\'t have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: "normal", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: "throw", arg: err };\n }\n }\n\n var GenStateSuspendedStart = "suspendedStart";\n var GenStateSuspendedYield = "suspendedYield";\n var GenStateExecuting = "executing";\n var GenStateCompleted = "completed";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don\'t natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = "GeneratorFunction";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n ["next", "throw", "return"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === "function" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === "GeneratorFunction"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = "GeneratorFunction";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, "__await")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === "throw") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === "object" &&\n hasOwn.call(value, "__await")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke("next", value, resolve, reject);\n }, function(err) {\n invoke("throw", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration. If the Promise is rejected, however, the\n // result for this iteration will be rejected with the same\n // reason. Note that rejections of yielded Promises are not\n // thrown back into the generator function, as is the case\n // when an awaited Promise is rejected. This difference in\n // behavior between yield and await is important, because it\n // allows the consumer to decide what to do with the yielded\n // rejection (swallow it and continue, manually .throw it back\n // into the generator, abandon iteration, whatever). With\n // await, by contrast, there is no opportunity to examine the\n // rejection reason outside the generator function, so the\n // only option is to throw it from the await expression, and\n // let the generator function handle the exception.\n result.value = unwrapped;\n resolve(result);\n }, reject);\n }\n }\n\n if (typeof global.process === "object" && global.process.domain) {\n invoke = global.process.domain.bind(invoke);\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error("Generator is already running");\n }\n\n if (state === GenStateCompleted) {\n if (method === "throw") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === "next") {\n // Setting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === "throw") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === "return") {\n context.abrupt("return", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === "normal") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === "throw") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = "throw";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === "throw") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = "return";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === "throw") {\n // If maybeInvokeDelegate(context) changed context.method from\n // "return" to "throw", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = "throw";\n context.arg = new TypeError(\n "The iterator does not provide a \'throw\' method");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === "throw") {\n context.method = "throw";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = "throw";\n context.arg = new TypeError("iterator result is not an object");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was "throw" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was "next", forget context.arg since it has been\n // "consumed" by the delegate iterator. If context.method was\n // "return", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== "return") {\n context.method = "next";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = "Generator";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers\' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn\'t happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return "[object Generator]";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = "normal";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: "root" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === "function") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel\'s\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = "next";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === "t" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === "throw") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = "throw";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = "next";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === "root") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle("end");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, "catchLoc");\n var hasFinally = hasOwn.call(entry, "finallyLoc");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error("try statement without catch or finally");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, "finallyLoc") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === "break" ||\n type === "continue") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = "next";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === "throw") {\n throw record.arg;\n }\n\n if (record.type === "break" ||\n record.type === "continue") {\n this.next = record.arg;\n } else if (record.type === "return") {\n this.rval = this.arg = record.arg;\n this.method = "return";\n this.next = "end";\n } else if (record.type === "normal" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n "catch": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === "throw") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error("illegal catch attempt");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === "next") {\n // Deliberately forget the last sent value so that we don\'t\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // Among the various tricks for obtaining a reference to the global\n // object, this seems to be the most reliable technique that does not\n // use indirect eval (which violates Content Security Policy).\n typeof global === "object" ? global :\n typeof window === "object" ? window :\n typeof self === "object" ? self : this\n);\n\n/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(154)))//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXBvbHlmaWxsL25vZGVfbW9kdWxlcy9yZWdlbmVyYXRvci1ydW50aW1lL3J1bnRpbWUuanM/Y2U0NSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxNCwgRmFjZWJvb2ssIEluYy5cbiAqIEFsbCByaWdodHMgcmVzZXJ2ZWQuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgQlNELXN0eWxlIGxpY2V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gICAgICAgICA/IEdlblN0YXRlQ29tcGxldGVkXG4gICAgICAgICAgICA6IEdlblN0YXRlU3VzcGVuZGVkWWllbGQ7XG5cbiAgICAgICAgICBpZiAocmVjb3JkLmFyZyA9PT0gQ29udGludWVTZW50aW5lbCkge1xuICAgICAgICAgICAgY29udGludWU7XG4gICAgICAgICAgfVxuXG4gICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgIHZhbHVlOiByZWNvcmQuYXJnLFxuICAgICAgICAgICAgZG9uZTogY29udGV4dC5kb25lXG4gICAgICAgICAgfTtcblxuICAgICAgICB9IGVsc2UgaWYgKHJlY29yZC50eXBlID09PSBcInRocm93XCIpIHtcbiAgICAgICAgICBzdGF0ZSA9IEdlblN0YXRlQ29tcGxldGVkO1xuICAgICAgICAgIC8vIERpc3BhdGNoIHRoZSBleGNlcHRpb24gYnkgbG9vcGluZyBiYWNrIGFyb3VuZCB0byB0aGVcbiAgICAgICAgICAvLyBjb250ZXh0LmRpc3BhdGNoRXhjZXB0aW9uKGNvbnRleHQuYXJnKSBjYWxsIGFib3ZlLlxuICAgICAgICAgIGNvbnRleHQubWV0aG9kID0gXCJ0aHJvd1wiO1xuICAgICAgICAgIGNvbnRleHQuYXJnID0gcmVjb3JkLmFyZztcbiAgICAgICAgfVxuICAgICAgfVxuICAgIH07XG4gIH1cblxuICAvLyBDYWxsIGRlbGVnYXRlLml0ZXJhdG9yW2NvbnRleHQubWV0aG9kXShjb250ZXh0LmFyZykgYW5kIGhhbmRsZSB0aGVcbiAgLy8gcmVzdWx0LCBlaXRoZXIgYnkgcmV0dXJuaW5nIGEgeyB2YWx1ZSwgZG9uZSB9IHJlc3VsdCBmcm9tIHRoZVxuICAvLyBkZWxlZ2F0ZSBpdGVyYXRvciwgb3IgYnkgbW9kaWZ5aW5nIGNvbnRleHQubWV0aG9kIGFuZCBjb250ZXh0LmFyZyxcbiAgLy8gc2V0dGluZyBjb250ZXh0LmRlbGVnYXRlIHRvIG51bGwsIGFuZCBy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gICAgICAgICBjb250ZXh0Lm1ldGhvZCA9IFwibmV4dFwiO1xuICAgICAgICAgIGNvbnRleHQuYXJnID0gdW5kZWZpbmVkO1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuICEhIGNhdWdodDtcbiAgICAgIH1cblxuICAgICAgZm9yICh2YXIgaSA9IHRoaXMudHJ5RW50cmllcy5sZW5ndGggLSAxOyBpID49IDA7IC0taSkge1xuICAgICAgICB2YXIgZW50cnkgPSB0aGlzLnRyeUVudHJpZXNbaV07XG4gICAgICAgIHZhciByZWNvcmQgPSBlbnRyeS5jb21wbGV0aW9uO1xuXG4gICAgICAgIGlmIChlbnRyeS50cnlMb2MgPT09IFwicm9vdFwiKSB7XG4gICAgICAgICAgLy8gRXhjZXB0aW9uIHRocm93biBvdXRzaWRlIG9mIGFueSB0cnkgYmxvY2sgdGhhdCBjb3VsZCBoYW5kbGVcbiAgICAgICAgICAvLyBpdCwgc28gc2V0IHRoZSBjb21wbGV0aW9uIHZhbHVlIG9mIHRoZSBlbnRpcmUgZnVuY3Rpb24gdG9cbiAgICAgICAgICAvLyB0aHJvdyB0aGUgZXhjZXB0aW9uLlxuICAgICAgICAgIHJldHVybiBoYW5kbGUoXCJlbmRcIik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoZW50cnkudHJ5TG9jIDw9IHRoaXMucHJldikge1xuICAgICAgICAgIHZhciBoYXNDYXRjaCA9IGhhc093bi5jYWxsKGVudHJ5LCBcImNhdGNoTG9jXCIpO1xuICAgICAgICAgIHZhciBoYXNGaW5hbGx5ID0gaGFzT3duLmNhbGwoZW50cnksIFwiZmluYWxseUxvY1wiKTtcblxuICAgICAgICAgIGlmIChoYXNDYXRjaCAmJiBoYXNGaW5hbGx5KSB7XG4gICAgICAgICAgICBpZiAodGhpcy5wcmV2IDwgZW50cnkuY2F0Y2hMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5jYXRjaExvYywgdHJ1ZSk7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5maW5hbGx5TG9jKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0gZWxzZSBpZiAoaGFzQ2F0Y2gpIHtcbiAgICAgICAgICAgIGlmICh0aGlzLnByZXYgPCBlbnRyeS5jYXRjaExvYykge1xuICAgICAgICAgICAgICByZXR1cm4gaGFuZGxlKGVudHJ5LmNhdGNoTG9jLCB0cnVlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0gZWxzZSBpZiAoaGFzRmluYWxseSkge1xuICAgICAgICAgICAgaWYgKHRoaXMucHJldiA8IGVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgICAgICAgcmV0dXJuIGhhbmRsZShlbnRyeS5maW5hbGx5TG9jKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJ0cnkgc3RhdGVtZW50IHdpdGhvdXQgY2F0Y2ggb3IgZmluYWxseVwiKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9LFxuXG4gICAgYWJydXB0OiBmdW5jdGlvbih0eXBlLCBhcmcpIHtcbiAgICAgIGZvciAodmFyIGkgPSB0aGlzLnRyeUVudHJpZXMubGVuZ3RoIC0gMTsgaSA+PSAwOyAtLWkpIHtcbiAgICAgICAgdmFyIGVudHJ5ID0gdGhpcy50cnlFbnRyaWVzW2ldO1xuICAgICAgICBpZiAoZW50cnkudHJ5TG9jIDw9IHRoaXMucHJldiAmJlxuICAgICAgICAgICAgaGFzT3duLmNhbGwoZW50cnksIFwiZmluYWxseUxvY1wiKSAmJlxuICAgICAgICAgICAgdGhpcy5wcmV2IDwgZW50cnkuZmluYWxseUxvYykge1xuICAgICAgICAgIHZhciBmaW5hbGx5RW50cnkgPSBlbnRyeTtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuICAgICAgfVxuXG4gICAgICBpZiAoZmluYWxseUVudHJ5ICYmXG4gICAgICAgICAgKHR5cGUgPT09IFwiYnJlYWtcIiB8fFxuICAgICAgICAgICB0eXBlID09PSBcImNvbnRpbnVlXCIpICYmXG4gICAgICAgICAgZmluYWxseUVudHJ5LnRyeUxvYyA8PSBhcmcgJiZcbiAgICAgICAgICBhcmcgPD0gZmluYWxseUVudHJ5LmZpbmFsbHlMb2MpIHtcbiAgICAgICAgLy8gSWdub3JlIHRoZSBmaW5hbGx5IGVudHJ5IGlmIGNvbnRyb2wgaXMgbm90IGp1bXBpbmcgdG8gYVxuICAgICAgICAvLyBsb2NhdGlvbiBvdXRzaWRlIHRoZSB0cnkvY2F0Y2ggYmxvY2suXG4gICAgICAgIGZpbmFsbHlFbnRyeSA9IG51bGw7XG4gICAgICB9XG5cbiAgICAgIHZhciByZWNvcmQgPSBmaW5hbGx5RW50cnkgPyBmaW5hbGx5RW50cnkuY29tcGxldGlvbiA6IHt9O1xuICAgICAgcmVjb3JkLnR5cGUgPSB0eXBlO1xuICAgICAgcmVjb3JkLmFyZyA9IGFyZztcblxuICAgICAgaWYgKGZpbmFsbHlFbnRyeSkge1xuICAgICAgICB0aGlzLm1ldGhvZCA9IFwibmV4dFwiO1xuICAgICAgICB0aGlzLm5leHQgPSBmaW5hbGx5RW50cnkuZmluYWxseUxvYztcbiAgICAgICAgcmV0dXJuIENvbnRpbnVlU2VudGluZWw7XG4gICAgICB9XG5cbiAgICAgIHJldHVybiB0aGlzLmNvbXBsZXRlKHJlY29yZCk7XG4gICAgfSxcblxuICAgIGNvbXBsZXRlOiBmdW5jdGlvbihyZWNvcmQsIGFmdGVyTG9jKSB7XG4gICAgICBpZiAocmVjb3JkLnR5cGUgPT09IFwidGhyb3dcIikge1xuICAgICAgICB0aHJvdyByZWNvcmQuYXJnO1xuICAgICAgfVxuXG4gIC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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///424\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(426);\nmodule.exports = __webpack_require__(32).RegExp.escape;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvZm4vcmVnZXhwL2VzY2FwZS5qcz81YjA5Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvY29yZS5yZWdleHAuZXNjYXBlJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5SZWdFeHAuZXNjYXBlO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9mbi9yZWdleHAvZXNjYXBlLmpzXG4vLyBtb2R1bGUgaWQgPSA0MjVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///425\n")},function(module,exports,__webpack_require__){eval("// https://github.com/benjamingr/RexExp.escape\nvar $export = __webpack_require__(0);\nvar $re = __webpack_require__(427)(/[\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n\n$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLnJlZ2V4cC5lc2NhcGUuanM/YWY2MSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vYmVuamFtaW5nci9SZXhFeHAuZXNjYXBlXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICRyZSA9IHJlcXVpcmUoJy4vX3JlcGxhY2VyJykoL1tcXFxcXiQqKz8uKCl8W1xcXXt9XS9nLCAnXFxcXCQmJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUmVnRXhwJywgeyBlc2NhcGU6IGZ1bmN0aW9uIGVzY2FwZShpdCkgeyByZXR1cm4gJHJlKGl0KTsgfSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9jb3JlLnJlZ2V4cC5lc2NhcGUuanNcbi8vIG1vZHVsZSBpZCA9IDQyNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///426\n")},function(module,exports){eval("module.exports = function (regExp, replace) {\n var replacer = replace === Object(replace) ? function (part) {\n return replace[part];\n } : replace;\n return function (it) {\n return String(it).replace(regExp, replacer);\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcmVwbGFjZXIuanM/OWVhMyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChyZWdFeHAsIHJlcGxhY2UpIHtcbiAgdmFyIHJlcGxhY2VyID0gcmVwbGFjZSA9PT0gT2JqZWN0KHJlcGxhY2UpID8gZnVuY3Rpb24gKHBhcnQpIHtcbiAgICByZXR1cm4gcmVwbGFjZVtwYXJ0XTtcbiAgfSA6IHJlcGxhY2U7XG4gIHJldHVybiBmdW5jdGlvbiAoaXQpIHtcbiAgICByZXR1cm4gU3RyaW5nKGl0KS5yZXBsYWNlKHJlZ0V4cCwgcmVwbGFjZXIpO1xuICB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbW9kdWxlcy9fcmVwbGFjZXIuanNcbi8vIG1vZHVsZSBpZCA9IDQyN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///427\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _logLevels = __webpack_require__(455);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _Registry = __webpack_require__(456);\n\nvar _Registry2 = _interopRequireDefault(_Registry);\n\nvar _IdentityModule = __webpack_require__(511);\n\nvar _IdentityModule2 = _interopRequireDefault(_IdentityModule);\n\nvar _IdentityHandler = __webpack_require__(517);\n\nvar _IdentityHandler2 = _interopRequireDefault(_IdentityHandler);\n\nvar _PEP = __webpack_require__(518);\n\nvar _PEP2 = _interopRequireDefault(_PEP);\n\nvar _MessageBus = __webpack_require__(525);\n\nvar _MessageBus2 = _interopRequireDefault(_MessageBus);\n\nvar _utils = __webpack_require__(6);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar _CryptoManager2 = _interopRequireDefault(_CryptoManager);\n\nvar _Loader = __webpack_require__(529);\n\nvar _Loader2 = _interopRequireDefault(_Loader);\n\nvar _Storage = __webpack_require__(221);\n\nvar _Descriptors = __webpack_require__(530);\n\nvar _Descriptors2 = _interopRequireDefault(_Descriptors);\n\nvar _runtimeConfiguration = __webpack_require__(151);\n\nvar _MsgBusHandlers = __webpack_require__(531);\n\nvar _MsgBusHandlers2 = _interopRequireDefault(_MsgBusHandlers);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _CoreDiscovery = __webpack_require__(532);\n\nvar _CoreDiscovery2 = _interopRequireDefault(_CoreDiscovery);\n\nvar _DataObjectsStorage = __webpack_require__(533);\n\nvar _DataObjectsStorage2 = _interopRequireDefault(_DataObjectsStorage);\n\nvar _HypertyResourcesStorage = __webpack_require__(537);\n\nvar _HypertyResourcesStorage2 = _interopRequireDefault(_HypertyResourcesStorage);\n\nvar _SyncherManager = __webpack_require__(540);\n\nvar _SyncherManager2 = _interopRequireDefault(_SyncherManager);\n\nvar _SubscriptionManager = __webpack_require__(546);\n\nvar _SubscriptionManager2 = _interopRequireDefault(_SubscriptionManager);\n\nvar _RuntimeCoreCtx = __webpack_require__(548);\n\nvar _RuntimeCoreCtx2 = _interopRequireDefault(_RuntimeCoreCtx);\n\nvar _RuntimeCatalogue = __webpack_require__(550);\n\nvar _RuntimeCatalogue2 = _interopRequireDefault(_RuntimeCatalogue);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// import 'babel-polyfill';\n\nvar log = logger.getLogger('RuntimeUA');\n\n//Main dependecies\n\n\n// Log System\n\n\n//import GraphConnector from '../graphconnector/GraphConnector';\n\n/**\n * Runtime User Agent Interface will process all the dependecies of the core runtime;\n * @author Vitor Silva [vitor-t-silva@telecom.pt]\n * @version 0.4.0\n *\n * @property {runtimeFactory} runtimeFactory - Specific implementation for all environments;\n * @property {RuntimeCatalogue} runtimeCatalogue - Catalogue of components can be installed;\n * @property {runtimeURL} runtimeURL - This identify the core runtime, should be unique;\n * @property {IdentityModule} identityModule - Identity Module;\n * @property {PEP} policyEngine - Policy Engine Module;\n * @property {Registry} registry - Registry Module;\n * @property {MessageBus} messageBus - Message Bus is used like a router to redirect the messages from one component to other(s)\n * @property {GraphConnector} graphConnector - Graph Connector handling GUID and contacts\n * @property {CoreDiscovery} coreDiscovery - Discovery for discovery hyperties/dataObjects\n */\nvar RuntimeUA = function () {\n\n /**\n * Create a new instance of Runtime User Agent\n * @param {descriptor} runtimeDescriptor - pass all the hyperty runtime descriptor\n * @param {runtimeFactory} runtimeFactory - Specific implementation for the environment where the core runtime will run;\n * @param {domain} domainURL - specify the domain base for the runtime;\n */\n function RuntimeUA(runtimeDescriptor, runtimeFactory, domain) {\n (0, _classCallCheck3.default)(this, RuntimeUA);\n\n if (!runtimeDescriptor) throw new Error('The runtime descriptor is a needed parameter');\n if (!runtimeFactory) throw new Error('The sandbox factory is a needed parameter');\n if (!domain) throw new Error('You need the domain of runtime');\n\n // Configuration object with information related with servers\n this.runtimeConfiguration = (0, _assign2.default)({ domain: domain }, _runtimeConfiguration.runtimeConfiguration);\n this.runtimeFactory = runtimeFactory;\n\n this.log = log;\n this.logLevels = _logLevels.log;\n\n if (runtimeDescriptor.p2pHandlerStub && typeof runtimeDescriptor.p2pHandlerStub === 'string' && runtimeDescriptor.p2pHandlerStub.includes('://')) {\n this.p2p = true;\n } else {\n this.p2p = false;\n }\n\n _runtimeUtils.runtimeUtils.runtimeDescriptor = runtimeDescriptor;\n this.runtimeUtils = _runtimeUtils.runtimeUtils;\n\n this.storages = {};\n\n /* if (typeof runtimeFactory.createRuntimeCatalogue === 'function') {\n this.runtimeCatalogue = runtimeFactory.createRuntimeCatalogue();\n } else {\n throw new Error('Check your Runtime Factory because it needs the Runtime Catalogue implementation');\n }*/\n\n this.runtimeCatalogue = new _RuntimeCatalogue2.default(runtimeFactory);\n\n /* if (typeof runtimeFactory.persistenceManager === 'function') {\n this.persistenceManager = runtimeFactory.persistenceManager();\n } else {\n throw new Error('Check your Runtime Factory because it needs the Persistence Manager implementation');\n }*/\n\n if (typeof runtimeFactory.storageManager === 'function') {\n\n this.storages = (0, _Storage.storage)(runtimeFactory, this);\n } else {\n throw new Error('Check your Runtime Factory because it needs the Storage Manager implementation');\n }\n\n if (typeof runtimeFactory.runtimeCapabilities === 'function') {\n this.runtimeCapabilities = runtimeFactory.runtimeCapabilities(this.storages.capabilities);\n } else {\n log.info('Check your RuntimeFactory because it needs the Runtime Capabilities implementation');\n }\n }\n\n /**\n * Intialize the installation of runtime\n *\n * @access public\n * @return {Promise} this is Promise and if the installation process happened without any problems returns true otherwise the error.\n *\n * @memberOf RuntimeUA\n */\n\n\n (0, _createClass3.default)(RuntimeUA, [{\n key: 'init',\n value: function init() {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this2.domain = _this2.runtimeConfiguration.domain;\n\n log.info('[RuntimeUA - init] Starting ');\n\n try {\n var getCapabilities = _this2.runtimeCapabilities.getRuntimeCapabilities();\n var getRuntimeURL = _this2.storages.runtime.get('runtime:URL');\n var getStoredDataObjects = _this2.storages.syncherManager.get('syncherManager:ObjectURLs');\n var getHypertyStorageObjects = _this2.storages.hypertyResources.get();\n var getP2PHandlerURL = _this2.storages.runtime.get('p2pHandler:URL');\n // let getRemotes = this.storages.syncherManager.get('remotes');\n\n _promise2.default.all([getRuntimeURL, getCapabilities, getStoredDataObjects, getHypertyStorageObjects, getP2PHandlerURL]).then(function (results) {\n\n _this2.runtimeURL = results[0] ? results[0].runtimeURL : results[0];\n if (!_this2.runtimeURL) {\n _this2.runtimeURL = 'runtime://' + _this2.domain + '/' + (0, _utils.generateGUID)();\n _this2.storages.runtime.set('runtime:URL', 1, { runtimeURL: _this2.runtimeURL });\n }\n\n _this2.capabilities = results[1];\n (0, _assign2.default)(_runtimeUtils.runtimeUtils.runtimeCapabilities.constraints, results[1]);\n\n _this2._dataObjectsStorage = new _DataObjectsStorage2.default(_this2.storages.syncherManager, results[2] || {}, _this2.runtimeFactory, _this2);\n\n _this2._hypertyResources = results[3] || {};\n\n _this2.p2pHandlerURL = results[4] ? results[4].p2pHandlerURL : results[4];\n if (!_this2.p2pHandlerURL) {\n _this2.p2pHandlerURL = _this2.runtimeURL + '/p2phandler/' + (0, _utils.generateGUID)();\n log.info('[RuntimeUA - init] P2PHandlerURL: ', _this2.p2pHandlerURL);\n\n _this2.storages.runtime.set('p2pHandler:URL', 1, { p2pHandlerURL: _this2.p2pHandlerURL });\n }\n\n /* log.info('[RuntimeUA - init] dataObjectsStorage remote load starting');\n this._dataObjectsStorage.loadRemote().then(()=> {\n log.info('[RuntimeUA - init] dataObjectsStorage remote load concluded');*/\n return _this2._loadComponents();\n\n // });\n\n }).then(function (status) {\n\n _this2._hypertyResourcesStorage = new _HypertyResourcesStorage2.default(_this2.runtimeURL, _this2.messageBus, _this2.storages.hypertyResources, _this2._hypertyResources);\n\n if (_this2.p2p) {\n log.info('[RuntimeUA - init] load p2pHandler: ', status);\n return _this2._loadP2PHandler();\n } else {\n log.info('[RuntimeUA - init] P2P not supported');\n return 'P2P Not Supported';\n }\n }).then(function (result) {\n log.info('[runtime ua - init] - status: ', result);\n resolve(true);\n }, function (reason) {\n log.error('ERROR: ', reason);\n resolve(true);\n });\n } catch (e) {\n reject(e);\n }\n });\n }\n }, {\n key: '_updateRuntimeStatus',\n value: function _updateRuntimeStatus(event) {\n\n var _this = this;\n\n _this.messageBus.postMessage({\n from: this.runtimeURL,\n to: this.runtimeURL + '/status',\n type: 'update',\n body: event\n });\n }\n }, {\n key: '_loadP2PHandler',\n value: function _loadP2PHandler() {\n var _this3 = this;\n\n return new _promise2.default(function (resolve) {\n\n var runtimeDescriptor = _runtimeUtils.runtimeUtils.runtimeDescriptor;\n var p2pStubHandler = runtimeDescriptor.p2pHandlerStub;\n\n var p2pConfig = {\n isHandlerStub: true,\n runtimeURL: _this3.runtimeURL\n };\n\n log.log('[RuntimeUA loadP2PHandler] P2PStubHandler: ', p2pStubHandler);\n\n _this3.loader.loadStub(p2pStubHandler, p2pConfig).then(function (result) {\n\n var runtimeUAURL = _this3.runtimeURL + '/ua';\n var msg = {\n type: 'subscribe',\n from: runtimeUAURL,\n to: 'domain://msg-node.' + _this3.domain + '/sm',\n body: {\n subscribe: [result.url],\n source: _this3.runtimeURL\n }\n };\n\n _this3.messageBus.addListener(runtimeUAURL, function (msg) {\n log.log('[runtime ua - listener] - receive msg: ', msg);\n });\n\n _this3.messageBus.postMessage(msg, function (reply) {\n log.log('[runtime ua - postMessage] - reply: ', reply);\n });\n\n log.info('[runtime ua - p2p installation] - success: ', result);\n resolve(true);\n }).catch(function (reason) {\n log.info('[runtime ua - p2p installation] - fail: ', reason);\n resolve(false);\n });\n });\n }\n\n /**\n *\n * @access private\n * @return {Promise} this is Promise and returns true if all components are loaded with success or an error if someone fails.\n *\n * @memberOf RuntimeUA\n */\n\n }, {\n key: '_loadComponents',\n value: function _loadComponents() {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n try {\n\n // Prepare the on instance to handle with the fallbacks and runtimeCatalogue;\n _this4.descriptorInstance = new _Descriptors2.default(_this4.runtimeURL, _this4.runtimeCatalogue, _this4.runtimeConfiguration);\n\n // Prepare the loader to load the hyperties, protostubs and idpproxy;\n _this4.loader = new _Loader2.default(_this4.runtimeURL, _this4.runtimeConfiguration, _this4.descriptorInstance);\n\n // Instantiate the identity Module\n _this4.identityModule = new _IdentityModule2.default(_this4.runtimeURL, _this4.runtimeCapabilities, _this4.storages.identity, _this4._dataObjectsStorage, _CryptoManager2.default, _this4.runtimeCatalogue);\n\n // Use the sandbox factory to create an AppSandbox;\n // In the future can be decided by policyEngine if we need\n // create a AppSandbox or not;\n var appSandbox = _this4.runtimeFactory.createAppSandbox();\n\n // Instantiate the Registry Module\n _this4.registry = new _Registry2.default(_this4.runtimeURL, appSandbox, _this4.identityModule, _this4.runtimeCatalogue, _this4.runtimeCapabilities, _this4.storages.registry, _this4.p2pHandlerURL);\n\n // Set the loader to load Hyperties, Stubs and IdpProxies\n _this4.registry.loader = _this4.loader;\n\n // Instantiate the Message Bus\n _this4.messageBus = new _MessageBus2.default(_this4.registry);\n\n // Instanciate the SubscriptionManager;\n _this4.subscriptionManager = new _SubscriptionManager2.default(_this4.runtimeURL, _this4.messageBus, _this4.storages.subscriptions);\n\n // Prepare the address allocation instance;\n _this4.addressAllocation = new _AddressAllocation2.default(_this4.runtimeURL, _this4.messageBus, _this4.registry, _this4.subscriptionManager);\n\n // Instantiate the Policy Engine\n _this4.policyEngine = new _PEP2.default(new _RuntimeCoreCtx2.default(_this4.runtimeURL, _this4.identityModule, _this4.registry, _this4.storages.policy, _this4.runtimeCapabilities));\n\n // Instantiate Discovery\n _this4.coreDiscovery = new _CoreDiscovery2.default(_this4.runtimeURL, _this4.messageBus, _this4.graphConnector, _this4.runtimeFactory, _this4.registry);\n\n // Instantiate the identityHandler\n _this4.identityHandler = new _IdentityHandler2.default(_this4.identityModule);\n\n // initialise the CryptoManager\n _CryptoManager2.default.init(_this4.runtimeURL, _this4.runtimeCapabilities, _this4.storages.cryptoManager, _this4._dataObjectsStorage, _this4.registry, _this4.coreDiscovery, _this4.identityModule, _this4.runtimeFactory);\n\n // Instantiate the Graph Connector\n // this.graphConnector = process.env.MODE !== 'light' ? new GraphConnector(this.runtimeURL, this.messageBus, this.storageManager) : null;\n\n _this4.handlers = new _MsgBusHandlers2.default(_this4.policyEngine, _this4.identityHandler, _CryptoManager2.default);\n\n _this4.messageBus.pipelineOut.handlers = [_this4.handlers.idmHandler, _this4.handlers.pepOutHandler, _this4.handlers.encryptHandler];\n _this4.messageBus.pipelineIn.handlers = [_this4.handlers.decryptHandler, _this4.handlers.pepInHandler];\n\n // Add to App Sandbox the listener;\n appSandbox.addListener('*', function (msg) {\n _this4.messageBus.postMessage(msg);\n });\n\n _CryptoManager2.default.messageBus = _this4.messageBus;\n\n // Register messageBus on Registry\n _this4.registry.messageBus = _this4.messageBus;\n\n // Policy Engine\n _this4.policyEngine.messageBus = _this4.messageBus;\n\n // Register messageBus on IDM\n _this4.identityModule.messageBus = _this4.messageBus;\n\n // Register registry on IdentityModule\n _this4.identityModule.registry = _this4.registry;\n\n // Register coreDiscovery on IdentityModule\n _this4.identityModule.coreDiscovery = _this4.coreDiscovery;\n\n // Use sandbox factory to use specific methods\n // and set the message bus to the factory\n _this4.runtimeFactory.messageBus = _this4.messageBus;\n\n // Instanciate the SyncherManager;\n _this4.syncherManager = new _SyncherManager2.default(_this4.runtimeURL, _this4.messageBus, _this4.registry, _this4.runtimeCatalogue, _this4.storages.syncherManager, null, _this4._dataObjectsStorage, _this4.identityModule);\n\n // Set into loader the needed components;\n _this4.loader.runtimeURL = _this4.runtimeURL;\n _this4.loader.messageBus = _this4.messageBus;\n _this4.loader.registry = _this4.registry;\n _this4.loader.runtimeCatalogue = _this4.runtimeCatalogue;\n _this4.loader.runtimeFactory = _this4.runtimeFactory;\n\n //Instantiate Discovery Lib for notification testing\n // this.discovery = new Discovery(\"hyperty://localhost/test\", this.runtimeURL, this.messageBus);\n // this.loadStub(\"localhost\");\n // setTimeout(() => {\n // this.discovery.discoverHypertiesDO(\"user://google.com/openidtest20@gmail.com\")\n // .then(hyperties => {\n // hyperties.forEach(hyperty =>{\n // hyperty.onLive(() => log.log(`Notification from ${hyperty.data.hypertyID} changed to live`));\n // hyperty.onDisconnected(() => log.log(`Notification from ${hyperty.data.hypertyID} changed to disconnected`));\n // });\n // });\n // }, 2000);\n\n\n // this.subscriptionManager.init().then(()=>{\n // resolve(true);\n // });\n\n var prepareComponents = [];\n prepareComponents.push(_this4.subscriptionManager.init());\n prepareComponents.push(_this4.identityModule.init());\n prepareComponents.push(_CryptoManager2.default.loadSessionKeys());\n prepareComponents.push(_this4.registry.loadRegistry());\n prepareComponents.push(_this4._dataObjectsStorage.loadRemote());\n\n _promise2.default.all(prepareComponents).then(function (result) {\n if (result.length === 5) {\n resolve(true);\n } else {\n reject('[RuntimeUA._loadComponents] Error ] ', result);\n }\n }).catch(function (reason) {\n throw Error(reason);\n });\n } catch (e) {\n reject(e);\n }\n });\n }\n\n /**\n * Deploy Hyperty from Catalogue URL\n *\n * @see https://github.com/reTHINK-project/specs/tree/master/datamodel/core/address\n *\n * @param {URL.HypertyCatalogueURL} hypertyCatalogueURL - The Catalogue URL used to identify descriptors in the Catalogue.\n * @param {boolean|URL.HypertyURL} [reuseURL=false] reuseURL - reuseURL is used to reuse the hypertyURL previously registred, by default the reuse is disabled;\n * @param {URL} appURL - the app url address; // TODO: improve this description;\n * @returns {Promise} this is Promise and returns true if all components are loaded with success or an error if someone fails.\n *\n * @memberOf RuntimeUA\n */\n\n }, {\n key: 'loadHyperty',\n value: function loadHyperty(hypertyCatalogueURL) {\n var reuseURL = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var appURL = arguments[2];\n\n\n if (!hypertyCatalogueURL) throw new Error('Hyperty descriptor url parameter is needed');\n return this.loader.loadHyperty(hypertyCatalogueURL, reuseURL, appURL);\n }\n\n /**\n * Deploy Stub from Catalogue URL or domain url\n * @param {URL.URL} domain domain\n */\n\n }, {\n key: 'loadStub',\n value: function loadStub(protocolstubCatalogueURL) {\n\n if (!protocolstubCatalogueURL) throw new Error('ProtoStub descriptor url parameter is needed');\n return this.loader.loadStub(protocolstubCatalogueURL);\n }\n\n /**\n * Deploy idpProxy from Catalogue URL or domain url\n * @param {URL.URL} domain domain\n */\n\n }, {\n key: 'loadIdpProxy',\n value: function loadIdpProxy(ipdProxyCatalogueURL) {\n log.log('ipdProxyCatalogueURL', ipdProxyCatalogueURL);\n\n if (!ipdProxyCatalogueURL) throw new Error('The IDP Proxy URL is a needed parameter, could be a DOMAIN or a URL');\n return this.loader.loadIdpProxy(ipdProxyCatalogueURL);\n }\n\n /**\n * Used to close all the runtime; Unregister all hyperties;\n * @return {Promise} result of the close method, with true or false to the operation success;\n */\n\n }, {\n key: 'close',\n value: function close(logOut) {\n console.log('Runtime core logout: ', logOut);\n var _this = this;\n if (logOut === true) {\n this.identityHandler.reset();\n }\n\n log.info('Unregister all hyperties');\n return new _promise2.default(function (resolve, reject) {\n\n _this.registry.unregisterAllHyperties().then(function (result) {\n log.info('All the hyperties are unregisted with Success:', result);\n resolve(true);\n }).catch(function (reason) {\n log.error('Failed to unregister the hyperties', reason);\n reject(false);\n });\n });\n }\n\n /**\n * Used to reset the runtime by deleting all data from the storage manager;\n * @return {Promise} result of the reset method, with true or false to the operation success;\n */\n\n }, {\n key: 'reset',\n value: function reset() {\n var _this5 = this;\n\n console.log('RuntimeUA.Runtime core reset: ');\n\n var reseting = [];\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //TODO: delegate db reset operation to each component\n // this.identityManager.reset();\n\n _this5.storages.identity.get(false, false, 'identities').then(function (identities) {\n var identitiesKeys = (0, _keys2.default)(identities);\n\n identitiesKeys.forEach(function (key) {\n reseting.push(_this5.storages.identity.delete(key, false, 'identities'));\n });\n\n reseting.push(_this5.storages.capabilities.delete('capabilities'));\n reseting.push(_this5.storages.cryptoManager.delete('userAsymmetricKey'));\n reseting.push(_this5.storages.hypertyResources.delete('hypertyResources'));\n reseting.push(_this5.storages.identity.delete('accessTokens'));\n reseting.push(_this5.storages.registry.delete('registry:DataObjectURLs'));\n reseting.push(_this5.storages.registry.delete('registry:HypertyURLs'));\n reseting.push(_this5.storages.runtime.delete('p2pHandler:URL'));\n reseting.push(_this5.storages.runtime.delete('runtime:URL'));\n // reseting.push(this.storages.runtimeCatalogue.delete('runtimeCatalogue'));\n reseting.push(_this5.storages.subscriptions.delete('subscriptions'));\n reseting.push(_this5.storages.syncherManager.delete('syncherManager:ObjectURLs'));\n\n _promise2.default.all(reseting).then(function (result) {\n\n log.info('All DBs were reset with Success:', result);\n resolve(true);\n }).catch(function (reason) {\n log.error('Failed to reset all DBs', reason);\n resolve(false);\n });\n });\n });\n }\n }]);\n return RuntimeUA;\n}();\n\nexports.default = RuntimeUA;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL1J1bnRpbWVVQS5qcz9iZmFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7Ozs7O0FBR0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///428\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(430);\nmodule.exports = __webpack_require__(11).Object.keys;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qcz84YzU2Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5rZXlzJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Qua2V5cztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qva2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNDI5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///429\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.14 Object.keys(O)\nvar toObject = __webpack_require__(76);\nvar $keys = __webpack_require__(68);\n\n__webpack_require__(138)('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qcz8wOWRjIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi4xNCBPYmplY3Qua2V5cyhPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2tleXMnLCBmdW5jdGlvbiAoKSB7XG4gIHJldHVybiBmdW5jdGlvbiBrZXlzKGl0KSB7XG4gICAgcmV0dXJuICRrZXlzKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Qua2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNDMwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///430\n")},function(module,exports,__webpack_require__){eval("// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = __webpack_require__(50);\nvar toLength = __webpack_require__(133);\nvar toAbsoluteIndex = __webpack_require__(432);\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value;\n // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++];\n // eslint-disable-next-line no-self-compare\n if (value != value) return true;\n // Array#indexOf ignores holes, Array#includes - not\n } else for (;length > index; index++) if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hcnJheS1pbmNsdWRlcy5qcz9iYzU3Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIGZhbHNlIC0+IEFycmF5I2luZGV4T2Zcbi8vIHRydWUgIC0+IEFycmF5I2luY2x1ZGVzXG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIHRvTGVuZ3RoID0gcmVxdWlyZSgnLi9fdG8tbGVuZ3RoJyk7XG52YXIgdG9BYnNvbHV0ZUluZGV4ID0gcmVxdWlyZSgnLi9fdG8tYWJzb2x1dGUtaW5kZXgnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKElTX0lOQ0xVREVTKSB7XG4gIHJldHVybiBmdW5jdGlvbiAoJHRoaXMsIGVsLCBmcm9tSW5kZXgpIHtcbiAgICB2YXIgTyA9IHRvSU9iamVjdCgkdGhpcyk7XG4gICAgdmFyIGxlbmd0aCA9IHRvTGVuZ3RoKE8ubGVuZ3RoKTtcbiAgICB2YXIgaW5kZXggPSB0b0Fic29sdXRlSW5kZXgoZnJvbUluZGV4LCBsZW5ndGgpO1xuICAgIHZhciB2YWx1ZTtcbiAgICA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JjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///431\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(134);\nvar max = Math.max;\nvar min = Math.min;\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL190by1hYnNvbHV0ZS1pbmRleC5qcz83ZTQwIl0sInNvdXJjZXNDb250ZW50IjpbInZhciB0b0ludGVnZXIgPSByZXF1aXJlKCcuL190by1pbnRlZ2VyJyk7XG52YXIgbWF4ID0gTWF0aC5tYXg7XG52YXIgbWluID0gTWF0aC5taW47XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChpbmRleCwgbGVuZ3RoKSB7XG4gIGluZGV4ID0gdG9JbnRlZ2VyKGluZGV4KTtcbiAgcmV0dXJuIGluZGV4IDwgMCA/IG1heChpbmRleCArIGxlbmd0aCwgMCkgOiBtaW4oaW5kZXgsIGxlbmd0aCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3RvLWFic29sdXRlLWluZGV4LmpzXG4vLyBtb2R1bGUgaWQgPSA0MzJcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///432\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(192);\n__webpack_require__(80);\n__webpack_require__(101);\n__webpack_require__(440);\n__webpack_require__(448);\n__webpack_require__(449);\nmodule.exports = __webpack_require__(11).Promise;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9wcm9taXNlLmpzPzUzOTgiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vbW9kdWxlcy9lczYub2JqZWN0LnRvLXN0cmluZycpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi9tb2R1bGVzL3dlYi5kb20uaXRlcmFibGUnKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvZXM2LnByb21pc2UnKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvZXM3LnByb21pc2UuZmluYWxseScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczcucHJvbWlzZS50cnknKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vbW9kdWxlcy9fY29yZScpLlByb21pc2U7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vcHJvbWlzZS5qc1xuLy8gbW9kdWxlIGlkID0gNDMzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///433\n")},function(module,exports,__webpack_require__){eval("var toInteger = __webpack_require__(134);\nvar defined = __webpack_require__(132);\n// true -> String#at\n// false -> String#codePointAt\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff\n ? TO_STRING ? s.charAt(i) : a\n : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zdHJpbmctYXQuanM/ODdhZSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgdG9JbnRlZ2VyID0gcmVxdWlyZSgnLi9fdG8taW50ZWdlcicpO1xudmFyIGRlZmluZWQgPSByZXF1aXJlKCcuL19kZWZpbmVkJyk7XG4vLyB0cnVlICAtPiBTdHJpbmcjYXRcbi8vIGZhbHNlIC0+IFN0cmluZyNjb2RlUG9pbnRBdFxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoVE9fU1RSSU5HKSB7XG4gIHJldHVybiBmdW5jdGlvbiAodGhhdCwgcG9zKSB7XG4gICAgdmFyIHMgPSBTdHJpbmcoZGVmaW5lZCh0aGF0KSk7XG4gICAgdmFyIGkgPSB0b0ludGVnZXIocG9zKTtcbiAgICB2YXIgbCA9IHMubGVuZ3RoO1xuICAgIHZhciBhLCBiO1xuICAgIGlmIChpIDwgMCB8fCBpID49IGwpIHJldHVybiBUT19TVFJJTkcgPyAnJyA6IHVuZGVmaW5lZDtcbiAgICBhID0gcy5jaGFyQ29kZUF0KGkpO1xuICAgIHJldHVybiBhIDwgMHhkODAwIHx8IGEgPiAweGRiZmYgfHwgaSArIDEgPT09IGwgfHwgKGIgPSBzLmNoYXJDb2RlQXQoaSArIDEpKSA8IDB4ZGMwMCB8fCBiID4gMHhkZmZmXG4gICAgICA/IFRPX1NUUklORyA/IHMuY2hhckF0KGkpIDogYVxuICAgICAgOiBUT19TVFJJTkcgPyBzLnNsaWNlKGksIGkgKyAyKSA6IChhIC0gMHhkODAwIDw8IDEwKSArIChiIC0gMHhkYzAwKSArIDB4MTAwMDA7XG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3N0cmluZy1hdC5qc1xuLy8gbW9kdWxlIGlkID0gNDM0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///434\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar create = __webpack_require__(141);\nvar descriptor = __webpack_require__(79);\nvar setToStringTag = __webpack_require__(100);\nvar IteratorPrototype = {};\n\n// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n__webpack_require__(63)(IteratorPrototype, __webpack_require__(22)('iterator'), function () { return this; });\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });\n setToStringTag(Constructor, NAME + ' Iterator');\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLWNyZWF0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UFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///435\n")},function(module,exports,__webpack_require__){eval("var dP = __webpack_require__(45);\nvar anObject = __webpack_require__(41);\nvar getKeys = __webpack_require__(68);\n\nmodule.exports = __webpack_require__(51) ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n while (length > i) dP.f(O, P = keys[i++], Properties[P]);\n return O;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZHBzLmpzP2FhMmEiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgYW5PYmplY3QgPSByZXF1aXJlKCcuL19hbi1vYmplY3QnKTtcbnZhciBnZXRLZXlzID0gcmVxdWlyZSgnLi9fb2JqZWN0LWtleXMnKTtcblxubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpID8gT2JqZWN0LmRlZmluZVByb3BlcnRpZXMgOiBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0aWVzKE8sIFByb3BlcnRpZXMpIHtcbiAgYW5PYmplY3QoTyk7XG4gIHZhciBrZXlzID0gZ2V0S2V5cyhQcm9wZXJ0aWVzKTtcbiAgdmFyIGxlbmd0aCA9IGtleXMubGVuZ3RoO1xuICB2YXIgaSA9IDA7XG4gIHZhciBQO1xuICB3aGlsZSAobGVuZ3RoID4gaSkgZFAuZihPLCBQID0ga2V5c1tpKytdLCBQcm9wZXJ0aWVzW1BdKTtcbiAgcmV0dXJuIE87XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC1kcHMuanNcbi8vIG1vZHVsZSBpZCA9IDQzNlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///436\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar addToUnscopables = __webpack_require__(438);\nvar step = __webpack_require__(439);\nvar Iterators = __webpack_require__(71);\nvar toIObject = __webpack_require__(50);\n\n// 22.1.3.4 Array.prototype.entries()\n// 22.1.3.13 Array.prototype.keys()\n// 22.1.3.29 Array.prototype.values()\n// 22.1.3.30 Array.prototype[@@iterator]()\nmodule.exports = __webpack_require__(193)(Array, 'Array', function (iterated, kind) {\n this._t = toIObject(iterated); // target\n this._i = 0; // next index\n this._k = kind; // kind\n// 22.1.5.2.1 %ArrayIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var kind = this._k;\n var index = this._i++;\n if (!O || index >= O.length) {\n this._t = undefined;\n return step(1);\n }\n if (kind == 'keys') return step(0, index);\n if (kind == 'values') return step(0, O[index]);\n return step(0, [index, O[index]]);\n}, 'values');\n\n// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)\nIterators.Arguments = Iterators.Array;\n\naddToUnscopables('keys');\naddToUnscopables('values');\naddToUnscopables('entries');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5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uIHN0ZXAoMSk7XG4gIH1cbiAgaWYgKGtpbmQgPT0gJ2tleXMnKSByZXR1cm4gc3RlcCgwLCBpbmRleCk7XG4gIGlmIChraW5kID09ICd2YWx1ZXMnKSByZXR1cm4gc3RlcCgwLCBPW2luZGV4XSk7XG4gIHJldHVybiBzdGVwKDAsIFtpbmRleCwgT1tpbmRleF1dKTtcbn0sICd2YWx1ZXMnKTtcblxuLy8gYXJndW1lbnRzTGlzdFtAQGl0ZXJhdG9yXSBpcyAlQXJyYXlQcm90b192YWx1ZXMlICg5LjQuNC42LCA5LjQuNC43KVxuSXRlcmF0b3JzLkFyZ3VtZW50cyA9IEl0ZXJhdG9ycy5BcnJheTtcblxuYWRkVG9VbnNjb3BhYmxlcygna2V5cycpO1xuYWRkVG9VbnNjb3BhYmxlcygndmFsdWVzJyk7XG5hZGRUb1Vuc2NvcGFibGVzKCdlbnRyaWVzJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYuYXJyYXkuaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQzN1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///437\n")},function(module,exports){eval("module.exports = function () { /* empty */ };\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanM/ZTI2NyJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uICgpIHsgLyogZW1wdHkgKi8gfTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hZGQtdG8tdW5zY29wYWJsZXMuanNcbi8vIG1vZHVsZSBpZCA9IDQzOFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///438\n")},function(module,exports){eval("module.exports = function (done, value) {\n return { value: value, done: !!done };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLXN0ZXAuanM/MTA2NiJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChkb25lLCB2YWx1ZSkge1xuICByZXR1cm4geyB2YWx1ZTogdmFsdWUsIGRvbmU6ICEhZG9uZSB9O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pdGVyLXN0ZXAuanNcbi8vIG1vZHVsZSBpZCA9IDQzOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///439\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar LIBRARY = __webpack_require__(78);\nvar global = __webpack_require__(21);\nvar ctx = __webpack_require__(69);\nvar classof = __webpack_require__(142);\nvar $export = __webpack_require__(26);\nvar isObject = __webpack_require__(46);\nvar aFunction = __webpack_require__(99);\nvar anInstance = __webpack_require__(441);\nvar forOf = __webpack_require__(442);\nvar speciesConstructor = __webpack_require__(199);\nvar task = __webpack_require__(200).set;\nvar microtask = __webpack_require__(444)();\nvar newPromiseCapabilityModule = __webpack_require__(144);\nvar perform = __webpack_require__(201);\nvar userAgent = __webpack_require__(445);\nvar promiseResolve = __webpack_require__(202);\nvar PROMISE = 'Promise';\nvar TypeError = global.TypeError;\nvar process = global.process;\nvar versions = process && process.versions;\nvar v8 = versions && versions.v8 || '';\nvar $Promise = global[PROMISE];\nvar isNode = classof(process) == 'process';\nvar empty = function () { /* empty */ };\nvar Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;\nvar newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;\n\nvar USE_NATIVE = !!function () {\n try {\n // correct subclassing with @@species support\n var promise = $Promise.resolve(1);\n var FakePromise = (promise.constructor = {})[__webpack_require__(22)('species')] = function (exec) {\n exec(empty, empty);\n };\n // unhandled rejections tracking support, NodeJS Promise without it fails @@species test\n return (isNode || typeof PromiseRejectionEvent == 'function')\n && promise.then(empty) instanceof FakePromise\n // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables\n // https://bugs.chromium.org/p/chromium/issues/detail?id=830565\n // we can't detect it synchronously, so just check versions\n && v8.indexOf('6.6') !== 0\n && userAgent.indexOf('Chrome/66') === -1;\n } catch (e) { /* empty */ }\n}();\n\n// helpers\nvar isThenable = function (it) {\n var then;\n return isObject(it) && typeof (then = it.then) == 'function' ? then : false;\n};\nvar notify = function (promise, isReject) {\n if (promise._n) return;\n promise._n = true;\n var chain = promise._c;\n microtask(function () {\n var value = promise._v;\n var ok = promise._s == 1;\n var i = 0;\n var run = function (reaction) {\n var handler = ok ? reaction.ok : reaction.fail;\n var resolve = reaction.resolve;\n var reject = reaction.reject;\n var domain = reaction.domain;\n var result, then, exited;\n try {\n if (handler) {\n if (!ok) {\n if (promise._h == 2) onHandleUnhandled(promise);\n promise._h = 1;\n }\n if (handler === true) result = value;\n else {\n if (domain) domain.enter();\n result = handler(value); // may throw\n if (domain) {\n domain.exit();\n exited = true;\n }\n }\n if (result === reaction.promise) {\n reject(TypeError('Promise-chain cycle'));\n } else if (then = isThenable(result)) {\n then.call(result, resolve, reject);\n } else resolve(result);\n } else reject(value);\n } catch (e) {\n if (domain && !exited) domain.exit();\n reject(e);\n }\n };\n while (chain.length > i) run(chain[i++]); // variable length - can't use forEach\n promise._c = [];\n promise._n = false;\n if (isReject && !promise._h) onUnhandled(promise);\n });\n};\nvar onUnhandled = function (promise) {\n task.call(global, function () {\n var value = promise._v;\n var unhandled = isUnhandled(promise);\n var result, handler, console;\n if (unhandled) {\n result = perform(function () {\n if (isNode) {\n process.emit('unhandledRejection', value, promise);\n } else if (handler = global.onunhandledrejection) {\n handler({ promise: promise, reason: value });\n } else if ((console = global.console) && console.error) {\n console.error('Unhandled promise rejection', value);\n }\n });\n // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should\n promise._h = isNode || isUnhandled(promise) ? 2 : 1;\n } promise._a = undefined;\n if (unhandled && result.e) throw result.v;\n });\n};\nvar isUnhandled = function (promise) {\n return promise._h !== 1 && (promise._a || promise._c).length === 0;\n};\nvar onHandleUnhandled = function (promise) {\n task.call(global, function () {\n var handler;\n if (isNode) {\n process.emit('rejectionHandled', promise);\n } else if (handler = global.onrejectionhandled) {\n handler({ promise: promise, reason: promise._v });\n }\n });\n};\nvar $reject = function (value) {\n var promise = this;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n promise._v = value;\n promise._s = 2;\n if (!promise._a) promise._a = promise._c.slice();\n notify(promise, true);\n};\nvar $resolve = function (value) {\n var promise = this;\n var then;\n if (promise._d) return;\n promise._d = true;\n promise = promise._w || promise; // unwrap\n try {\n if (promise === value) throw TypeError(\"Promise can't be resolved itself\");\n if (then = isThenable(value)) {\n microtask(function () {\n var wrapper = { _w: promise, _d: false }; // wrap\n try {\n then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));\n } catch (e) {\n $reject.call(wrapper, e);\n }\n });\n } else {\n promise._v = value;\n promise._s = 1;\n notify(promise, false);\n }\n } catch (e) {\n $reject.call({ _w: promise, _d: false }, e); // wrap\n }\n};\n\n// constructor polyfill\nif (!USE_NATIVE) {\n // 25.4.3.1 Promise(executor)\n $Promise = function Promise(executor) {\n anInstance(this, $Promise, PROMISE, '_h');\n aFunction(executor);\n Internal.call(this);\n try {\n executor(ctx($resolve, this, 1), ctx($reject, this, 1));\n } catch (err) {\n $reject.call(this, err);\n }\n };\n // eslint-disable-next-line no-unused-vars\n Internal = function Promise(executor) {\n this._c = []; // <- awaiting reactions\n this._a = undefined; // <- checked in isUnhandled reactions\n this._s = 0; // <- state\n this._d = false; // <- done\n this._v = undefined; // <- value\n this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled\n this._n = false; // <- notify\n };\n Internal.prototype = __webpack_require__(446)($Promise.prototype, {\n // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)\n then: function then(onFulfilled, onRejected) {\n var reaction = newPromiseCapability(speciesConstructor(this, $Promise));\n reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;\n reaction.fail = typeof onRejected == 'function' && onRejected;\n reaction.domain = isNode ? process.domain : undefined;\n this._c.push(reaction);\n if (this._a) this._a.push(reaction);\n if (this._s) notify(this, false);\n return reaction.promise;\n },\n // 25.4.5.1 Promise.prototype.catch(onRejected)\n 'catch': function (onRejected) {\n return this.then(undefined, onRejected);\n }\n });\n OwnPromiseCapability = function () {\n var promise = new Internal();\n this.promise = promise;\n this.resolve = ctx($resolve, promise, 1);\n this.reject = ctx($reject, promise, 1);\n };\n newPromiseCapabilityModule.f = newPromiseCapability = function (C) {\n return C === $Promise || C === Wrapper\n ? new OwnPromiseCapability(C)\n : newGenericPromiseCapability(C);\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });\n__webpack_require__(100)($Promise, PROMISE);\n__webpack_require__(447)(PROMISE);\nWrapper = __webpack_require__(11)[PROMISE];\n\n// statics\n$export($export.S + $export.F * !USE_NATIVE, PROMISE, {\n // 25.4.4.5 Promise.reject(r)\n reject: function reject(r) {\n var capability = newPromiseCapability(this);\n var $$reject = capability.reject;\n $$reject(r);\n return capability.promise;\n }\n});\n$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {\n // 25.4.4.6 Promise.resolve(x)\n resolve: function resolve(x) {\n return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);\n }\n});\n$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(203)(function (iter) {\n $Promise.all(iter)['catch'](empty);\n})), PROMISE, {\n // 25.4.4.1 Promise.all(iterable)\n all: function all(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var resolve = capability.resolve;\n var reject = capability.reject;\n var result = perform(function () {\n var values = [];\n var index = 0;\n var remaining = 1;\n forOf(iterable, false, function (promise) {\n var $index = index++;\n var alreadyCalled = false;\n values.push(undefined);\n remaining++;\n C.resolve(promise).then(function (value) {\n if (alreadyCalled) return;\n alreadyCalled = true;\n values[$index] = value;\n --remaining || resolve(values);\n }, reject);\n });\n --remaining || resolve(values);\n });\n if (result.e) reject(result.v);\n return capability.promise;\n },\n // 25.4.4.4 Promise.race(iterable)\n race: function race(iterable) {\n var C = this;\n var capability = newPromiseCapability(C);\n var reject = capability.reject;\n var result = perform(function () {\n forOf(iterable, false, function (promise) {\n C.resolve(promise).then(capability.resolve, reject);\n });\n });\n if (result.e) reject(result.v);\n return capability.promise;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5wcm9taXNlLmpzPzA5N2MiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIExJQlJBUlkgPSByZXF1aXJlKCcuL19saWJyYXJ5Jyk7XG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgY2xhc3NvZiA9IHJlcXVpcmUoJy4vX2NsYXNzb2YnKTtcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBhRnVuY3Rpb24gPSByZXF1aXJlKCcuL19hLWZ1bmN0aW9uJyk7XG52YXIgYW5JbnN0YW5jZSA9IHJlcXVpcmUoJy4vX2FuLWluc3RhbmNlJyk7XG52YXIgZm9yT2YgPSByZXF1aXJlKCcuL19mb3Itb2YnKTtcbnZhciBzcGVjaWVzQ29uc3RydWN0b3IgPSByZXF1aXJlKCcuL19zcGVjaWVzLWNvbnN0cnVjdG9yJyk7XG52YXIgdGFzayA9IHJlcXVpcmUoJy4vX3Rhc2snKS5zZXQ7XG52YXIgbWljcm90YXNrID0gcmVxdWlyZSgnLi9fbWljcm90YXNrJykoKTtcbnZhciBuZXdQcm9taXNlQ2FwYWJpbGl0eU1vZHVsZSA9IHJlcXVpcmUoJy4vX25ldy1wcm9taXNlLWNhcGFiaWxpdHknKTtcbnZhciBwZXJmb3JtID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l9uKSByZXR1cm47XG4gIHByb21pc2UuX24gPSB0cnVlO1xuICB2YXIgY2hhaW4gPSBwcm9taXNlLl9jO1xuICBtaWNyb3Rhc2soZnVuY3Rpb24gKCkge1xuICAgIHZhciB2YWx1ZSA9IHByb21pc2UuX3Y7XG4gICAgdmFyIG9rID0gcHJvbWlzZS5fcyA9PSAxO1xuICAgIHZhciBpID0gMDtcbiAgICB2YXIgcnVuID0gZnVuY3Rpb24gKHJlYWN0aW9uKSB7XG4gICAgICB2YXIgaGFuZGxlciA9IG9rID8gcmVhY3Rpb24ub2sgOiByZWFjdGlvbi5mYWlsO1xuICAgICAgdmFyIHJlc29sdmUgPSByZWFjdGlvbi5yZXNvbHZlO1xuICAgICAgdmFyIHJlamVjdCA9IHJlYWN0aW9uLnJlamVjdDtcbiAgICAgIHZhciBkb21haW4gPSByZWFjdGlvbi5kb21haW47XG4gICAgICB2YXIgcmVzdWx0LCB0aGVuLCBleGl0ZWQ7XG4gICAgICB0cnkge1xuICAgICAgICBpZiAoaGFuZGxlcikge1xuICAgICAgICAgIGlmICghb2spIHtcbiAgICAgICAgICAgIGlmIChwcm9taXNlLl9oID09IDIpIG9uSGFuZGxlVW5oYW5kbGVkKHByb21pc2UpO1xuICAgICAgICAgICAgcHJvbWlzZS5faCA9IDE7XG4gICAgICAgICAgfVxuICAgICAgICAgIGlmIChoYW5kbGVyID09PSB0cnVlKSByZXN1bHQgPSB2YWx1ZTtcbiAgICAgICAgICBlbHNlIHtcbiAgICAgICAgICAgIGlmIChkb21haW4pIGRvbWFpbi5lbnRlcigpO1xuICAgICAgICAgICAgcmVzdWx0ID0gaGFuZGxlcih2YWx1ZSk7IC8vIG1heSB0aHJvd1xuICAgICAgICAgICAgaWYgKGRvbWFpbikge1xuICAgICAgICAgICAgICBkb21haW4uZXhpdCgpO1xuICAgICAgICAgICAgICBleGl0ZWQgPSB0cnVlO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH1cbiAgICAgICAgICBpZiAocmVzdW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FDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///440\n")},function(module,exports){eval("module.exports = function (it, Constructor, name, forbiddenField) {\n if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {\n throw TypeError(name + ': incorrect invocation!');\n } return it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19hbi1pbnN0YW5jZS5qcz9kOGFjIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0LCBDb25zdHJ1Y3RvciwgbmFtZSwgZm9yYmlkZGVuRmllbGQpIHtcbiAgaWYgKCEoaXQgaW5zdGFuY2VvZiBDb25zdHJ1Y3RvcikgfHwgKGZvcmJpZGRlbkZpZWxkICE9PSB1bmRlZmluZWQgJiYgZm9yYmlkZGVuRmllbGQgaW4gaXQpKSB7XG4gICAgdGhyb3cgVHlwZUVycm9yKG5hbWUgKyAnOiBpbmNvcnJlY3QgaW52b2NhdGlvbiEnKTtcbiAgfSByZXR1cm4gaXQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2FuLWluc3RhbmNlLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///441\n")},function(module,exports,__webpack_require__){eval("var ctx = __webpack_require__(69);\nvar call = __webpack_require__(197);\nvar isArrayIter = __webpack_require__(198);\nvar anObject = __webpack_require__(41);\nvar toLength = __webpack_require__(133);\nvar getIterFn = __webpack_require__(143);\nvar BREAK = {};\nvar RETURN = {};\nvar exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {\n var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);\n var f = ctx(fn, that, entries ? 2 : 1);\n var index = 0;\n var length, step, iterator, result;\n if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');\n // fast case for arrays with default iterator\n if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {\n result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);\n if (result === BREAK || result === RETURN) return result;\n } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {\n result = call(iterator, f, step.value, entries);\n if (result === BREAK || result === RETURN) return result;\n }\n};\nexports.BREAK = BREAK;\nexports.RETURN = RETURN;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19mb3Itb2YuanM/MzU2YiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY3R4ID0gcmVxdWlyZSgnLi9fY3R4Jyk7XG52YXIgY2FsbCA9IHJlcXVpcmUoJy4vX2l0ZXItY2FsbCcpO1xudmFyIGlzQXJyYXlJdGVyID0gcmVxdWlyZSgnLi9faXMtYXJyYXktaXRlcicpO1xudmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgdG9MZW5ndGggPSByZXF1aXJlKCcuL190by1sZW5ndGgnKTtcbnZhciBnZXRJdGVyRm4gPSByZXF1aXJlKCcuL2NvcmUuZ2V0LWl0ZXJhdG9yLW1ldGhvZCcpO1xudmFyIEJSRUFLID0ge307XG52YXIgUkVUVVJOID0ge307XG52YXIgZXhwb3J0cyA9IG1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0ZXJhYmxlLCBlbnRyaWVzLCBmbiwgdGhhdCwgSVRFUkFUT1IpIHtcbiAgdmFyIGl0ZXJGbiA9IElURVJBVE9SID8gZnVuY3Rpb24gKCkgeyByZXR1cm4gaXRlcmFibGU7IH0gOiBnZXRJdGVyRm4oaXRlcmFibGUpO1xuICB2YXIgZiA9IGN0eChmbiwgdGhhdCwgZW50cmll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ZHVsZXMvX2Zvci1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDQyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///442\n")},function(module,exports){eval("// fast apply, http://jsperf.lnkit.com/fast-apply/5\nmodule.exports = function (fn, args, that) {\n var un = that === undefined;\n switch (args.length) {\n case 0: return un ? fn()\n : fn.call(that);\n case 1: return un ? fn(args[0])\n : fn.call(that, args[0]);\n case 2: return un ? fn(args[0], args[1])\n : fn.call(that, args[0], args[1]);\n case 3: return un ? fn(args[0], args[1], args[2])\n : fn.call(that, args[0], args[1], args[2]);\n case 4: return un ? fn(args[0], args[1], args[2], args[3])\n : fn.call(that, args[0], args[1], args[2], args[3]);\n } return fn.apply(that, args);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pbnZva2UuanM/OTI3YiJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBmYXN0IGFwcGx5LCBodHRwOi8vanNwZXJmLmxua2l0LmNvbS9mYXN0LWFwcGx5LzVcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGZuLCBhcmdzLCB0aGF0KSB7XG4gIHZhciB1biA9IHRoYXQgPT09IHVuZGVmaW5lZDtcbiAgc3dpdGNoIChhcmdzLmxlbmd0aCkge1xuICAgIGNhc2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# sourceURL=webpack-internal:///443\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar macrotask = __webpack_require__(200).set;\nvar Observer = global.MutationObserver || global.WebKitMutationObserver;\nvar process = global.process;\nvar Promise = global.Promise;\nvar isNode = __webpack_require__(77)(process) == 'process';\n\nmodule.exports = function () {\n var head, last, notify;\n\n var flush = function () {\n var parent, fn;\n if (isNode && (parent = process.domain)) parent.exit();\n while (head) {\n fn = head.fn;\n head = head.next;\n try {\n fn();\n } catch (e) {\n if (head) notify();\n else last = undefined;\n throw e;\n }\n } last = undefined;\n if (parent) parent.enter();\n };\n\n // Node.js\n if (isNode) {\n notify = function () {\n process.nextTick(flush);\n };\n // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339\n } else if (Observer && !(global.navigator && global.navigator.standalone)) {\n var toggle = true;\n var node = document.createTextNode('');\n new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new\n notify = function () {\n node.data = toggle = !toggle;\n };\n // environments with maybe non-completely correct, but existent Promise\n } else if (Promise && Promise.resolve) {\n // Promise.resolve without an argument throws an error in LG WebOS 2\n var promise = Promise.resolve(undefined);\n notify = function () {\n promise.then(flush);\n };\n // for other environments - macrotask based on:\n // - setImmediate\n // - MessageChannel\n // - window.postMessag\n // - onreadystatechange\n // - setTimeout\n } else {\n notify = function () {\n // strange IE + webpack dev server bug - use .call(global)\n macrotask.call(global, flush);\n };\n }\n\n return function (fn) {\n var task = { fn: fn, next: undefined };\n if (last) last.next = task;\n if (!head) {\n head = task;\n notify();\n } last = task;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19taWNyb3Rhc2suanM/ZjM2MyJdLCJzb3VyY2VzQ29udGVudCI6WyJ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0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///444\n")},function(module,exports,__webpack_require__){eval("var global = __webpack_require__(21);\nvar navigator = global.navigator;\n\nmodule.exports = navigator && navigator.userAgent || '';\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL191c2VyLWFnZW50LmpzPzg5NDYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGdsb2JhbCA9IHJlcXVpcmUoJy4vX2dsb2JhbCcpO1xudmFyIG5hdmlnYXRvciA9IGdsb2JhbC5uYXZpZ2F0b3I7XG5cbm1vZHVsZS5leHBvcnRzID0gbmF2aWdhdG9yICYmIG5hdmlnYXRvci51c2VyQWdlbnQgfHwgJyc7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fdXNlci1hZ2VudC5qc1xuLy8gbW9kdWxlIGlkID0gNDQ1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///445\n")},function(module,exports,__webpack_require__){eval("var hide = __webpack_require__(63);\nmodule.exports = function (target, src, safe) {\n for (var key in src) {\n if (safe && target[key]) target[key] = src[key];\n else hide(target, key, src[key]);\n } return target;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19yZWRlZmluZS1hbGwuanM/YzQ3ZiJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgaGlkZSA9IHJlcXVpcmUoJy4vX2hpZGUnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKHRhcmdldCwgc3JjLCBzYWZlKSB7XG4gIGZvciAodmFyIGtleSBpbiBzcmMpIHtcbiAgICBpZiAoc2FmZSAmJiB0YXJnZXRba2V5XSkgdGFyZ2V0W2tleV0gPSBzcmNba2V5XTtcbiAgICBlbHNlIGhpZGUodGFyZ2V0LCBrZXksIHNyY1trZXldKTtcbiAgfSByZXR1cm4gdGFyZ2V0O1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19yZWRlZmluZS1hbGwuanNcbi8vIG1vZHVsZSBpZCA9IDQ0NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///446\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar global = __webpack_require__(21);\nvar core = __webpack_require__(11);\nvar dP = __webpack_require__(45);\nvar DESCRIPTORS = __webpack_require__(51);\nvar SPECIES = __webpack_require__(22)('species');\n\nmodule.exports = function (KEY) {\n var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];\n if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {\n configurable: true,\n get: function () { return this; }\n });\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtc3BlY2llcy5qcz82ZDFhIl0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0JztcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBjb3JlID0gcmVxdWlyZSgnLi9fY29yZScpO1xudmFyIGRQID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgREVTQ1JJUFRPUlMgPSByZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpO1xudmFyIFNQRUNJRVMgPSByZXF1aXJlKCcuL193a3MnKSgnc3BlY2llcycpO1xuXG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIChLRVkpIHtcbiAgdmFyIEMgPSB0eXBlb2YgY29yZVtLRVldID09ICdmdW5jdGlvbicgPyBjb3JlW0tFWV0gOiBnbG9iYWxbS0VZXTtcbiAgaWYgKERFU0NSSVBUT1JTICYmIEMgJiYgIUNbU1BFQ0lFU10pIGRQLmYoQywgU1BFQ0lFUywge1xuICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICBnZXQ6IGZ1bmN0aW9uICgpIHsgcmV0dXJuIHRoaXM7IH1cbiAgfSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX3NldC1zcGVjaWVzLmpzXG4vLyBtb2R1bGUgaWQgPSA0NDdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///447\n")},function(module,exports,__webpack_require__){"use strict";eval("// https://github.com/tc39/proposal-promise-finally\n\nvar $export = __webpack_require__(26);\nvar core = __webpack_require__(11);\nvar global = __webpack_require__(21);\nvar speciesConstructor = __webpack_require__(199);\nvar promiseResolve = __webpack_require__(202);\n\n$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {\n var C = speciesConstructor(this, core.Promise || global.Promise);\n var isFunction = typeof onFinally == 'function';\n return this.then(\n isFunction ? function (x) {\n return promiseResolve(C, onFinally()).then(function () { return x; });\n } : onFinally,\n isFunction ? function (e) {\n return promiseResolve(C, onFinally()).then(function () { throw e; });\n } : onFinally\n );\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLmZpbmFsbHkuanM/MTJhMCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBodHRwczovL2dpdGh1Yi5jb20vdGMzOS9wcm9wb3NhbC1wcm9taXNlLWZpbmFsbHlcbid1c2Ugc3RyaWN0JztcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG52YXIgY29yZSA9IHJlcXVpcmUoJy4vX2NvcmUnKTtcbnZhciBnbG9iYWwgPSByZXF1aXJlKCcuL19nbG9iYWwnKTtcbnZhciBzcGVjaWVzQ29uc3RydWN0b3IgPSByZXF1aXJlKCcuL19zcGVjaWVzLWNvb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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///448\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// https://github.com/tc39/proposal-promise-try\nvar $export = __webpack_require__(26);\nvar newPromiseCapability = __webpack_require__(144);\nvar perform = __webpack_require__(201);\n\n$export($export.S, 'Promise', { 'try': function (callbackfn) {\n var promiseCapability = newPromiseCapability.f(this);\n var result = perform(callbackfn);\n (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);\n return promiseCapability.promise;\n} });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLnRyeS5qcz84Y2E1Il0sInNvdXJjZXNDb250ZW50IjpbIid1c2Ugc3RyaWN0Jztcbi8vIGh0dHBzOi8vZ2l0aHViLmNvbS90YzM5L3Byb3Bvc2FsLXByb21pc2UtdHJ5XG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyIG5ld1Byb21pc2VDYXBhYmlsaXR5ID0gcmVxdWlyZSgnLi9fbmV3LXByb21pc2UtY2FwYWJpbGl0eScpO1xudmFyIHBlcmZvcm0gPSByZXF1aXJlKCcuL19wZXJmb3JtJyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnUHJvbWlzZScsIHsgJ3RyeSc6IGZ1bmN0aW9uIChjYWxsYmFja2ZuKSB7XG4gIHZhciBwcm9taXNlQ2FwYWJpbGl0eSA9IG5ld1Byb21pc2VDYXBhYmlsaXR5LmYodGhpcyk7XG4gIHZhciByZXN1bHQgPSBwZXJmb3JtKGNhbGxiYWNrZm4pO1xuICAocmVzdWx0LmUgPyBwcm9taXNlQ2FwYWJpbGl0eS5yZWplY3QgOiBwcm9taXNlQ2FwYWJpbGl0eS5yZXNvbHZlKShyZXN1bHQudik7XG4gIHJldHVybiBwcm9taXNlQ2FwYWJpbGl0eS5wcm9taXNlO1xufSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5wcm9taXNlLnRyeS5qc1xuLy8gbW9kdWxlIGlkID0gNDQ5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///449\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(451);\nmodule.exports = __webpack_require__(11).Object.assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvYXNzaWduLmpzPzU3N2IiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmFzc2lnbicpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0LmFzc2lnbjtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA0NTBcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///450\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.1 Object.assign(target, source)\nvar $export = __webpack_require__(26);\n\n$export($export.S + $export.F, 'Object', { assign: __webpack_require__(452) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuYXNzaWduLmpzPzQ3OGMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4zLjEgT2JqZWN0LmFzc2lnbih0YXJnZXQsIHNvdXJjZSlcbnZhciAkZXhwb3J0ID0gcmVxdWlyZSgnLi9fZXhwb3J0Jyk7XG5cbiRleHBvcnQoJGV4cG9ydC5TICsgJGV4cG9ydC5GLCAnT2JqZWN0JywgeyBhc3NpZ246IHJlcXVpcmUoJy4vX29iamVjdC1hc3NpZ24nKSB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuYXNzaWduLmpzXG4vLyBtb2R1bGUgaWQgPSA0NTFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///451\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// 19.1.2.1 Object.assign(target, source, ...)\nvar getKeys = __webpack_require__(68);\nvar gOPS = __webpack_require__(145);\nvar pIE = __webpack_require__(81);\nvar toObject = __webpack_require__(76);\nvar IObject = __webpack_require__(190);\nvar $assign = Object.assign;\n\n// should work with symbols and should have deterministic property order (V8 bug)\nmodule.exports = !$assign || __webpack_require__(70)(function () {\n var A = {};\n var B = {};\n // eslint-disable-next-line no-undef\n var S = Symbol();\n var K = 'abcdefghijklmnopqrst';\n A[S] = 7;\n K.split('').forEach(function (k) { B[k] = k; });\n return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;\n}) ? function assign(target, source) { // eslint-disable-line no-unused-vars\n var T = toObject(target);\n var aLen = arguments.length;\n var index = 1;\n var getSymbols = gOPS.f;\n var isEnum = pIE.f;\n while (aLen > index) {\n var S = IObject(arguments[index++]);\n var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);\n var length = keys.length;\n var j = 0;\n var key;\n while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];\n } return T;\n} : $assign;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtYXNzaWduLmpzPzRlOGQiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xuLy8gMTkuMS4yLjEgT2JqZWN0LmFzc2lnbih0YXJnZXQsIHNvdXJjZSwgLi4uKVxudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xudmFyIGdPUFMgPSByZXF1aXJlKCcuL19vYmplY3QtZ29wcycpO1xudmFyIHBJRSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKTtcbnZhciB0b09iamVjdCA9IHJlcXVpcmUoJy4vX3RvLW9iamVjdCcpO1xudmFyIElPYmplY3QgPSByZXF1aXJlKCcuL19pb2JqZWN0Jyk7XG52YXIgJGFzc2lnbiA9IE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IHZhciBqID0gMDtcbiAgICB2YXIga2V5O1xuICAgIHdoaWxlIChsZW5ndGggPiBqKSBpZiAoaXNFbnVtLmNhbGwoUywga2V5ID0ga2V5c1tqKytdKSkgVFtrZXldID0gU1trZXldO1xuICB9IHJldHVybiBUO1xufSA6ICRhc3NpZ247XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fb2JqZWN0LWFzc2lnbi5qc1xuLy8gbW9kdWxlIGlkID0gNDUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///452\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(454);\nvar $Object = __webpack_require__(11).Object;\nmodule.exports = function defineProperty(it, key, desc) {\n return $Object.defineProperty(it, key, desc);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzP2Y1YjAiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmRlZmluZS1wcm9wZXJ0eScpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBkZWZpbmVQcm9wZXJ0eShpdCwga2V5LCBkZXNjKSB7XG4gIHJldHVybiAkT2JqZWN0LmRlZmluZVByb3BlcnR5KGl0LCBrZXksIGRlc2MpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///453\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(26);\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !__webpack_require__(51), 'Object', { defineProperty: __webpack_require__(45).f });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5LmpzPzk4MjkiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi40IC8gMTUuMi4zLjYgT2JqZWN0LmRlZmluZVByb3BlcnR5KE8sIFAsIEF0dHJpYnV0ZXMpXG4kZXhwb3J0KCRleHBvcnQuUyArICRleHBvcnQuRiAqICFyZXF1aXJlKCcuL19kZXNjcmlwdG9ycycpLCAnT2JqZWN0JywgeyBkZWZpbmVQcm9wZXJ0eTogcmVxdWlyZSgnLi9fb2JqZWN0LWRwJykuZiB9KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZGVmaW5lLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///454\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.log = undefined;\n\nvar _loglevel = __webpack_require__(4);\n\nvar _loglevel2 = _interopRequireDefault(_loglevel);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar a = _loglevel2.default.getLogger('address-allocation');\nvar b = _loglevel2.default.getLogger('Bus');\nvar c = _loglevel2.default.getLogger('MessageBus');\nvar d = _loglevel2.default.getLogger('CoreDiscovery');\nvar e = _loglevel2.default.getLogger('StorageManager');\nvar f = _loglevel2.default.getLogger('HypertyResourcesStorage');\nvar g = _loglevel2.default.getLogger('IdentityModule');\nvar h = _loglevel2.default.getLogger('PEP');\nvar i = _loglevel2.default.getLogger('P2PConnectionResolve');\nvar j = _loglevel2.default.getLogger('Registry');\nvar k = _loglevel2.default.getLogger('RuntimeUA');\nvar l = _loglevel2.default.getLogger('Loader');\nvar m = _loglevel2.default.getLogger('Descriptors');\nvar n = _loglevel2.default.getLogger('DataObjectsStorage');\nvar o = _loglevel2.default.getLogger('Subscription');\nvar p = _loglevel2.default.getLogger('SubscriptionManager');\nvar q = _loglevel2.default.getLogger('ObserverObject');\nvar r = _loglevel2.default.getLogger('ReporterObject');\nvar s = _loglevel2.default.getLogger('SynSubscription');\nvar t = _loglevel2.default.getLogger('SyncherManager');\nvar u = _loglevel2.default.getLogger('IdentityHandler');\nvar v = _loglevel2.default.getLogger('CryptoManager');\nvar x = _loglevel2.default.getLogger('Pipeline');\nvar f1 = _loglevel2.default.getLogger('Syncher');\nvar f2 = _loglevel2.default.getLogger('DataObjectObserver');\n\nexports.log = _loglevel2.default;\n\n/**\n 0 actual logging methods, ordered and available as:\n\n 0 - log.trace(msg)\n 1 - log.debug(msg)\n 2 - log.info(msg)\n 3 - log.warn(msg)\n 4 - log.error(msg)\n\n log.log(msg) is also available, as an alias for log.debug(msg), to improve compatibility with console, and make migration easier.\n\n Exact output formatting of these will depend on the console available in the current context of your application. For example, many environments will include a full stack trace with all trace() calls, and icons or similar to highlight other calls.\n\n These methods should never fail in any environment, even if no console object is currently available, and should always fall back to an available log method even if the specific method called (e.g. warn) isn't available.\n\n Be aware that all this means that these method won't necessarily always produce exactly the output you expect in every environment; loglevel only guarantees that these methods will never explode on you, and that it will call the most relevant method it can find, with your argument. Firefox is a notable example here: due to a current Firefox bug log.trace(msg) calls in Firefox will print only the stacktrace, and won't include any passed message arguments.\n\n*/\n\n// address-allocation\n\na.setLevel(3);\n\n// Bus\nb.setLevel(3);\n\n// MessageBus\nc.setLevel(3);\n\n// CoreDiscovery\nd.setLevel(5);\n\n// StorageManager\ne.setLevel(0);\n\n// HypertyResourcesStorage\nf.setLevel(3);\n\n// IdentityModule\ng.setLevel(3);\n\n// PEP\nh.setLevel(3);\n\n// P2PConnectionResolve\ni.setLevel(3);\n\n// Registry\nj.setLevel(0);\n\n// RuntimeUA\nk.setLevel(0);\n\n// Loader\nl.setLevel(0);\n\n// Descriptors\nm.setLevel(3);\n\n// DataObjectsStorage\nn.setLevel(0);\n\n// Subscription\no.setLevel(3);\n\n// SubscriptionManager\np.setLevel(3);\n\n// ObserverObject\nq.setLevel(0);\n\n// ReporterObject\nr.setLevel(0);\n\n// SynSubscription\ns.setLevel(3);\n\n// SyncherManager\nt.setLevel(0);\n\n// IdentityHandler\nu.setLevel(3);\n\n// CryptoManager\nv.setLevel(0);\n\n// Pipeline\nx.setLevel(0);\n\n// Syncher\nf1.setLevel(0);\n\n// Syncher DataObjectObserver\nf1.setLevel(0);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9sb2dMZXZlbHMuanM/ZjM5MSJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgbG9nIGZyb20gJ2xvZ2xldmVsJztcblxuY29uc3QgYSA9IGxvZy5nZXRMb2dnZXIoJ2FkZHJlc3MtYWxsb2NhdGlvbicpO1xuY29uc3QgYiA9IGxvZy5nZXRMb2dnZXIoJ0J1cycpO1xuY29uc3QgYyA9IGxvZy5nZXRMb2dnZXIoJ01lc3NhZ2VCdXMnKTtcbmNvbnN0IGQgPSBsb2cuZ2V0TG9nZ2VyKCdDb3JlRGlzY292ZXJ5Jyk7XG5jb25zdCBlID0gbG9nLmdldExvZ2dlcignU3RvcmFnZU1hbmFnZXInKTtcbmNvbnN0IGYgPSBsb2cuZ2V0TG9nZ2VyKCdIeXBlcnR5UmVzb3VyY2VzU3RvcmFnZScpO1xuY29uc3QgZyA9IGxvZy5nZXRMb2dnZXIoJ0lkZW50aXR5TW9kdWxlJyk7XG5jb25zdCBoID0gbG9nLmdldExvZ2dlcignUEVQJyk7XG5jb25zdCBpID0gbG9nLmdldExvZ2dlcignUDJQQ29ubmVjdGlvblJlc29sdmUnKTtcbmNvbnN0IGogPSBsb2cuZ2V0TG9nZ2VyKCdSZWdpc3RyeScpO1xuY29uc3QgayA9IGxvZy5nZXRMb2dnZXIoJ1J1bnRpbWVVQScpO1xuY29uc3QgbCA9IGxvZy5nZXRMb2dnZXIoJ0xvY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E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///455\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _Sandbox = __webpack_require__(468);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nvar _HypertyInstance = __webpack_require__(215);\n\nvar _HypertyInstance2 = _interopRequireDefault(_HypertyInstance);\n\nvar _DomainRegistration = __webpack_require__(508);\n\nvar _DomainRegistration2 = _interopRequireDefault(_DomainRegistration);\n\nvar _P2PConnectionResolve = __webpack_require__(509);\n\nvar _P2PConnectionResolve2 = _interopRequireDefault(_P2PConnectionResolve);\n\nvar _utils = __webpack_require__(6);\n\n__webpack_require__(149);\n\nvar _Utils = __webpack_require__(216);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Registry'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n\n// import DiscoveryServiceFramework from './DiscoveryServiceFramework';\n\nvar STATUS = { CREATED: 'created', LIVE: 'live', DEPLOYING: 'deploying', DEPLOYED: 'deployed', PROGRESS: 'in-progress', DISCONNECTED: 'disconnected', FAILED: 'deployment-failed', DEAD: 'dead' };\n\n/*import IdentityManager from './IdentityManager';\nimport Discovery from './Discovery';*/\n\n/**\n* Runtime Registry Interface\n*/\n\nvar Registry = function () {\n\n /**\n * To initialise the Runtime Registry with the RuntimeURL that will be the basis to derive the internal runtime addresses when allocating addresses to internal runtime component. In addition, the Registry domain back-end to be used to remotely register Runtime components, is also passed as input parameter.\n * @param {MessageBus} msgbus msgbus\n * @param {HypertyRuntimeURL} runtimeURL runtimeURL\n * @param {AppSandbox} appSandbox appSandbox\n * @param {runtimeCatalogue} runtimeCatalogue runtimeCatalogue\n * @param {DomainURL} remoteRegistry remoteRegistry\n * @param {storageManager} storageManager\n */\n function Registry(runtimeURL, appSandbox, identityModule, runtimeCatalogue, runtimeCapabilities, storageManager, p2pHandlerURL, remoteRegistry) {\n (0, _classCallCheck3.default)(this, Registry);\n\n\n // how some functions receive the parameters for example:\n // new Registry('hyperty-runtime://sp1/123', appSandbox, idModule, remoteRegistry);\n // registry.registerStub(sandbox, 'sp1');\n // registry.registerHyperty(sandBox, 'hyperty-runtime://sp1/123');\n // registry.resolve('hyperty-runtime://sp1/123');\n\n if (!runtimeURL) throw new Error('runtimeURL is missing.');\n if (!storageManager) throw new Error('storageManager is missing.');\n\n /*if (!remoteRegistry) throw new Error('remoteRegistry is missing');*/\n\n var _this = this;\n\n _this.registryURL = runtimeURL + '/registry/';\n _this.appSandbox = appSandbox;\n _this.runtimeURL = runtimeURL;\n _this.p2pHandlerURL = p2pHandlerURL;\n _this.runtimeCatalogue = runtimeCatalogue;\n _this.remoteRegistry = remoteRegistry;\n _this.idModule = identityModule;\n _this.storageManager = storageManager;\n _this.runtimeCapabilities = runtimeCapabilities;\n _this.identifier = (0, _utils.generateGUID)();\n\n _this.hypertiesListToRemove = {};\n _this.hypertiesList = [];\n _this.remoteHypertyList = [];\n _this.remoteDataObjectList = [];\n _this.idpLegacyProxyList = {};\n\n _this.watchingYou = new _Utils.WatchingYou();\n _this.p2pHandlerStub = {};\n _this.p2pRequesterStub = _this.watchingYou.watch('p2pRequesterStub', {}, true);\n _this.p2pConnectionList = _this.watchingYou.watch('p2pConnectionList', {}, true);\n _this.p2pHandlerAssociation = {};\n\n _this.protostubsList = _this.watchingYou.watch('protostubsList', {}, true);\n _this.idpProxyList = _this.watchingYou.watch('idpProxyList', {}, true);\n _this.dataObjectList = {};\n _this.subscribedDataObjectList = {};\n _this.sandboxesList = { sandbox: {}, appSandbox: {} };\n _this.pepList = {};\n _this.registries = {};\n\n _this._domain = (0, _utils.divideURL)(_this.registryURL).domain;\n _this.sandboxesList.appSandbox[runtimeURL] = appSandbox;\n var p2pConnectionResolve = new _P2PConnectionResolve2.default(_this);\n\n _this._p2pConnectionResolve = p2pConnectionResolve;\n\n _this._hypertyUrls = {};\n _this._dataObjectUrls = {};\n }\n\n (0, _createClass3.default)(Registry, [{\n key: 'loadRegistry',\n value: function loadRegistry() {\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n _this.storageManager.get('registry:HypertyURLs').then(function (urlsList) {\n if (urlsList) _this._hypertyUrls = urlsList;\n _this.storageManager.get('registry:DataObjectURLs').then(function (urlsList) {\n if (urlsList) _this._dataObjectUrls = urlsList;\n resolve();\n });\n });\n });\n }\n }, {\n key: '_getIdentityAssociated',\n value: function _getIdentityAssociated(type, hypertyURL) {\n var _this = this;\n\n for (var hyperty in _this.hypertiesList) {\n var value = _this.hypertiesList[hyperty];\n\n if (value._hypertyURL === hypertyURL) {\n switch (type) {\n case 'username':\n return value._user.username;\n case 'cn':\n return value._user.cn;\n case 'locale':\n return value._user.locale;\n case 'avatar':\n return value._user.avatar;\n case 'userURL':\n return value._user.userURL;\n case '.':\n return value._user;\n default:\n return '';\n }\n }\n }\n return '';\n }\n\n /**\n * This function is used to return the sandbox instance where the Application is executing. It is assumed there is just one App per Runtime instance.\n */\n\n }, {\n key: 'getAppSandbox',\n value: function getAppSandbox() {\n var _this = this;\n return _this.appSandbox;\n }\n\n /**\n * This function returns the user associated to the hyperty URL\n * @param {String} hypertyURL hyperty URL\n * @return {String} userURL user URL\n */\n\n }, {\n key: 'getHypertyOwner',\n value: function getHypertyOwner(hypertyURL) {\n\n var _this = this;\n var userURL = void 0;\n\n for (var index in _this.hypertiesList) {\n var hyperty = _this.hypertiesList[index];\n\n if (hyperty.hypertyURL === hypertyURL) {\n return hyperty.user.userURL;\n }\n }\n return userURL;\n }\n\n /**\n * This function returns the user associated to the hyperty URL\n * @param {String} dataObjectURL dataObjectURL URL\n * @return {String} userURL user URL\n */\n\n }, {\n key: 'getDataObjectReporter',\n value: function getDataObjectReporter(dataObjectURL) {\n\n var _this = this;\n var DOurl = (0, _utils.removePathFromURL)(dataObjectURL);\n for (var index in _this.dataObjectList) {\n var dataObject = _this.dataObjectList[index];\n\n if (dataObject.url === DOurl) {\n return dataObject.reporter;\n }\n }\n return null;\n }\n\n /**\n * returns the hyperty Name from a given url. This url could be from a dataObject or hyperty\n * @param {String} url hyperty or dataObject URL\n * @return {String} hypertyName hyperty Name\n */\n\n }, {\n key: 'getHypertyName',\n value: function getHypertyName(url) {\n var _this = this;\n\n var isHypertyURL = (0, _utils.divideURL)(url).type === 'hyperty';\n\n //value to be returned in the end\n var hypertyName = void 0;\n\n //if is not an hyperty, check if is a dataObject and obtain his reporter\n var hypertyURL = isHypertyURL ? url : _this.getReporterURLSynchonous(url);\n\n for (var index in _this.hypertiesList) {\n var hyperty = _this.hypertiesList[index];\n if (hyperty.hypertyURL === hypertyURL) {\n hypertyName = hyperty.objectName;\n break;\n }\n }\n return hypertyName;\n }\n\n /**\n * function to return the reporterURL associated with the dataobject URL\n * @param {String} dataObjectURL dataObjectURL\n * @return {String} reporterURL reporterURL\n */\n\n }, {\n key: 'getReporterURL',\n value: function getReporterURL(dataObjectURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n if (dataObject) {\n resolve(dataObject.reporter);\n } else {\n reject('No reporter was found');\n }\n });\n }\n\n /**\n * function to return the reporterURL associated with the dataobject URL. no promise returned\n * @param {String} dataObjectURL dataObjectURL\n * @return {String} reporterURL reporterURL\n */\n\n }, {\n key: 'getReporterURLSynchonous',\n value: function getReporterURLSynchonous(dataObjectURL) {\n var _this = this;\n\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n return dataObject ? dataObject.reporter : undefined;\n }\n\n /**\n * returns the hyperty URL that subscribed the dataObject\n * @param {String} url url format\n * @return {String} Hyperty URL subscribed to the URL\n */\n\n }, {\n key: 'getDataObjectSubscriberHyperty',\n value: function getDataObjectSubscriberHyperty(url) {\n var _this = this;\n\n return _this.subscribedDataObjectList[url];\n }\n\n /**\n * register a desired dataObject to subscribe\n * @param {String} dataObjectURL dataObject URL\n */\n\n }, {\n key: 'registerSubscribedDataObject',\n value: function registerSubscribedDataObject(dataObjectURL, hypertyURL) {\n var _this = this;\n if (_this.subscribedDataObjectList[dataObjectURL] === undefined) {\n _this.subscribedDataObjectList[dataObjectURL] = hypertyURL;\n }\n }\n\n /**\n * Function to return the list of pre authorised users received in the creation of a data object\n * @param {String} dataObjectURL dataObjectURL\n * @return {Array} preAuth List of pre authorised users\n */\n\n }, {\n key: 'getPreAuthSubscribers',\n value: function getPreAuthSubscribers(dataObjectURL) {\n var _this = this;\n var dataObject = _this.dataObjectList[dataObjectURL];\n var preAuth = [];\n\n if (dataObject) {\n preAuth = dataObject.authorise;\n }\n return preAuth;\n }\n\n /**\n * send requests to unregister all hyperties registered in domain registry\n * @return {Promise} return a promise if the result of unregistration all hyperties\n */\n\n }, {\n key: 'unregisterAllHyperties',\n value: function unregisterAllHyperties() {\n var _this = this;\n\n var unregisterResults = [];\n\n return new _promise2.default(function (resolve, reject) {\n\n for (var index in _this.hypertiesList) {\n var hyperty = _this.hypertiesList[index];\n var result = _this.unregisterHypertyInstance(hyperty.hypertyURL);\n unregisterResults.push(result);\n }\n\n _promise2.default.all(unregisterResults).then(function () {\n\n resolve('successfully unregistered all hyperties');\n }, function (error) {\n reject(error);\n });\n });\n }\n\n /**\n * function to unregister an hypertyInstance in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n }, {\n key: 'unregisterHypertyInstance',\n value: function unregisterHypertyInstance(hypertyInstance) {\n //TODO working but the user\n var _this = this;\n\n var closeMsg = { type: 'execute', from: _this.registryURL,\n to: hypertyInstance,\n body: { method: 'close' } };\n\n // Send message to hyperty to close\n _this._messageBus.postMessage(closeMsg, function (reply) {\n log.log('[Registry.unregisterHypertyInstance] Close Reply', reply);\n\n _this._domainRegistration.unregisterHyperty(hypertyInstance);\n });\n }\n\n /**\n * function to unregister a Data Object in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n }, {\n key: 'unregisterDataObject',\n value: function unregisterDataObject(url) {\n this._domainRegistration.unregisterDataObject(url);\n }\n\n /**\n * register a new subscriber in the dataObject registered\n * @param {String} dataObjectURL dataObject URL\n * @param {String} subscriberURL subscriber URL\n */\n\n }, {\n key: 'registerSubscriber',\n value: function registerSubscriber(dataObjectURL, subscriberURL) {\n var _this = this;\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n if (dataObject) {\n\n if (!dataObject.subscribers) dataObject.subscribers = [];\n\n dataObject.subscribers.push(subscriberURL);\n _this.dataObjectList[dataObjectURL] = dataObject;\n }\n }\n\n /**\n * get the subscribers registered within a dataObject\n * @param {String} dataObjectURL dataObject URL\n * @param {Array} Substribers List\n */\n\n }, {\n key: 'getDataObjectSubscribers',\n value: function getDataObjectSubscribers(dataObjectURL) {\n var _this = this;\n var dataObject = _this.dataObjectList[dataObjectURL];\n\n if (dataObject) {\n return dataObject.subscribers;\n } else {\n throw 'No dataObject was found';\n }\n }\n\n /**\n * To register a new Data Object in the runtime which returns the dataObjectURL allocated to the new Data Object.\n * @param {String} identifier identifier\n * @param {String} dataObjectschema dataObjectschema\n * @param {String} dataObjectUrl dataObjectUrl\n * @param {String} dataObjectReporter dataObjectReporter\n * @param {Array} resources dataObject resources\n * @param {Array} authorise list of pre authorised authorised IDs\n */\n //registerDataObject(identifier, dataObjectschema, dataObjectUrl, dataObjectReporter, resources, addressURL, authorise) {\n\n }, {\n key: 'registerDataObject',\n value: function registerDataObject(objectRegistration) {\n var _this = this;\n\n var registration = (0, _utils.deepClone)(objectRegistration);\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.dataObjectList[objectRegistration.url] = objectRegistration;\n\n // _this.storageManager.get('registry:DataObjectURLs').then((urlsList) => {\n\n /* if (!urlsList) {\n urlsList = {};\n }*/\n\n //update the list with the new elements\n _this._dataObjectUrls[objectRegistration.name + objectRegistration.schema + objectRegistration.resources + objectRegistration.reporter] = objectRegistration.url;\n\n // step to obtain the list of all URL registered to updated with the new one.\n _this.storageManager.set('registry:DataObjectURLs', 0, _this._dataObjectUrls).then(function () {\n\n if (_this.isInterworkingProtoStub(registration.reporter)) {\n registration.interworking = true;\n }\n\n var domainRegistration = true;\n\n if (registration.hasOwnProperty(\"domain_registration\")) domainRegistration = registration.domain_registration;\n\n if (domainRegistration) _this._domainRegistration.registerDataObject(registration, objectRegistration.resume, _this.p2pHandlerStub).then(function (registered) {\n resolve(registered);\n });else resolve(registration);\n }).catch(function (reason) {\n log.error('[Registry registerDataObject] Error: ', reason);\n reject(reason);\n });\n });\n // });\n }\n }, {\n key: '_getResourcesAndSchemes',\n value: function _getResourcesAndSchemes(descriptor) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var resources = void 0;\n\n // check if the hyperty resources is a vector or a string\n // TODO delete later when catalogue is fixed\n if (typeof descriptor.hypertyType === 'string') {\n resources = [];\n resources.push(descriptor.hypertyType);\n } else {\n resources = descriptor.hypertyType;\n }\n\n var objName = descriptor.objectName;\n\n var descriptorDataSchema = descriptor.dataObjects;\n var dataSchemasArray = [];\n\n //this will create a array with a Promise in each position\n for (var index in descriptorDataSchema) {\n dataSchemasArray.push(_this.runtimeCatalogue.getDataSchemaDescriptor(descriptorDataSchema[index]));\n }\n\n // as soon as the previous array is completed, this will wait for the resolve of all promises in the array\n _promise2.default.all(dataSchemasArray).then(function (dataSchemas) {\n\n var filteredDataSchemas = [];\n for (var _index in dataSchemas) {\n var dataSchema = dataSchemas[_index];\n filteredDataSchemas.push(dataSchema.sourcePackage.sourceCode.properties.scheme.constant);\n }\n\n // log.log('[Registry] Hyperty Schemas', filteredDataSchemas);\n // log.log('[Registry] Hyperty resources', resources);\n\n resolve({ resources: resources, dataSchema: filteredDataSchemas, name: objName });\n });\n });\n }\n\n /**\n * method that returns previously registered Hyperty or DataObjects URLS, for given characteristics\n * @param {JSON} info object or hyperty charateristics info\n * @return {addressURL} addressURL return the URL if there is any previousy registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkRegisteredURLs',\n value: function checkRegisteredURLs(info, reuseURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var objectType = info.reporter ? 'registry:DataObjectURLs' : 'registry:HypertyURLs';\n\n if (typeof reuseURL === 'string') {\n objectType = reuseURL && (0, _utils.divideURL)(reuseURL).type !== 'hyperty' ? 'registry:DataObjectURLs' : 'registry:HypertyURLs';\n }\n //debugger;\n _this.storageManager.get(objectType).then(function (urlsList) {\n\n if (!urlsList) {\n urlsList = {};\n }\n\n if (typeof reuseURL === 'string') {\n log.info('[Registry - checkRegisteredURLs] - look for ' + reuseURL + ' on ', urlsList);\n\n var searchResult = (0, _keys2.default)(urlsList).map(function (key) {\n var indexOf = urlsList[key].indexOf(reuseURL);\n return urlsList[key][indexOf];\n });\n\n log.info('[Registry - checkRegisteredURLs] - found ' + searchResult.length + ' results on ', searchResult);\n if (searchResult.length === 1) {\n return resolve(searchResult);\n } else {\n return resolve(undefined);\n }\n }\n\n if (objectType === 'registry:HypertyURLs') {\n _this._getResourcesAndSchemes(info).then(function (value) {\n if (urlsList[value.resources + value.dataSchema + value.name]) {\n // log.log('[Registry] reusage of hyperty URL');\n return resolve(urlsList[value.resources + value.dataSchema + value.name]);\n } else {\n // log.log('[Registry] no hyperty URL was previously registered ');\n return resolve(undefined);\n }\n });\n } else {\n\n var characteristics = info.name + info.schema + info.resources + info.reporter;\n\n if (urlsList[characteristics]) {\n // log.log('[Registry] reusage of dataObject URL');\n if (typeof urlsList[characteristics] === 'string') {\n var arrayToResolve = [];\n arrayToResolve.push(urlsList[characteristics]);\n return resolve(arrayToResolve);\n } else {\n return resolve(urlsList[characteristics]);\n }\n } else {\n // log.log('[Registry] no dataObject URL was previously registered');\n return resolve(undefined);\n }\n }\n });\n });\n }\n\n /**\n * To register a new Hyperty in the runtime which returns the HypertyURL allocated to the new Hyperty.\n * @param {Sandbox} sandbox sandbox\n * @param {HypertyCatalogueURL} HypertyCatalogueURL descriptor\n * @param {object} IdpConstraint - constraints to be used when selecting the identity to be associated with the Hyperty including origin, idp, and idHint.\n * @return {HypertyURL} HypertyURL\n */\n\n }, {\n key: 'registerHyperty',\n value: function registerHyperty(sandbox, descriptorURL, descriptor, addressURL, IdpConstraint) {\n var _this = this;\n\n var hypertyCapabilities = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.idModule.getIdentityAssertion(IdpConstraint).then(function (result) {\n\n var userProfile = result.userProfile;\n\n // log.log('[Registry registerHyperty] userProfile', userProfile);\n\n if (_this._messageBus === undefined) {\n reject('[Registry registerHyperty] MessageBus is undefined');\n } else {\n //call check if the protostub exist: to be removed\n /* _this.resolve(domainUrl).then(function(a) {\n // log.log('[Registry registerHyperty] stub to domain registry- ', a);*/\n\n // _this.storageManager.get('registry:HypertyURLs').then((urlsList) => {\n\n\n // log.log('[Registry registerHyperty] storageManager] - ', urlsList);\n\n _this._getResourcesAndSchemes(descriptor).then(function (value) {\n\n hypertyCapabilities = value;\n\n /* if (!urlsList) {\n urlsList = {};\n }*/\n\n _this._hypertyUrls[hypertyCapabilities.resources + hypertyCapabilities.dataSchema + hypertyCapabilities.name] = addressURL.address;\n _this.storageManager.set('registry:HypertyURLs', 0, _this._hypertyUrls).then(function () {\n\n //check whether the received sanbox e ApplicationSandbox or a normal sandbox\n if (sandbox.type === 'app') {\n _this.sandboxesList.appSandbox[addressURL.address[0]] = sandbox;\n } else if (sandbox.type === 'normal') {\n _this.sandboxesList.sandbox[addressURL.address[0]] = sandbox;\n } else {\n reject('Wrong SandboxType');\n }\n\n var p2pHandler = void 0;\n var p2pRequester = void 0;\n\n if ((0, _keys2.default)(_this.p2pHandlerStub).length !== 0) {\n p2pHandler = _this.p2pHandlerStub[_this.runtimeURL].url;\n p2pRequester = _runtimeUtils.runtimeUtils.runtimeDescriptor.p2pRequesterStub;\n }\n\n var hyperty = new _HypertyInstance2.default(_this.identifier, _this.registryURL, descriptorURL, descriptor, addressURL.address[0], userProfile, 'guid', _this.runtimeURL, 'ctx', p2pHandler, p2pRequester, hypertyCapabilities.dataSchema, hypertyCapabilities.resources);\n\n _this.hypertiesList.push(hyperty);\n\n /*--- start here move p2p and domain registry related features to a separated function.-------..*/\n\n var registrationAtdomain = true;\n\n if (descriptor.hasOwnProperty(\"_configuration\") && descriptor.configuration.hasOwnProperty(\"domain_registration\")) {\n registrationAtdomain = descriptor.configuration.domain_registration;\n }\n\n if (registrationAtdomain) _this._domainRegistration.registerHyperty(hyperty, addressURL.newAddress).then(function (registered) {\n resolve(registered);\n });else resolve({ url: hyperty.hypertyURL });\n\n /*------------------- END HERE MOVE DOMAIN REGISTRY ------------------*/\n }).catch(function (reason) {\n // log.log('[Registry registerHyperty] Error: ', reason);\n reject(reason);\n });\n });\n // });\n }\n }, function (err) {\n reject('[Registry registerHyperty] ', err);\n });\n });\n }\n\n /**\n * To unregister a previously registered Hyperty\n * @param {HypertyURL} HypertyURL url url\n */\n\n }, {\n key: 'unregisterHyperty',\n value: function unregisterHyperty(url) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var found = false;\n var index = 0;\n\n for (index = 0; index < _this.hypertiesList.length; index++) {\n var hyperty = _this.hypertiesList[index];\n if (hyperty !== undefined) {\n if (hyperty.hypertyURL === url) {\n found = true;\n break;\n }\n }\n }\n\n if (found === false) {\n reject('Hyperty not found');\n } else {\n delete _this.hypertiesList[index];\n resolve('Hyperty successfully deleted');\n }\n });\n }\n\n /**\n * To discover protocol stubs available in the runtime for a certain domain. If available, it returns the runtime url for the protocol stub that connects to the requested domain. Required by the runtime BUS to route messages to remote servers or peers (do we need something similar for Hyperties?).\n * @param {DomainURL} DomainURL url\n * @return {RuntimeURL} RuntimeURL\n */\n\n }, {\n key: 'discoverProtostub',\n value: function discoverProtostub(url) {\n if (!url) throw new Error('Parameter url needed');\n var _this = this;\n\n var dividedURL = (0, _utils.divideURL)(url);\n var domainURL = dividedURL.domain;\n\n if (_this.protostubsList.hasOwnProperty(domainURL) && _this.protostubsList[domainURL].status === STATUS.LIVE) {\n return _this.protostubsList[domainURL];\n } else {\n\n _this.protostubsList[domainURL] = {\n status: STATUS.DEPLOYING\n };\n\n throw new Error('[Registry - discoverProtoStub ] Message Node Protostub Not Found. Creating one');\n }\n }\n\n /**\n * To discover protocol stubs available in the runtime for a certain remote runtime URL. If available, it returns the runtime url for the protocol stub that connects to the requested domain.\n * Required by the runtime BUS to route messages to remote servers or peers (do we need something similar for Hyperties?).\n * @param {RuntimeURL} RuntimeURL url\n * @return {p2pRequester} RuntimeURL\n */\n\n }, {\n key: 'discoverP2PStub',\n value: function discoverP2PStub(runtimeURL) {\n var _this = this;\n\n if (runtimeURL) {\n\n if (_this.p2pRequesterStub.hasOwnProperty(runtimeURL) && _this.p2pRequesterStub[runtimeURL].status === STATUS.LIVE) {\n return _this.p2pRequesterStub[runtimeURL];\n } else {\n _this.p2pRequesterStub[runtimeURL] = {\n status: STATUS.CREATED\n };\n\n throw new Error('[Registry - discoverP2PStub ] P2P Requester Stub Not Found. Creating one');\n }\n } else {\n\n if (_this.p2pHandlerStub.hasOwnProperty(_this.runtimeURL)) {\n return _this.p2pHandlerStub[_this.runtimeURL];\n } else {\n _this.p2pHandlerStub[_this.runtimeURL] = {\n status: STATUS.CREATED\n };\n\n throw new Error('[Registry - discoverP2PStub ] P2P Handler Stub Not Found.');\n }\n }\n }\n\n /**\n * To register a new Protocol Stub in the runtime including as input parameters the function to postMessage, the DomainURL that is connected with the stub, which returns the RuntimeURL allocated to the new ProtocolStub.\n * @param {Sandbox} Sandbox\n * @param {stubID} Domain or hyperty runtime to register the stub\n * @param {descriptorURL} Catalogue URL of the Protostub descriptor\n * @param {descriptor} Protostub descriptor\n * @return {RuntimeProtoStubURL}\n */\n\n }, {\n key: 'registerStub',\n value: function registerStub(sandbox, stubID, p2pConfig, descriptorURL, descriptor) {\n var _this = this;\n\n var _stubDescriptor = descriptor;\n\n return new _promise2.default(function (resolve, reject) {\n\n var runtimeProtoStubURL = void 0;\n\n //check if messageBus is registered in registry or not\n if (_this._messageBus === undefined) {\n reject('MessageBus not found on registerStub');\n }\n\n log.info('[Registry - registerStub] - stubID ', stubID);\n\n /* if (!stubID.indexOf('msg-node.')) {\n stubID = stubID.substring(stubID.indexOf('.') + 1);\n }*/\n\n var P2PRequesterStub = void 0;\n\n if (p2pConfig) {\n\n if (p2pConfig.hasOwnProperty('isHandlerStub') && p2pConfig.isHandlerStub) {\n runtimeProtoStubURL = _this.p2pHandlerURL;\n\n _this.p2pHandlerStub[stubID] = {\n url: runtimeProtoStubURL,\n status: STATUS.CREATED\n };\n\n _this.p2pHandlerAssociation[_this.runtimeURL] = [];\n\n _this.sandboxesList.sandbox[runtimeProtoStubURL] = sandbox;\n log.info('[Registry - registerStub - P2PHandlerStub] - ', stubID, ' - ', runtimeProtoStubURL);\n resolve(_this.p2pHandlerStub[stubID]);\n } else {\n P2PRequesterStub = p2pConfig.p2pRequesterStub;\n runtimeProtoStubURL = 'runtime://' + (0, _utils.divideURL)(p2pConfig.remoteRuntimeURL).domain + '/p2prequester/' + (0, _utils.generateGUID)();\n log.info('[Registry - registerStub - P2PRequesterStub] - ', P2PRequesterStub, ' - ', runtimeProtoStubURL);\n\n // to be clarified what is this p2pHandlerAssociation\n _this.p2pHandlerAssociation[_this.runtimeURL].push(runtimeProtoStubURL);\n _this.p2pRequesterStub[stubID] = {\n url: runtimeProtoStubURL,\n status: STATUS.CREATED\n };\n\n _this.sandboxesList.sandbox[runtimeProtoStubURL] = sandbox;\n\n //Setup P2P Requester path into MN\n\n var msg = {\n type: 'subscribe',\n from: _this.registryURL,\n to: 'domain://msg-node.' + _this._domain + '/sm',\n body: {\n subscribe: [runtimeProtoStubURL],\n source: _this.registryURL\n }\n };\n\n _this._messageBus.postMessage(msg, function (reply) {\n // log.log('[Registry - register Stub] p2pRequester path setup: ', reply);\n });\n\n resolve(_this.p2pRequesterStub[stubID]);\n }\n } else {\n console.log('[Registry - registerStub - Normal Stub] descriptor', descriptor);\n\n if (!(typeof descriptor === 'undefined' ? 'undefined' : (0, _typeof3.default)(descriptor)) === 'string' && descriptor.hasOwnProperty('_interworking') && descriptor._interworking) {\n runtimeProtoStubURL = 'runtime://' + stubID + '/protostub/' + 'scheme1';\n } else {\n runtimeProtoStubURL = 'runtime://' + stubID + '/protostub/' + (0, _utils.generateGUID)();\n }\n\n log.info('[Registry - registerStub - Normal Stub] - ', stubID);\n\n // TODO: Optimize this\n _this.protostubsList[stubID] = {\n url: runtimeProtoStubURL,\n status: STATUS.DEPLOYING\n };\n\n if (descriptorURL) {\n _this.protostubsList[stubID].descriptorURL = descriptorURL;\n }\n\n if (_stubDescriptor && _stubDescriptor.interworking) {\n _this.protostubsList[stubID].interworking = _stubDescriptor.interworking;\n }\n\n _this.sandboxesList.sandbox[runtimeProtoStubURL] = sandbox;\n\n resolve(_this.protostubsList[stubID]);\n }\n\n // resolve(runtimeProtoStubURL);\n\n _this._messageBus.addListener(runtimeProtoStubURL + '/status', function (msg) {\n _this._onProtostubStatusEvent(msg);\n });\n });\n }\n\n /**\n * To Process status events fired by protostubs\n * @param {Message} message Event Message\n */\n\n }, {\n key: '_onProtostubStatusEvent',\n value: function _onProtostubStatusEvent(msg) {\n\n var _this = this;\n\n // log.log('[Registry onProtostubStatusEvent]: ', msg);\n\n var runtimeProtoStubURL = msg.from;\n\n if (!msg.to.includes('/status')) {\n log.error('[Registry onProtostubStatusEvent] Not Status Event: ', msg);\n return;\n } else {\n // broadcast Protostub status event to all Hyperties\n var from = msg.from;\n msg.from = _this.runtimeURL;\n msg.to = _this.runtimeURL + '/status';\n msg.body.resource = from;\n _this._messageBus.postMessage(msg);\n }\n\n // process status events from message node protostubs\n\n if (runtimeProtoStubURL.includes('/protostub/')) {\n\n // TODO: uncomment below when protostubs are updated with new status value \"live\"\n (0, _keys2.default)(_this.protostubsList).filter(function (key) {\n return _this.protostubsList[key].url === runtimeProtoStubURL;\n }).map(function (key) {\n _this.protostubsList[key].status = msg.body.value;\n\n // log.log('[Registry - onProtostubStatusEvent] - Protostub status: ', _this.protostubsList[key]);\n });\n } else {\n // process status events from p2p connections\n\n if (msg.body.resource) {\n var remoteRuntimeURL = msg.body.resource;\n\n if (_this.p2pConnectionList[remoteRuntimeURL]) {\n _this.p2pConnectionList[remoteRuntimeURL].status = msg.body.value;\n _this.p2pConnectionList[remoteRuntimeURL].url = runtimeProtoStubURL;\n } else {\n\n var p2pConnection = {\n status: msg.body.value,\n url: runtimeProtoStubURL\n };\n\n _this.p2pConnectionList[remoteRuntimeURL] = p2pConnection;\n }\n\n // log.log('[Registry - onProtostubStatusEvent] - P2PConnection status: ', _this.p2pConnectionList[remoteRuntimeURL]);\n\n // Update P2P Requester protostub if it is coming from there\n if (runtimeProtoStubURL.includes('/p2prequester/')) {\n _this.p2pRequesterStub[remoteRuntimeURL].status = msg.body.value;\n\n // log.log('[Registry - onProtostubStatusEvent] - P2P Requester status: ', _this.p2pRequesterStub[remoteRuntimeURL]);\n } else {\n // if from P2PHandler with status disconencted, lets remove from p2pConnectionList\n if (msg.body.value === 'disconnected') delete _this.p2pConnectionList[remoteRuntimeURL];\n }\n } else {\n if (runtimeProtoStubURL.includes('/p2prequester/')) {\n // It is an event from P2P Requester without mandatory \"resource\" field\n log.error('[Registry onProtostubStatusEvent] resource missing: ', msg);\n return;\n } else {\n // It is an event from P2P Handler\n _this.p2pHandlerStub[_this.runtimeURL].status = msg.body.value;\n\n // log.log('[Registry - onProtostubStatusEvent] - P2PHandler Stub status: ', _this.p2pHandlerStub[_this.runtimeURL]);\n }\n }\n }\n }\n\n /**\n * To unregister a previously registered protocol stub\n * @param {HypertyRuntimeURL} HypertyRuntimeURL hypertyRuntimeURL\n */\n\n }, {\n key: 'unregisterStub',\n value: function unregisterStub(hypertyRuntimeURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.protostubsList.hasOwnProperty(hypertyRuntimeURL)) {\n delete _this.protostubsList[hypertyRuntimeURL];\n resolve('ProtostubURL removed');\n } else {\n reject('Error on unregisterStub: Hyperty not found');\n }\n });\n }\n\n /**\n * To register a new Identity Provider proxy in the runtime including as input parameters the function to postMessage, the DomainURL that is connected with the stub, which returns the RuntimeURL allocated to the new ProtocolStub.\n * @param {Sandbox} Sandbox\n * @param {DomainURL} DomainURL service provider domain\n * @return {RuntimeIdpProxyURL}\n */\n\n }, {\n key: 'registerIdpProxy',\n value: function registerIdpProxy(sandbox, domainURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var idpProxyStubURL = void 0;\n\n //check if messageBus is registered in registry or not\n if (_this._messageBus === undefined) {\n reject('MessageBus not found on registerStub');\n }\n\n idpProxyStubURL = 'domain-idp://' + domainURL + '/stub/' + (0, _utils.generateGUID)();\n\n // TODO: Optimize this\n _this.idpProxyList[domainURL] = {\n url: idpProxyStubURL,\n status: STATUS.DEPLOYING\n };\n\n _this.sandboxesList.sandbox[idpProxyStubURL] = sandbox;\n\n // sandbox.addListener('*', function(msg) {\n // _this._messageBus.postMessage(msg);\n // });\n\n resolve(idpProxyStubURL);\n\n _this._messageBus.addListener(idpProxyStubURL + '/status', function (msg) {\n _this._onIdpProxyStatusEvent(msg);\n });\n });\n }\n\n /**\n * To Process status events fired by Idp Proxies\n * @param {Message} message Event Message\n */\n\n }, {\n key: '_onIdpProxyStatusEvent',\n value: function _onIdpProxyStatusEvent(msg) {\n\n var _this = this;\n\n // log.log('[Registry onIdpProxyStatusEvent]: ', msg);\n\n var idpProxyURL = msg.from;\n\n if (!msg.to.includes('/status')) {\n log.error('[Registry onIdpProxyStatusEvent] Not Status Event: ', msg);\n return;\n }\n\n (0, _keys2.default)(_this.idpProxyList).filter(function (key) {\n return _this.idpProxyList[key].url === idpProxyURL;\n }).map(function (key) {\n _this.idpProxyList[key].status = msg.body.value;\n\n // log.log('[Registry - onIdpProxyStatusEvent] - Idp Proxy status: ', _this.idpProxyList[key]);\n });\n }\n\n /**\n * To discover idpProxy stubs available in the runtime for a certain domain. If available, it returns the runtime url for the idpProxy stub that connects to the requested domain. Required by the runtime BUS to route messages to remote servers or peers\n * @param {DomainURL} DomainURL url\n * @return {RuntimeURL} RuntimeURL idpProxyUrl\n */\n\n }, {\n key: 'discoverIdpProxy',\n value: function discoverIdpProxy(url) {\n if (!url) throw new Error('Parameter url needed');\n var _this = this;\n\n var dividedURL = (0, _utils.divideURL)(url);\n var domainURL = dividedURL.domain;\n\n if (_this.idpProxyList.hasOwnProperty(domainURL) && _this.idpProxyList[domainURL].status === STATUS.LIVE) {\n return _this.idpProxyList[domainURL];\n } else {\n\n _this.idpProxyList[domainURL] = {\n status: STATUS.PROGRESS\n };\n\n throw new Error('[Registry - discoverIdpProxy ] Idp Proxy Not Found. Creating one');\n }\n }\n\n /**\n * To register a new Policy Enforcer in the runtime including as input parameters the function to postMessage, the HypertyURL associated with the PEP, which returns the RuntimeURL allocated to the new Policy Enforcer component.\n * @param {Message.Message} postMessage postMessage\n * @param {HypertyURL} HypertyURL hyperty\n * @return {HypertyRuntimeURL} HypertyRuntimeURL\n */\n\n }, {\n key: 'registerPEP',\n value: function registerPEP(postMessage, hyperty) {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n //TODO check what parameter in the postMessage the pep is.\n _this.pepList[hyperty] = postMessage;\n resolve('PEP registered with success');\n });\n }\n\n /**\n * To unregister a previously registered protocol stub\n * @param {HypertyRuntimeURL} HypertyRuntimeURL HypertyRuntimeURL\n */\n\n }, {\n key: 'unregisterPEP',\n value: function unregisterPEP(HypertyRuntimeURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var result = _this.pepList[HypertyRuntimeURL];\n\n if (result === undefined) {\n reject('Pep Not found.');\n } else {\n resolve('PEP successfully removed.');\n }\n });\n }\n\n /**\n * To discover sandboxes available in the runtime for a certain domain and a certain set of capabilities. Required by the runtime UA to avoid more than one sandbox for the same domain.\n * @param {DomainURL} DomainURL url\n * @return {RuntimeSandbox} RuntimeSandbox\n */\n\n }, {\n key: 'getSandbox',\n value: function getSandbox(url, constraints) {\n if (!url) throw new Error('Parameter url needed');\n\n // log.log('[Registry getSandbox] getSandbox for: ', url, ' and capabilities: ', constraints);\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n var request = void 0;\n\n //first try to find the url in the appSandbox list\n request = _this.sandboxesList.appSandbox[url];\n\n //if no appSandbox was found, try to search in the normal sandboxes list\n if (!request) {\n request = _this.sandboxesList.sandbox[url];\n\n if (!request) {\n\n var domain = void 0;\n\n if (url.includes('://')) {\n domain = (0, _utils.divideURL)(url).domain;\n } else {\n domain = url;\n }\n\n // search in the sandboxes list for a entry containing the domain given\n for (var sandbox in _this.sandboxesList.sandbox) {\n //todo: uncomment sandbox constraints match condition with runtime sharing\n if (sandbox.includes(domain) && _this.sandboxesList.sandbox[sandbox].matches(constraints)) {\n var _ret = function () {\n var current = _this.sandboxesList.sandbox[sandbox];\n var match = (0, _keys2.default)(constraints).filter(function (constraint) {\n return constraint === 'browser' && current.type === _Sandbox.SandboxType.NORMAL || constraint === 'windowSanbox' && current.type === _Sandbox.SandboxType.WINDOW;\n }).length > 0 ? true : false;\n\n if (match) {\n request = current;\n }\n return 'break';\n }();\n\n if (_ret === 'break') break;\n }\n }\n }\n }\n\n if (!request) {\n reject('no sandbox found for: ' + url);\n } else {\n resolve(request);\n }\n });\n }\n }, {\n key: 'resolveNormalStub',\n value: function resolveNormalStub(url) {\n // log.log('resolveNormalStub ' + url);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //split the url to find the domainURL. deals with the url for example as:\n //\"hyperty-runtime://sp1/protostub/123\",\n var dividedURL = (0, _utils.divideURL)(url);\n var domainUrl = dividedURL.domain;\n var type = dividedURL.type;\n\n if (url.includes(_this.runtimeURL) || url.includes('://sandbox/')) {\n log.error('[Registry - resolve] URL to be resolved should have listeners ', url);\n reject('[Registry - resolve] URL to be resolved should have listeners ', url);\n }\n\n // resolve the domain protostub in case of a message to global registry\n if (url.includes('global://registry')) {\n domainUrl = _this._domain;\n } else {\n if (!domainUrl.indexOf('msg-node.') || !domainUrl.indexOf('registry.')) {\n domainUrl = domainUrl.substring(domainUrl.indexOf('.') + 1);\n }\n }\n\n _this.isLegacy(url).then(function (isLegacy) {\n\n // if legacy it should resolve for .\n if (isLegacy && type !== 'domain-idp') {\n domainUrl = type + '.' + (0, _utils.getUserIdentityDomain)(url);\n }\n\n log.info('[Registry.resolve] domainUrl:', domainUrl);\n\n var registredComponent = void 0;\n\n if (type === 'domain-idp') {\n registredComponent = _this.idpProxyList.hasOwnProperty(domainUrl) ? _this.idpProxyList[domainUrl] : false;\n } else {\n registredComponent = _this.protostubsList.hasOwnProperty(domainUrl) ? _this.protostubsList[domainUrl] : false;\n }\n\n log.info('[Registry.resolve] registred:', registredComponent);\n\n // TODO since the protostubs have other states this should be revised, because the status could change from DEPLOYED to LIVE\n // TODO and this validation will trigger a new load of IDPProxy or Protostub;\n if (registredComponent && registredComponent.hasOwnProperty('status') && (registredComponent.status === STATUS.DEPLOYED || registredComponent.status === STATUS.CREATED || registredComponent.status === STATUS.LIVE || registredComponent.status === STATUS.DISCONNECTED)) {\n log.info('[Registry.resolve] Resolved: ', registredComponent.url, registredComponent.status);\n resolve(registredComponent.url);\n } else {\n //todo: use switch-case to support other types of stubs\n if (type === 'domain-idp') {\n\n // The IdP Proxy does not exist, let's prepare its deployment by watching its status\n\n _this.watchingYou.observe('idpProxyList', function (change) {\n\n // log.log('[Registry - resolveNormalStub] idpProxyList changed ' + _this.idpProxyList);\n\n var keypath = change.keypath;\n\n if (keypath.includes('status')) keypath = keypath.replace('.status', '');\n\n if (keypath === domainUrl && change.name === 'status' && change.newValue === STATUS.CREATED) {\n // log.log('[Registry - resolveNormalStub] idpProxyList is live ' + _this.idpProxyList[domainUrl]);\n resolve(_this.idpProxyList[domainUrl].url);\n }\n });\n\n if (!registredComponent) {\n // this process will load the idp proxy, because is not yet registered;\n log.info('[Registry.resolveNormalStub] deploy new IDPProxy: ', domainUrl);\n _this.loader.loadIdpProxy(domainUrl).then(function () {\n\n log.info('[Registry.resolveNormalStub] IdP Proxy deployed: ', _this.idpProxyList[domainUrl]);\n }).catch(function (reason) {\n log.error('[Registry.resolve] Error resolving Load IDPProxy: ', reason);\n _this.idpProxyList[domainUrl].status = 'deployment-failed';\n reject(reason);\n });\n }\n } else {\n\n // The protoStub does not exist, let's prepare its deployment by watching its status\n\n _this.watchingYou.observe('protostubsList', function (change) {\n\n // log.log('[Registry - resolveNormalStub] protostubsList changed ' + _this.protostubsList);\n\n var keypath = change.keypath;\n\n if (keypath.includes('status')) keypath = keypath.replace('.status', '');\n\n if (keypath === domainUrl && change.name === 'status' && change.newValue === STATUS.CREATED) {\n // log.log('[Registry - resolve] protostub is live ' + _this.protostubsList[domainUrl]);\n resolve(_this.protostubsList[domainUrl].url);\n }\n });\n\n if (!registredComponent) {\n // lets deploy the protostub\n log.info('[Registry.resolve] trigger new ProtocolStub: ', domainUrl);\n _this.loader.loadStub(domainUrl).then(function () {\n\n // log.log('[Registry - resolveNormalStub] Stub deployed: ', _this.protostubsList[domainUrl]);\n }).catch(function (reason) {\n log.error('[Registry.resolveNormalStub] Error resolving Load ProtocolStub: ', reason);\n reject(reason);\n });\n }\n }\n }\n }).catch(function (reason) {\n log.error('[Registry.resolve] Error resolving islegacy: ', reason);\n reject(reason);\n });\n });\n }\n\n /**\n * To verify if source is valid and to resolve target runtime url address if needed (eg protostub runtime url in case the message is to be dispatched to a remote endpoint).\n * @param {URL.URL} url url\n * @return {Promise} Promise \n */\n\n }, {\n key: 'resolve',\n value: function resolve(msg) {\n log.info('[Registry - Resolve] - ', msg);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var url = msg.to ? msg.to : msg;\n\n var p2p = msg.body && msg.body.p2p ? msg.body.p2p : false;\n\n // log.log('P2P: ', p2p, url);\n // log.log('P2P - p2pHandlerStub: ', !_this.p2pHandlerStub[_this.runtimeURL], _this.p2pHandlerStub, _this.runtimeURL);\n // log.log('P2P - isBackendServiceURL: ', isBackendServiceURL(url), isBackendServiceURL, url);\n // log.log('P2P - includes runtimeURL: ', url.includes(_this.runtimeURL));\n // log.log('P2P - includes p2phandler: ', url.includes('/p2phandler/'));\n // log.log('P2P - includes p2prequester: ', url.includes('/p2prequester/'));\n\n // Skip p2p procedure when not supported by the Runtime or for backend services\n\n if (!_this.p2pHandlerStub[_this.runtimeURL] || (0, _utils.isBackendServiceURL)(url) || url.includes(_this.runtimeURL) || url.includes('/p2phandler/') || url.includes('/p2prequester/')) {\n\n log.info('[Registry - resolve] - Resolve normal stub: ', _this.p2pHandlerStub, _this.runtimeURL, (0, _utils.isBackendServiceURL)(url), p2p, url);\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n } else {\n\n log.info('[Registry - resolve] - checkP2P: ', p2p, url, _this._p2pConnectionResolve);\n _this._p2pConnectionResolve.checkP2P(msg).then(function (registeredP2P) {\n\n // log.log('[Registry - resolve] found registered P2P: ', registeredP2P);\n\n var p2pConnection = _this.p2pConnectionList[registeredP2P.runtime];\n\n if (!p2pConnection) {\n p2pConnection = registeredP2P;\n _this.p2pConnectionList[registeredP2P.runtime] = p2pConnection;\n }\n\n switch (p2pConnection.status) {\n case STATUS.LIVE:\n msg.body.peer = registeredP2P.runtime;\n resolve(p2pConnection.url, msg);\n break;\n case STATUS.CREATED: // p2p connection setup is ongoing, use MN Stub\n case STATUS.PROGRESS:\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n break;\n case STATUS.DISCONNECTED:\n // p2p connection stub was disconnected, let's ask to connect again\n log.info('[Registry - Resolve] - p2pConnection is disconnected lets try to reconnect');\n _this._p2pConnectionResolve.reconnectP2PRequester(p2pConnection).then(function (returnURL) {\n // log.log('[Registry - Resolve] - was reconnected with p2pRequesterStubt: ', returnURL);\n resolve(returnURL);\n }, function (reason) {\n log.info('[Registry - Resolve] - Reason: ', reason);\n\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n });\n break;\n default:\n\n log.info('[Registry - resolve] - P2P: ', p2p);\n if (!p2p) {\n // no p2p connection exists and the message sender does not ask one. Lets use the MN Stub\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n } else {\n _this._setupP2PRequester(registeredP2P).then(function (returnURL) {\n // no p2p connection exists but the message sender is asking one. Lets try to setup one\n resolve(returnURL);\n }, function (reason) {\n log.info('[Registry - Resolve] - Reason: ', reason);\n\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n });\n }\n break;\n }\n }, function (reason) {\n log.info('[Registry - Resolve] - Reason: ', reason);\n\n _this.resolveNormalStub(url).then(function (returnURL) {\n resolve(returnURL);\n });\n });\n }\n });\n }\n }, {\n key: '_setupP2PRequester',\n value: function _setupP2PRequester(input) {\n var _this = this;\n\n log.log('[Registry._setupP2PConnection] loadStub with p2pRequester: ', input);\n\n return new _promise2.default(function (resolve, reject) {\n\n var remoteRuntime = input.runtime;\n\n var p2pConfig = { remoteRuntimeURL: remoteRuntime, p2pHandler: input.p2pHandler, p2pRequesterStub: true };\n\n // lets prepare the p2pRequesterSTub deployment by setting an observer to its status changes\n\n _this.watchingYou.observe('p2pRequesterStub', function (change) {\n\n log.log('[Registry._setupP2PConnection] p2pRequesterStubs changed ' + _this.p2pRequesterStub);\n\n if (change.keypath.split('.')[0] === remoteRuntime && change.name === 'status' && change.newValue === STATUS.LIVE) {\n log.log('[Registry._setupP2PConnection] p2pRequester is live ' + _this.p2pRequesterStub[remoteRuntime]);\n resolve(_this.p2pRequesterStub[remoteRuntime].url);\n }\n });\n\n // stub load\n _this.loader.loadStub(input.p2pRequester, p2pConfig).then(function () {\n\n log.log('[Registry._setupP2PConnection] p2pRequester deployed: ', _this.p2pRequesterStub[remoteRuntime]);\n }).catch(function (error) {\n reject(error);\n });\n });\n }\n\n /**\n * To verify if url is for a legacy service.\n * @param {URL.URL} url url\n * @return {boolean}\n */\n\n }, {\n key: 'isLegacy',\n value: function isLegacy(url) {\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (url === _this._domain) {\n return resolve(false);\n }\n\n log.log('[Registry] [Registry.Registry.isLegacy] ', url);\n\n // TODO: to be defined in the runtime configuration\n var nonLegacy = ['hyperty-runtime', 'domain', 'global', 'hyperty'];\n\n var urlDivided = (0, _utils.divideURL)(url);\n\n if (nonLegacy.indexOf(urlDivided.type) !== -1 || urlDivided.domain === _this._domain) {\n return resolve(false);\n }\n\n // process User URLs\n if (url.split('@').length > 1) {\n var domain = urlDivided.domain;\n\n // log.log('[Registry] [Registry.Registry.isLegacy] domain: ', domain);\n if (_this.idpLegacyProxyList.hasOwnProperty(domain)) {\n\n var result = _this.idpLegacyProxyList[domain];\n\n if (result.interworking) {\n return resolve(result.interworking);\n } else {\n return resolve(false);\n }\n }\n\n _this._loader.descriptors.getIdpProxyDescriptor(domain).then(function (result) {\n\n // log.log('[Registry] [Registry.Registry.isLegacy] Legacy stub descriptor: ', result);\n\n if (result.interworking) {\n _this.idpLegacyProxyList[domain] = result;\n resolve(result.interworking);\n } else {\n resolve(false);\n }\n }).catch(function (reason) {\n log.warn('problem loading idp proxy descriptor for domain:', domain, ' because ', reason);\n reject(reason);\n });\n } else {\n // process protostub URLs\n resolve(_this.isInterworkingProtoStub(url));\n }\n });\n }\n\n /**\n * To verify if URL is locally registered or not.\n * @param {URL.URL} url url\n * @return {boolean}\n */\n\n }, {\n key: 'isLocal',\n value: function isLocal(url) {\n\n var runtimeScheme = ['hyperty-runtime', 'runtime'];\n var hypertyScheme = ['hyperty'];\n var urlScheme = url.split('://')[0];\n\n // Process Runtime Core URLs.\n // Messages originated from protostubs should also not include the runtimeURL in its URL.\n\n if (runtimeScheme.indexOf(urlScheme) !== -1) {\n return url.includes(this.runtimeURL);\n }\n\n // Process Hyperty URLs\n // Todo: hypertiesList should be an object not an array\n\n if (hypertyScheme.indexOf(urlScheme) !== -1) {\n\n for (var index in this.hypertiesList) {\n var hyperty = this.hypertiesList[index];\n if (hyperty.hypertyURL === url) {\n return true;\n }\n }\n\n return false;\n }\n\n // Process Data Object URLs\n\n if (url.includes('/subscription')) {\n url = url.substring(0, url.indexOf('/subscription'));\n }\n\n var dataObject = this.dataObjectList[url];\n\n if (dataObject) {\n if (dataObject.interworking) {\n return !dataObject.interworking;\n }\n return true;\n }\n\n return false;\n }\n\n /**\n * To verify if protostub is to interwork with a legacy domain.\n * @param {URL.URL} runtimeProtostubURL The runtime URL of the Protostub\n * @return {boolean}\n */\n\n }, {\n key: 'isInterworkingProtoStub',\n value: function isInterworkingProtoStub(runtimeProtostubURL) {\n\n var _this = this;\n\n if (typeof runtimeProtostubURL === 'boolean') {\n return false;\n }\n\n if (!runtimeProtostubURL.includes('/protostub/')) {\n return false;\n }\n\n var filtered = (0, _keys2.default)(_this.protostubsList).filter(function (key) {\n return _this.protostubsList[key].url === runtimeProtostubURL;\n }).map(function (key) {\n\n if (_this.protostubsList[key].hasOwnProperty('interworking')) {\n return _this.protostubsList[key].interworking;\n } else {\n return false;\n }\n })[0];\n\n return filtered;\n }\n }, {\n key: 'loader',\n set: function set(loader) {\n var _this = this;\n _this._loader = loader;\n },\n get: function get() {\n var _this = this;\n return _this._loader;\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n\n _this._messageBus.addListener(_this.registryURL, function (msg) {\n\n // log.log('[Registry listener] ', msg);\n\n var isHyperty = (0, _utils.isHypertyURL)(msg.from);\n var hasCriteria = msg.body.hasOwnProperty('criteria');\n var isURLResource = void 0;\n var isUserResource = void 0;\n var isHypertyResource = void 0;\n\n if (msg.body.hasOwnProperty('resource') && msg.body.resource !== '.') {\n isURLResource = (0, _utils.isURL)(msg.body.resource);\n isUserResource = (0, _utils.isUserURL)(msg.body.resource);\n isHypertyResource = (0, _utils.isHypertyURL)(msg.body.resource);\n }\n var isDelete = msg.type === 'delete';\n var hasName = void 0;\n var hasUser = void 0;\n\n if (msg.body.hasOwnProperty('value')) {\n hasName = msg.body.value.hasOwnProperty('name');\n hasUser = msg.body.value.hasOwnProperty('user');\n }\n\n if (msg.type === 'response') {\n log.error('[Register listener] skipping ', msg);\n return;\n }\n\n // msg sent by identity manager library\n var userUrl = _this._getIdentityAssociated(msg.body.resource, msg.body.criteria);\n\n var reply = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: { resource: userUrl } };\n reply.body.code = userUrl ? 200 : 404;\n\n _this._messageBus.postMessage(reply);\n });\n\n // Install AddressAllocation\n var addressAllocation = _AddressAllocation2.default.instance;\n _this.addressAllocation = addressAllocation;\n\n _this._domainRegistration = new _DomainRegistration2.default(_this.runtimeURL, _this.registryURL, _this._domain, messageBus);\n\n // log.log('[Registry - AddressAllocation] - ', addressAllocation);\n }\n }]);\n return Registry;\n}();\n\nexports.default = Registry;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9SZWdpc3RyeS5qcz82MTZlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE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cbiAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgcmVqZWN0KCdXcm9uZyBTYW5kYm94VHlwZScpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBwMnBIYW5kbGVyO1xuICAgICAgICAgICAgICAgIGxldCBwMnBSZXF1ZXN0ZXI7XG5cbiAgICAgICAgICAgICAgICBpZiAoT2JqZWN0LmtleXMoX3RoaXMucDJwSGFuZGxlclN0dWIpLmxlbmd0aCAhPT0gMCkge1xuICAgICAgICAgICAgICAgICAgcDJwSGFuZGxlciA9IF90aGlzLnAycEhhbmRsZXJTdHViW190aGlzLnJ1bnRpbWVVUkxdLnVybDtcbiAgICAgICAgICAgICAgICAgIHAycFJlcXVlc3RlciA9IHJ1bnRpbWVVdGlscy5ydW50aW1lRGVzY3JpcHRvci5wMnBSZXF1ZXN0ZXJTdHViO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCBoeXBlcnR5ID0gbmV3IEh5cGVydHlJbnN0YW5jZShfdGhpcy5pZGVudGlmaWVyLCBfdGhpcy5yZWdpc3RyeVVSTCwgZGVzY3JpcHRvclVSTCwgZGVzY3JpcHRvcixcbiAgICAgICAgICAgICAgICAgIGFkZHJlc3NVUkwuYWRkcmVzc1swXSwgdXNlclByb2ZpbGUsICdndWlkJywgX3RoaXMucnVudGltZVVSTCwgJ2N0eCcsIHAycEhhbmRsZXIsXG4gICAgICAgICAgICAgICAgIHAycFJlcXVlc3RlciwgaHlwZXJ0eUNhcGFiaWxpdGllcy5kYXRhU2NoZW1hLCBoeXBlcnR5Q2FwYWJpbGl0aWVzLnJlc291cmNlcyk7XG5cbiAgICAgICAgICAgICAgICBfdGhpcy5oeXBlcnRpZXNMaXN0LnB1c2goaHlwZXJ0eSk7XG5cbiAgICAgICAgICAgICAgICAvKi0tLSBzdGFydCBoZXJlIG1vdmUgcDJwIGFuZCBkb21haW4gcmVnaXN0cnkgcmVs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clN0dWInKTtcbiAgICAgIH1cblxuICAgICAgbG9nLmluZm8oJ1tSZWdpc3RyeSAtIHJlZ2lzdGVyU3R1Yl0gLSBzdHViSUQgJywgc3R1YklEKTtcblxuICAgICAgLyogaWYgKCFzdHViSUQuaW5kZXhPZignbXNnLW5vZGUuJykpIHtcbiAgICAgICAgc3R1YklEID0gc3R1YklELnN1YnN0cmluZyhzdHViSUQuaW5kZXhPZignLicpICsgMSk7XG4gICAgICB9Ki9cblxuICAgICAgbGV0IFAyUFJlcXVlc3RlclN0dWI7XG5cbiAgICAgIGlmIChwMnBDb25maWcpIHtcblxuICAgICAgICBpZiAocDJwQ29uZmlnLmhhc093blByb3BlcnR5KCdpc0hhbmRsZXJTdHViJykgJiYgcDJwQ29uZmlnLmlzSGFuZGxlclN0dWIpIHtcbiAgICAgICAgICBydW50aW1lUHJvdG9TdHViVVJMID0gX3RoaXMucDJwSGFuZGxlclVSTDtcblxuICAgICAgICAgIF90aGlzLnAycEhhbmRsZXJTdHViW3N0dWJJRF0gPSB7XG4gICAgICAgICAgICB1cmw6IHJ1bnRpbWVQcm90b1N0dWJVUkwsXG4gICAgICAgICAgICBzdGF0dXM6IFNUQVRVUy5DUkVBVEVEXG4gICAgICAgICAgfTtcblxuICAgICAgICAgIF90aGlzLnAycEhhbmRsZXJBc3NvY2lhdGlvbltfdGhpcy5ydW50aW1lVVJMXSA9IFtdO1xuXG4gICAgICAgICAgX3RoaXMuc2FuZGJveGVzTGlzdC5zYW5kYm94W3J1bnRpbWVQcm90b1N0dWJVUkxdID0gc2FuZGJveDtcbiAgICAgICAgICBsb2cuaW5mbygnW1JlZ2lzdHJ5IC0gcmVnaXN0ZXJTdHViIC0gUDJQSGFuZGxlclN0dWJdIC0gJywgc3R1YklELCAnIC0gJywgcnVudGltZVByb3RvU3R1YlVSTCk7XG4gICAgICAgICAgcmVzb2x2ZShfdGhpcy5wMnBIYW5kbGVyU3R1YltzdHViSURdKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBQMlBSZXF1ZXN0ZXJTdHViID0gcDJwQ29uZmlnLnAycFJlcXVlc3RlclN0dWI7XG4gICAgICAgICAgcnVudGltZVByb3RvU3R1YlVSTCA9ICdydW50aW1lOi8vJyArIGRpdmlkZVVSTChwMnBDb25maWcucmVtb3RlUnVudGltZVVSTCkuZG9tYWluICsgJy9wMnByZXF1ZXN0ZXIvJyArIGdlbmVyYXRlR1VJRCgpO1xuICAgICAgICAgIGxvZy5pbmZvKCdbUmVnaXN0cnkgLSByZWdpc3RlclN0dWIgLSBQMlBSZXF1ZXN0ZXJTdHViXSAtICcsIFAyUFJlcXVlc3RlclN0dWIsICcgLSAnLCBydW50aW1lUHJvdG9TdHViVVJMKTtcblxuICAgICAgICAgIC8vIHRvIGJlIGNsYXJpZmllZCB3aGF0IGlzIHRoaXMgcDJwSGFuZGxlckFzc29jaWF0aW9uXG4gICAgICAgICAgX3RoaXMucDJwSGFuZGxlckFzc29jaWF0aW9uW190aGlzLnJ1bnRpbWVVUkxdLnB1c2gocnVudGltZVByb3RvU3R1YlVSTCk7XG4gICAgICAgICAgX3RoaXMucDJwUmVxdWVzdGVyU3R1YltzdHViSURdID0ge1xuICAgICAgICAgICAgdXJsOiBydW50aW1lUHJvdG9TdHViVVJMLFxuICAgICAgICAgICAgc3RhdHVzOiBTVEFUVVMuQ1JFQVRFRFxuICAgICAgICAgIH07XG5cbiAgICAgICAgICBfdGhpcy5zYW5kYm94ZXNMaXN0LnNhbmRib3hbcnVudGltZVByb3RvU3R1YlVSTF0gPSBzYW5kYm94O1xuXG4gICAgICAgICAgLy9TZXR1cCBQMlAgUmVxdWVzdGVyIHBhdGggaW50byBNTlxuXG4gICAgICAgICAgbGV0IG1zZyA9IHtcbiAgICAgICAgICAgIHR5cGU6ICdzdWJzY3JpYmUnLFxuICAgICAgICAgICAgZnJvbTogX3RoaXMucmVnaXN0cnlVUkwsXG4gICAgICAgICAgICB0bzogJ2RvbWFpbjovL21zZy1ub2RlLicgKy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ICAgICAgICBpZiAoc2FuZGJveC5pbmNsdWRlcyhkb21haW4pICYmIF90aGlzLnNhbmRib3hlc0xpc3Quc2FuZGJveFtzYW5kYm94XS5tYXRjaGVzKGNvbnN0cmFpbnRzKSkge1xuICAgICAgICAgICAgICBjb25zdCBjdXJyZW50ID0gX3RoaXMuc2FuZGJveGVzTGlzdC5zYW5kYm94W3NhbmRib3hdO1xuICAgICAgICAgICAgICBjb25zdCBtYXRjaCA9IE9iamVjdC5rZXlzKGNvbnN0cmFpbnRzKS5maWx0ZXIoY29uc3RyYWludCA9PiB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIChjb25zdHJhaW50ID09PSAnYnJvd3NlcicgJiYgY3VycmVudC50eXBlID09PSBTYW5kYm94VHlwZS5OT1JNQUwpIHx8XG4gICAgICAgICAgICAgICAgICAgICAgKGNvbnN0cmFpbnQgPT09ICd3aW5kb3dTYW5ib3gnICYmIGN1cnJlbnQudHlwZSA9PT0gU2FuZGJveFR5cGUuV0lORE9XKTtcblxuICAgICAgICAgICAgICB9KS5sZW5ndGggPiAwID8gdHJ1ZSA6IGZhbHNlO1xuXG4gICAgICAgICAgICAgIGlmIChtYXRjaCkgeyByZXF1ZXN0ID0gY3VycmVudDsgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgIH1cblxuICAgICAgaWYgKCFyZXF1ZXN0KSB7XG4gICAgICAgIHJlamVjdCgnbm8gc2FuZGJveCBmb3VuZCBmb3I6ICcgKyB1cmwpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgcmVzb2x2ZShyZXF1ZXN0KTtcbiAgICAgIH1cblxuICAgIH0pO1xuICB9XG5cbiAgcmVzb2x2ZU5vcm1hbFN0dWIodXJsKSB7XG4gICAgLy8gbG9nLmxvZygncmVzb2x2ZU5vcm1hbFN0dWIgJyArIHVybCk7XG4gICAgbGV0IF90aGlzID0gdGhpcztcblxuICAgIHJld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Wdpc3RlcmVkO1xuICAgICAgICAgICAgICBsb2cuaW5mbygnW1JlZ2lzdHJ5LnJlc29sdmVOb3JtYWxTdHViXSBkZXBsb3kgbmV3IElEUFByb3h5OiAnLCBkb21haW5VcmwpO1xuICAgICAgICAgICAgICBfdGhpcy5sb2FkZXIubG9hZElkcFByb3h5KGRvbWFpblVybCkudGhlbigoKSA9PiB7XG5cbiAgICAgICAgICAgICAgICBsb2cuaW5mbygnW1JlZ2lzdHJ5LnJlc29sdmVOb3JtYWxTdHViXSBJZFAgUHJveHkgZGVwbG95ZWQ6ICcsIF90aGlzLmlkcFByb3h5TGlzdFtkb21haW5VcmxdKTtcblxuICAgICAgICAgICAgICB9KS5jYXRjaCgocmVhc29uKSA9PiB7XG4gICAgICAgICAgICAgICAgbG9nLmVycm9yKCdbUmVnaXN0cnkucmVzb2x2ZV0gRXJyb3IgcmVzb2x2aW5nIExvYWQgSURQUHJveHk6ICcsIHJlYXNvbik7XG4gICAgICAgICAgICAgICAgX3RoaXMuaWRwUHJveHlMaXN0W2RvbWFpblVybF0uc3RhdHVzID0gJ2RlcGxveW1lbnQtZmFpbGVkJztcbiAgICAgICAgICAgICAgICByZWplY3QocmVhc29uKTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9XG5cblxuICAgICAgICAgIH0gZWxzZSB7XG5cbiAgICAgICAgICAgIC8vIFRoZSBwcm90b1N0dWIgZG9lcyBub3QgZXhpc3QsIGxldCdzIHByZXBhcmUgaXRzIGRlcGxveW1lbnQgYnkgd2F0Y2hpbmcgaXRzIHN0YXR1c1xuXG4gICAgICAgICAgICBfdGhpcy53YXRjaGluZ1lvdS5vYnNlcnZlKCdwcm90b3N0dWJzTGlzdCcsIChjaGFuZ2UpID0+IHtcblxuICAgICAgICAgICAgICAvLyBsb2cubG9nKCdbUmVnaXN0cnkgLSByZXNvbHZlTm9ybWFsU3R1Yl0gcHJvdG9zdHVic0xpc3QgY2hhbmdlZCAnICsgX3RoaXMucHJvdG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sdmVdIC0gd2FzIHJlY29ubmVjdGVkIHdpdGggcDJwUmVxdWVzdGVyU3R1YnQ6ICcsIHJldHVyblVSTCk7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZShyZXR1cm5VUkwpO1xuICAgICAgICAgICAgICB9LCAocmVhc29uKSA9PiB7XG4gICAgICAgICAgICAgICAgbG9nLmluZm8oJ1tSZWdpc3RyeSAtIFJlc29sdmVdIC0gUmVhc29uOiAnLCByZWFzb24pO1xuXG4gICAgICAgICAgICAgICAgX3RoaXMucmVzb2x2ZU5vcm1hbFN0dWIodXJsKS50aGVuKChyZXR1cm5VUkwpID0+IHtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUocmV0dXJuVVJMKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgZGVmYXVsdDpcblxuICAgICAgICAgICAgICBsb2cuaW5mbygnW1JlZ2lzdHJ5IC0gcmVzb2x2ZV0gLSBQMlA6ICcsIHAycCk7XG4gICAgICAgICAgICAgIGlmICghcDJwKSB7IC8vIG5vIHAycCBjb25uZWN0aW9uIGV4aXN0cyBhbmQgdGhlIG1lc3NhZ2Ugc2VuZGVyIGRvZXMgbm90IGFzayBvbmUuIExldHMgdXNlIHRoZSBNTiBTdHViXG4gICAgICAgICAgICAgICAgX3RoaXMucmVzb2x2ZU5vcm1hbFN0dWIodXJsKS50aGVuKChyZXR1cm5VUkwpID0+IHtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUocmV0dXJuVVJMKTtcbiAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIF90aGlzLl9zZXR1cFAyUFJlcXVlc3RlcihyZWdpc3RlcmVkUDJQKS50aGVuKChyZXR1cm5VUkwpID0+IHsgLy8gbm8gcDJwIGNvbm5lY3Rpb24gZXhpc3RzIGJ1dCB0aGUgbWVzc2FnZSBzZW5kZXIgaXMgYXNraW5nIG9uZS4gTGV0cyB0cnkgdG8gc2V0dXAgb25lXG4gICAgICAgICAgICAgICAgICByZXNvbHZlKHJldHVyblVSTCk7XG4gICAgICAgICAgICAgICAgfSwgKHJlYXNvbikgPT4ge1xuICAgICAgICAgICAgICAgICAgbG9nLmluZm8oJ1tSZWdpc3RyeSAtIFJlc29sdmVdIC0gUmVhc29uOiAnLCByZWFzb24pO1xuXG4gICAgICAgICAgICAgICAgICBfdGhpcy5yZXNvbHZlTm9ybWFsU3R1Yih1cmwpLnRoZW4oKHJldHVyblVSTCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICByZXNvbHZlKHJldHVyblVSTCk7XG4gICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICB9XG4gICAgICAgIH0sIChyZWFzb24pID0+IHtcbiAgICAgICAgICBsb2cuaW5mbygnW1JlZ2lzdHJ5IC0gUmVzb2x2ZV0gLSBSZWFzb246ICcsIHJlYXNvbik7XG5cbiAgICAgICAgICBfdGhpcy5yZXNvbHZlTm9ybWFsU3R1Yih1cmwpLnRoZW4oKHJldHVyblVSTCkgPT4ge1xuICAgICAgICAgICAgcmVzb2x2ZShyZXR1cm5VUkwpO1xuICAgICAgICAgIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH1cblxuICAgIH0pO1xuICB9XG5cbiAgX3NldHVwUDJQUmVxdWVzdGVyKGlucHV0KSB7XG4gICAgbGV0IF90aGlzID0gdGhpcztcblxuICAgIGxvZy5sb2coJ1tSZWdpc3RyeS5fc2V0dXBQMlBDb25uZWN0aW9uXSBsb2FkU3R1YiB3aXRoIHAycFJlcXVlc3RlcjogJywgaW5wdXQpO1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgbGV0IHJlbW90ZVJ1bnRpbW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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQTQ2Q0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///456\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(458), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9zeW1ib2wvaXRlcmF0b3IuanM/NjczOCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vc3ltYm9sL2l0ZXJhdG9yXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC9pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNDU3XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///457\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(80);\n__webpack_require__(101);\nmodule.exports = __webpack_require__(146).f('iterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3IuanM/ZmU3ZSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5zdHJpbmcuaXRlcmF0b3InKTtcbnJlcXVpcmUoJy4uLy4uL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZScpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL193a3MtZXh0JykuZignaXRlcmF0b3InKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ1OFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///458\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(460), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9zeW1ib2wuanM/ZTUwNSJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vc3ltYm9sXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL3N5bWJvbC5qc1xuLy8gbW9kdWxlIGlkID0gNDU5XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///459\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(461);\n__webpack_require__(192);\n__webpack_require__(466);\n__webpack_require__(467);\nmodule.exports = __webpack_require__(11).Symbol;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaW5kZXguanM/MDcwNyJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5zeW1ib2wnKTtcbnJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC50by1zdHJpbmcnKTtcbnJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM3LnN5bWJvbC5hc3luYy1pdGVyYXRvcicpO1xucmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcuc3ltYm9sLm9ic2VydmFibGUnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpLlN5bWJvbDtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9zeW1ib2wvaW5kZXguanNcbi8vIG1vZHVsZSBpZCA9IDQ2MFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///460\n")},function(module,exports,__webpack_require__){"use strict";eval("\n// ECMAScript 6 symbols shim\nvar global = __webpack_require__(21);\nvar has = __webpack_require__(62);\nvar DESCRIPTORS = __webpack_require__(51);\nvar $export = __webpack_require__(26);\nvar redefine = __webpack_require__(194);\nvar META = __webpack_require__(462).KEY;\nvar $fails = __webpack_require__(70);\nvar shared = __webpack_require__(136);\nvar setToStringTag = __webpack_require__(100);\nvar uid = __webpack_require__(98);\nvar wks = __webpack_require__(22);\nvar wksExt = __webpack_require__(146);\nvar wksDefine = __webpack_require__(147);\nvar enumKeys = __webpack_require__(463);\nvar isArray = __webpack_require__(464);\nvar anObject = __webpack_require__(41);\nvar isObject = __webpack_require__(46);\nvar toIObject = __webpack_require__(50);\nvar toPrimitive = __webpack_require__(140);\nvar createDesc = __webpack_require__(79);\nvar _create = __webpack_require__(141);\nvar gOPNExt = __webpack_require__(465);\nvar $GOPD = __webpack_require__(148);\nvar $DP = __webpack_require__(45);\nvar $keys = __webpack_require__(68);\nvar gOPD = $GOPD.f;\nvar dP = $DP.f;\nvar gOPN = gOPNExt.f;\nvar $Symbol = global.Symbol;\nvar $JSON = global.JSON;\nvar _stringify = $JSON && $JSON.stringify;\nvar PROTOTYPE = 'prototype';\nvar HIDDEN = wks('_hidden');\nvar TO_PRIMITIVE = wks('toPrimitive');\nvar isEnum = {}.propertyIsEnumerable;\nvar SymbolRegistry = shared('symbol-registry');\nvar AllSymbols = shared('symbols');\nvar OPSymbols = shared('op-symbols');\nvar ObjectProto = Object[PROTOTYPE];\nvar USE_NATIVE = typeof $Symbol == 'function';\nvar QObject = global.QObject;\n// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173\nvar setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;\n\n// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687\nvar setSymbolDesc = DESCRIPTORS && $fails(function () {\n return _create(dP({}, 'a', {\n get: function () { return dP(this, 'a', { value: 7 }).a; }\n })).a != 7;\n}) ? function (it, key, D) {\n var protoDesc = gOPD(ObjectProto, key);\n if (protoDesc) delete ObjectProto[key];\n dP(it, key, D);\n if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);\n} : dP;\n\nvar wrap = function (tag) {\n var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);\n sym._k = tag;\n return sym;\n};\n\nvar isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {\n return typeof it == 'symbol';\n} : function (it) {\n return it instanceof $Symbol;\n};\n\nvar $defineProperty = function defineProperty(it, key, D) {\n if (it === ObjectProto) $defineProperty(OPSymbols, key, D);\n anObject(it);\n key = toPrimitive(key, true);\n anObject(D);\n if (has(AllSymbols, key)) {\n if (!D.enumerable) {\n if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));\n it[HIDDEN][key] = true;\n } else {\n if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;\n D = _create(D, { enumerable: createDesc(0, false) });\n } return setSymbolDesc(it, key, D);\n } return dP(it, key, D);\n};\nvar $defineProperties = function defineProperties(it, P) {\n anObject(it);\n var keys = enumKeys(P = toIObject(P));\n var i = 0;\n var l = keys.length;\n var key;\n while (l > i) $defineProperty(it, key = keys[i++], P[key]);\n return it;\n};\nvar $create = function create(it, P) {\n return P === undefined ? _create(it) : $defineProperties(_create(it), P);\n};\nvar $propertyIsEnumerable = function propertyIsEnumerable(key) {\n var E = isEnum.call(this, key = toPrimitive(key, true));\n if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;\n return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;\n};\nvar $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {\n it = toIObject(it);\n key = toPrimitive(key, true);\n if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;\n var D = gOPD(it, key);\n if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;\n return D;\n};\nvar $getOwnPropertyNames = function getOwnPropertyNames(it) {\n var names = gOPN(toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);\n } return result;\n};\nvar $getOwnPropertySymbols = function getOwnPropertySymbols(it) {\n var IS_OP = it === ObjectProto;\n var names = gOPN(IS_OP ? OPSymbols : toIObject(it));\n var result = [];\n var i = 0;\n var key;\n while (names.length > i) {\n if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);\n } return result;\n};\n\n// 19.4.1.1 Symbol([description])\nif (!USE_NATIVE) {\n $Symbol = function Symbol() {\n if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');\n var tag = uid(arguments.length > 0 ? arguments[0] : undefined);\n var $set = function (value) {\n if (this === ObjectProto) $set.call(OPSymbols, value);\n if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;\n setSymbolDesc(this, tag, createDesc(1, value));\n };\n if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });\n return wrap(tag);\n };\n redefine($Symbol[PROTOTYPE], 'toString', function toString() {\n return this._k;\n });\n\n $GOPD.f = $getOwnPropertyDescriptor;\n $DP.f = $defineProperty;\n __webpack_require__(205).f = gOPNExt.f = $getOwnPropertyNames;\n __webpack_require__(81).f = $propertyIsEnumerable;\n __webpack_require__(145).f = $getOwnPropertySymbols;\n\n if (DESCRIPTORS && !__webpack_require__(78)) {\n redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);\n }\n\n wksExt.f = function (name) {\n return wrap(wks(name));\n };\n}\n\n$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });\n\nfor (var es6Symbols = (\n // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14\n 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'\n).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);\n\nfor (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);\n\n$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {\n // 19.4.2.1 Symbol.for(key)\n 'for': function (key) {\n return has(SymbolRegistry, key += '')\n ? SymbolRegistry[key]\n : SymbolRegistry[key] = $Symbol(key);\n },\n // 19.4.2.5 Symbol.keyFor(sym)\n keyFor: function keyFor(sym) {\n if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');\n for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;\n },\n useSetter: function () { setter = true; },\n useSimple: function () { setter = false; }\n});\n\n$export($export.S + $export.F * !USE_NATIVE, 'Object', {\n // 19.1.2.2 Object.create(O [, Properties])\n create: $create,\n // 19.1.2.4 Object.defineProperty(O, P, Attributes)\n defineProperty: $defineProperty,\n // 19.1.2.3 Object.defineProperties(O, Properties)\n defineProperties: $defineProperties,\n // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\n getOwnPropertyDescriptor: $getOwnPropertyDescriptor,\n // 19.1.2.7 Object.getOwnPropertyNames(O)\n getOwnPropertyNames: $getOwnPropertyNames,\n // 19.1.2.8 Object.getOwnPropertySymbols(O)\n getOwnPropertySymbols: $getOwnPropertySymbols\n});\n\n// 24.3.2 JSON.stringify(value [, replacer [, space]])\n$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {\n var S = $Symbol();\n // MS Edge converts symbol values to JSON as {}\n // WebKit converts symbol values to JSON as null\n // V8 throws on boxed symbols\n return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';\n})), 'JSON', {\n stringify: function stringify(it) {\n var args = [it];\n var i = 1;\n var replacer, $replacer;\n while (arguments.length > i) args.push(arguments[i++]);\n $replacer = replacer = args[1];\n if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined\n if (!isArray(replacer)) replacer = function (key, value) {\n if (typeof $replacer == 'function') value = $replacer.call(this, key, value);\n if (!isSymbol(value)) return value;\n };\n args[1] = replacer;\n return _stringify.apply($JSON, args);\n }\n});\n\n// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)\n$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(63)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);\n// 19.4.3.5 Symbol.prototype[@@toStringTag]\nsetToStringTag($Symbol, 'Symbol');\n// 20.2.1.9 Math[@@toStringTag]\nsetToStringTag(Math, 'Math', true);\n// 24.3.3 JSON[@@toStringTag]\nsetToStringTag(global.JSON, 'JSON', true);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5zeW1ib2wuanM/N2Q2NyJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG4vLyBFQ01BU2NyaXB0IDYgc3ltYm9scyBzaGltXG52YXIgZ2xvYmFsID0gcmVxdWlyZSgnLi9fZ2xvYmFsJyk7XG52YXIgaGFzID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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///461\n")},function(module,exports,__webpack_require__){eval("var META = __webpack_require__(98)('meta');\nvar isObject = __webpack_require__(46);\nvar has = __webpack_require__(62);\nvar setDesc = __webpack_require__(45).f;\nvar id = 0;\nvar isExtensible = Object.isExtensible || function () {\n return true;\n};\nvar FREEZE = !__webpack_require__(70)(function () {\n return isExtensible(Object.preventExtensions({}));\n});\nvar setMeta = function (it) {\n setDesc(it, META, { value: {\n i: 'O' + ++id, // object ID\n w: {} // weak collections IDs\n } });\n};\nvar fastKey = function (it, create) {\n // return primitive with prefix\n if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return 'F';\n // not necessary to add metadata\n if (!create) return 'E';\n // add missing metadata\n setMeta(it);\n // return object ID\n } return it[META].i;\n};\nvar getWeak = function (it, create) {\n if (!has(it, META)) {\n // can't set metadata to uncaught frozen object\n if (!isExtensible(it)) return true;\n // not necessary to add metadata\n if (!create) return false;\n // add missing metadata\n setMeta(it);\n // return hash weak collections IDs\n } return it[META].w;\n};\n// add metadata on freeze-family methods calling\nvar onFreeze = function (it) {\n if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);\n return it;\n};\nvar meta = module.exports = {\n KEY: META,\n NEED: false,\n fastKey: fastKey,\n getWeak: getWeak,\n onFreeze: onFreeze\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19tZXRhLmpzP2QzYTMiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIE1FVEEgPSByZXF1aXJlKCcuL191aWQnKSgnbWV0YScpO1xudmFyIGlzT2JqZWN0ID0gcmVxdWlyZSgnLi9faXMtb2JqZWN0Jyk7XG52YXIgaGFzID0gcmVxdWlyZSgnLi9faGFzJyk7XG52YXIgc2V0RGVzYyA9IHJlcXVpcmUoJy4vX29iamVjdC1kcCcpLmY7XG52YXIgaWQgPSAwO1xudmFyIG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Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///462\n")},function(module,exports,__webpack_require__){eval("// all enumerable object keys, includes symbols\nvar getKeys = __webpack_require__(68);\nvar gOPS = __webpack_require__(145);\nvar pIE = __webpack_require__(81);\nmodule.exports = function (it) {\n var result = getKeys(it);\n var getSymbols = gOPS.f;\n if (getSymbols) {\n var symbols = getSymbols(it);\n var isEnum = pIE.f;\n var i = 0;\n var key;\n while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);\n } return result;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19lbnVtLWtleXMuanM/NWRjZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBhbGwgZW51bWVyYWJsZSBvYmplY3Qga2V5cywgaW5jbHVkZXMgc3ltYm9sc1xudmFyIGdldEtleXMgPSByZXF1aXJlKCcuL19vYmplY3Qta2V5cycpO1xudmFyIGdPUFMgPSByZXF1aXJlKCcuL19vYmplY3QtZ29wcycpO1xudmFyIHBJRSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKTtcbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24gKGl0KSB7XG4gIHZhciByZXN1bHQgPSBnZXRLZXlzKGl0KTtcbiAgdmFyIGdldFN5bWJvbHMgPSBnT1BTLmY7XG4gIGlmIChnZXRTeW1ib2xzKSB7XG4gICAgdmFyIHN5bWJvbHMgPSBnZXRTeW1ib2xzKGl0KTtcbiAgICB2YXIgaXNFbnVtID0gcElFLmY7XG4gICAgdmFyIGkgPSAwO1xuICAgIHZhciBrZXk7XG4gICAgd2hpbGUgKHN5bWJvbHMubGVuZ3RoID4gaSkgaWYgKGlzRW51bS5jYWxsKGl0LCBrZXkgPSBzeW1ib2xzW2krK10pKSByZXN1bHQucHVzaChrZXkpO1xuICB9IHJldHVybiByZXN1bHQ7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2VudW0ta2V5cy5qc1xuLy8gbW9kdWxlIGlkID0gNDYzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///463\n")},function(module,exports,__webpack_require__){eval("// 7.2.2 IsArray(argument)\nvar cof = __webpack_require__(77);\nmodule.exports = Array.isArray || function isArray(arg) {\n return cof(arg) == 'Array';\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1hcnJheS5qcz9lZDQzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDcuMi4yIElzQXJyYXkoYXJndW1lbnQpXG52YXIgY29mID0gcmVxdWlyZSgnLi9fY29mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IEFycmF5LmlzQXJyYXkgfHwgZnVuY3Rpb24gaXNBcnJheShhcmcpIHtcbiAgcmV0dXJuIGNvZihhcmcpID09ICdBcnJheSc7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX2lzLWFycmF5LmpzXG4vLyBtb2R1bGUgaWQgPSA0NjRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///464\n")},function(module,exports,__webpack_require__){eval("// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window\nvar toIObject = __webpack_require__(50);\nvar gOPN = __webpack_require__(205).f;\nvar toString = {}.toString;\n\nvar windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames\n ? Object.getOwnPropertyNames(window) : [];\n\nvar getWindowNames = function (it) {\n try {\n return gOPN(it);\n } catch (e) {\n return windowNames.slice();\n }\n};\n\nmodule.exports.f = function getOwnPropertyNames(it) {\n return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtZ29wbi1leHQuanM/NDZiNyJdLCJzb3VyY2VzQ29udGVudCI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BQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///465\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(147)('asyncIterator');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanM/Mzk4OSJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuL193a3MtZGVmaW5lJykoJ2FzeW5jSXRlcmF0b3InKTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wuYXN5bmMtaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ2NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///466\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(147)('observable');\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5zeW1ib2wub2JzZXJ2YWJsZS5qcz80MTY3Il0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4vX3drcy1kZWZpbmUnKSgnb2JzZXJ2YWJsZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM3LnN5bWJvbC5vYnNlcnZhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA0Njdcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///467\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SandboxType = undefined;\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _SandboxRegistry = __webpack_require__(478);\n\nvar _SandboxRegistry2 = _interopRequireDefault(_SandboxRegistry);\n\nvar _MiniBus2 = __webpack_require__(506);\n\nvar _MiniBus3 = _interopRequireDefault(_MiniBus2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\nvar SandboxType = exports.SandboxType = { APP: 'app', NORMAL: 'normal', WINDOW: 'window' };\n\n/**\n * @author micaelpedrosa@gmail.com\n * Base class to implement external sandbox component\n */\n\nvar Sandbox = function (_MiniBus) {\n (0, _inherits3.default)(Sandbox, _MiniBus);\n\n function Sandbox(capabilities) {\n (0, _classCallCheck3.default)(this, Sandbox);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (Sandbox.__proto__ || (0, _getPrototypeOf2.default)(Sandbox)).call(this));\n\n var _this = _this2;\n\n if (capabilities) {\n _this.capabilities = capabilities;\n }\n\n return _this2;\n }\n\n /**\n * Deploy an instance of the component into the sandbox.\n * @param {string} componentSourceCode Component source code (Hyperty, ProtoStub, etc)\n * @param {URL} componentURL Hyperty, ProtoStub, or any other component address.\n * @param {Config} configuration Config parameters of the component\n * @return {Promise} return deployed if successful, or any other string with an error\n */\n\n\n (0, _createClass3.default)(Sandbox, [{\n key: 'deployComponent',\n value: function deployComponent(componentSourceCode, componentURL, configuration) {\n\n var _this = this;\n\n // let messageFactory = _this.messageFactory;\n\n return new _promise2.default(function (resolve, reject) {\n //FLOW-OUT: deploy message for the internal SandboxRegistry -> _onDeploy\n var deployMessage = {\n type: 'create', from: _SandboxRegistry2.default.ExternalDeployAddress, to: _SandboxRegistry2.default.InternalDeployAddress,\n body: { url: componentURL, sourceCode: componentSourceCode, config: configuration }\n };\n\n //send message into the sandbox internals and wait for reply\n _this.postMessage(deployMessage, function (reply) {\n if (reply.body.code === 200) {\n //is this response complaint with the spec?\n resolve('deployed');\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n\n /**\n * Remove the instance of a previously deployed component.\n * @param {URL} componentURL Hyperty, ProtoStub, or any other component address.\n * @return {Promise} return undeployed if successful, or any other string with an error\n */\n\n }, {\n key: 'removeComponent',\n value: function removeComponent(componentURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //FLOW-OUT: un-deploy message for the internal SandboxRegistry -> _onRemove\n var removeMessage = {\n type: 'delete', from: _SandboxRegistry2.default.ExternalDeployAddress, to: _SandboxRegistry2.default.InternalDeployAddress,\n body: { url: componentURL }\n };\n\n //send message into the sandbox internals and wait for reply\n _this.postMessage(removeMessage, function (reply) {\n if (reply.body.code === 200) {\n //is this response complaint with the spec?\n resolve('undeployed');\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n\n /**\n * Matches Sandbox capabilities against provided capabilities. Used to check if sandbox provides all required capabilities\n * @param {RuntimeCapabilities} constraints set of RuntimeCapabilities to match with.\n * @return {boolean} return true if constraints are matched false otherwise\n */\n\n }, {\n key: 'matches',\n value: function matches(constraints) {\n var _this = this;\n\n var filtered = (0, _keys2.default)(constraints).filter(function (key) {\n return !(_this.capabilities[key] && _this.capabilities[key] === constraints[key]);\n });\n\n if (filtered.length === 0) {\n return true;\n } else {\n return !constraints[filtered];\n }\n }\n }]);\n return Sandbox;\n}(_MiniBus3.default);\n\nexports.default = Sandbox;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zYW5kYm94L1NhbmRib3guanM/MGEzMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ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0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQUE7QUFBQTtBQUNBOzs7QUF0RkE7QUFDQTtBQXlGQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///468\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(470);\nmodule.exports = __webpack_require__(11).Object.getPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDY5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LXByb3RvdHlwZS1vZi5qcz83ZDJlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3QuZ2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L2dldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDQ2OVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///469\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.9 Object.getPrototypeOf(O)\nvar toObject = __webpack_require__(76);\nvar $getPrototypeOf = __webpack_require__(196);\n\n__webpack_require__(138)('getPrototypeOf', function () {\n return function getPrototypeOf(it) {\n return $getPrototypeOf(toObject(it));\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qcz8yYTFlIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMi45IE9iamVjdC5nZXRQcm90b3R5cGVPZihPKVxudmFyIHRvT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8tb2JqZWN0Jyk7XG52YXIgJGdldFByb3RvdHlwZU9mID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdwbycpO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldFByb3RvdHlwZU9mJywgZnVuY3Rpb24gKCkge1xuICByZXR1cm4gZnVuY3Rpb24gZ2V0UHJvdG90eXBlT2YoaXQpIHtcbiAgICByZXR1cm4gJGdldFByb3RvdHlwZU9mKHRvT2JqZWN0KGl0KSk7XG4gIH07XG59KTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDcwXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///470\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(472), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz85MjIwIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZlwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qc1xuLy8gbW9kdWxlIGlkID0gNDcxXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///471\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(473);\nmodule.exports = __webpack_require__(11).Object.setPrototypeOf;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDcyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3Qvc2V0LXByb3RvdHlwZS1vZi5qcz84YmYwIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm9iamVjdC5zZXQtcHJvdG90eXBlLW9mJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5PYmplY3Quc2V0UHJvdG90eXBlT2Y7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vb2JqZWN0L3NldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDQ3MlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///472\n")},function(module,exports,__webpack_require__){eval("// 19.1.3.19 Object.setPrototypeOf(O, proto)\nvar $export = __webpack_require__(26);\n$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(474).set });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDczLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3Quc2V0LXByb3RvdHlwZS1vZi5qcz83YjE4Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDE5LjEuMy4xOSBPYmplY3Quc2V0UHJvdG90eXBlT2YoTywgcHJvdG8pXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IHNldFByb3RvdHlwZU9mOiByZXF1aXJlKCcuL19zZXQtcHJvdG8nKS5zZXQgfSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczYub2JqZWN0LnNldC1wcm90b3R5cGUtb2YuanNcbi8vIG1vZHVsZSBpZCA9IDQ3M1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///473\n")},function(module,exports,__webpack_require__){eval("// Works with __proto__ only. Old v8 can't work with null proto objects.\n/* eslint-disable no-proto */\nvar isObject = __webpack_require__(46);\nvar anObject = __webpack_require__(41);\nvar check = function (O, proto) {\n anObject(O);\n if (!isObject(proto) && proto !== null) throw TypeError(proto + \": can't set as prototype!\");\n};\nmodule.exports = {\n set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line\n function (test, buggy, set) {\n try {\n set = __webpack_require__(69)(Function.call, __webpack_require__(148).f(Object.prototype, '__proto__').set, 2);\n set(test, []);\n buggy = !(test instanceof Array);\n } catch (e) { buggy = true; }\n return function setPrototypeOf(O, proto) {\n check(O, proto);\n if (buggy) O.__proto__ = proto;\n else set(O, proto);\n return O;\n };\n }({}, false) : undefined),\n check: check\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19zZXQtcHJvdG8uanM/NjVhNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBXb3JrcyB3aXRoIF9fcHJvdG9fXyBvbmx5LiBPbGQgdjggY2FuJ3Qgd29yayB3aXRoIG51bGwgcHJvdG8gb2JqZWN0cy5cbi8qIGVzbGludC1kaXNhYmxlIG5vLXByb3RvICovXG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBhbk9iamVjdCA9IHJlcXVpcmUoJy4vX2FuLW9iamVjdCcpO1xudmFyIGNoZWNrID0gZnVuY3Rpb24gKE8sIHByb3RvKSB7XG4gIGFuT2JqZWN0KE8pO1xuICBpZiAoIWlzT2JqZWN0KHByb3RvKSAmJiBwcm90byAhPT0gbnVsbCkgdGhyb3cg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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///474\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(476), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvY3JlYXRlLmpzPzNhZjQiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGVcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2NyZWF0ZS5qc1xuLy8gbW9kdWxlIGlkID0gNDc1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///475\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(477);\nvar $Object = __webpack_require__(11).Object;\nmodule.exports = function create(P, D) {\n return $Object.create(P, D);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvY3JlYXRlLmpzP2EwY2UiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmNyZWF0ZScpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBjcmVhdGUoUCwgRCkge1xuICByZXR1cm4gJE9iamVjdC5jcmVhdGUoUCwgRCk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDQ3NlxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///476\n")},function(module,exports,__webpack_require__){eval("var $export = __webpack_require__(26);\n// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\n$export($export.S, 'Object', { create: __webpack_require__(141) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuY3JlYXRlLmpzP2IwNWYiXSwic291cmNlc0NvbnRlbnQiOlsidmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbi8vIDE5LjEuMi4yIC8gMTUuMi4zLjUgT2JqZWN0LmNyZWF0ZShPIFssIFByb3BlcnRpZXNdKVxuJGV4cG9ydCgkZXhwb3J0LlMsICdPYmplY3QnLCB7IGNyZWF0ZTogcmVxdWlyZSgnLi9fb2JqZWN0LWNyZWF0ZScpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5jcmVhdGUuanNcbi8vIG1vZHVsZSBpZCA9IDQ3N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///477\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _SandboxFactory = __webpack_require__(479);\n\nvar _SandboxFactory2 = _interopRequireDefault(_SandboxFactory);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @author micaelpedrosa@gmail.com\n * Internal component registry of all sandboxes.\n * Process internal request's for component deploy.\n */\nvar SandboxRegistry = function () {\n /* private\n _components: \n */\n\n function SandboxRegistry(bus) {\n (0, _classCallCheck3.default)(this, SandboxRegistry);\n\n var _this = this;\n\n _this._bus = bus;\n _this._factory = new _SandboxFactory2.default(bus);\n _this._components = {};\n\n bus.addListener(SandboxRegistry.InternalDeployAddress, function (msg) {\n console.log('SandboxRegistry-RCV: ', msg);\n // let responseMsg = {\n // id: msg.id, type: 'response', from: SandboxRegistry.InternalDeployAddress, to: SandboxRegistry.ExternalDeployAddress\n // };\n\n switch (msg.type) {\n case 'create':\n _this._onDeploy(msg);break;\n case 'delete':\n _this._onRemove(msg);break;\n }\n });\n }\n\n (0, _createClass3.default)(SandboxRegistry, [{\n key: '_responseMsg',\n value: function _responseMsg(msg, code, value) {\n\n var _this = this;\n\n // let messageFactory = _this.messageFactory;\n\n //FLOW-OUT: generic response message to external Sandbox (deploy and un-deploy responses)\n var responseMsg = {\n id: msg.id, type: 'response', from: SandboxRegistry.InternalDeployAddress, to: SandboxRegistry.ExternalDeployAddress\n };\n\n // Chanege the origin message, because the response;\n // msg.from = SandboxRegistry.InternalDeployAddress;\n // msg.to = SandboxRegistry.ExternalDeployAddress;\n\n var body = {};\n if (code) body.code = code;\n if (value) body.desc = value;\n\n responseMsg.body = body;\n\n // return messageFactory.createResponse(msg, code, value);\n return responseMsg;\n }\n\n //FLOW-IN: message from the runtime core Sandbox -> deployComponent\n\n }, {\n key: '_onDeploy',\n value: function _onDeploy(msg) {\n var _this = this;\n var config = msg.body.config;\n var componentURL = msg.body.url;\n var sourceCode = msg.body.sourceCode;\n var responseCode = void 0;\n var responseDesc = void 0;\n\n if (!_this._components.hasOwnProperty(componentURL)) {\n try {\n console.log('SandboxRegistry-onDeploy: ', msg);\n _this._components[componentURL] = _this._create(componentURL, sourceCode, config, _this._factory);\n responseCode = 200;\n } catch (error) {\n responseCode = 500;\n responseDesc = error;\n }\n } else {\n responseCode = 500;\n responseDesc = 'Instance ' + componentURL + ' already exist!';\n }\n\n var responseMsg = _this._responseMsg(msg, responseCode, responseDesc);\n _this._bus.postMessage(responseMsg);\n }\n\n //FLOW-IN: message from the runtime core Sandbox -> removeComponent\n\n }, {\n key: '_onRemove',\n value: function _onRemove(msg) {\n var _this = this;\n var componentURL = msg.body.url;\n var responseCode = void 0;\n var responseDesc = void 0;\n\n if (_this._components.hasOwnProperty(componentURL)) {\n //remove component from the pool and all listeners\n delete _this._components[componentURL];\n _this._bus.removeAllListenersOf(componentURL);\n responseCode = 200;\n } else {\n responseCode = 500;\n responseDesc = 'Instance ' + componentURL + ' doesn\\'t exist!';\n }\n\n var responseMsg = _this._responseMsg(msg, responseCode, responseDesc);\n\n _this._bus.postMessage(responseMsg);\n }\n\n /**\n * This method should be implemented by the internal sandbox code.\n * @param {ComponentURL} url URL used for the instance\n * @param {string} sourceCode Code of the component\n * @param {Config} config Configuration parameters\n * @return {Object} Returns instance of the component or throw an error \"throw 'error message'\"\n */\n\n }, {\n key: '_create',\n value: function _create(url, sourceCode, config, factory) {\n //implementation specific\n /* example code:\n eval(sourceCode);\n return activate(url, _this._bus, config);\n */\n }\n }, {\n key: 'components',\n get: function get() {\n return this._components;\n }\n }]);\n return SandboxRegistry;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n/**\n * @author micaelpedrosa@gmail.com\n * Base class to implement internal deploy manager of components.\n */\n\n\nSandboxRegistry.ExternalDeployAddress = 'hyperty-runtime://sandbox/external';\nSandboxRegistry.InternalDeployAddress = 'hyperty-runtime://sandbox/internal';\n\nexports.default = SandboxRegistry;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDc4LmpzIiwic291cmNlcyI6WyJ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QUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7Ozs7O0FBT0E7QUFDQTtBQUNBOzs7O0FBSUE7OztBQXpGQTtBQUFBO0FBQUE7OztBQTFEQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXNCQTs7Ozs7O0FBZ0lBO0FBQ0E7QUFDQTtBQUNBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///478\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Syncher = __webpack_require__(480);\n\nvar _Syncher2 = _interopRequireDefault(_Syncher);\n\nvar _NotificationHandler = __webpack_require__(493);\n\nvar _NotificationHandler2 = _interopRequireDefault(_NotificationHandler);\n\nvar _utils = __webpack_require__(6);\n\nvar _IdentityManager = __webpack_require__(494);\n\nvar _IdentityManager2 = _interopRequireDefault(_IdentityManager);\n\nvar _Discovery = __webpack_require__(495);\n\nvar _Discovery2 = _interopRequireDefault(_Discovery);\n\nvar _RegistrationStatus = __webpack_require__(150);\n\nvar _RegistrationStatus2 = _interopRequireDefault(_RegistrationStatus);\n\nvar _Search = __webpack_require__(497);\n\nvar _Search2 = _interopRequireDefault(_Search);\n\nvar _ContextObserver = __webpack_require__(498);\n\nvar _ContextObserver2 = _interopRequireDefault(_ContextObserver);\n\nvar _ContextReporter = __webpack_require__(499);\n\nvar _ContextReporter2 = _interopRequireDefault(_ContextReporter);\n\nvar _MessageBodyIdentity = __webpack_require__(500);\n\nvar _MessageBodyIdentity2 = _interopRequireDefault(_MessageBodyIdentity);\n\nvar _ChatManager = __webpack_require__(502);\n\nvar _ChatManager2 = _interopRequireDefault(_ChatManager);\n\nvar _ChatController = __webpack_require__(211);\n\nvar _ChatController2 = _interopRequireDefault(_ChatController);\n\nvar _SimpleChatManager = __webpack_require__(505);\n\nvar _SimpleChatManager2 = _interopRequireDefault(_SimpleChatManager);\n\nvar _Chat = __webpack_require__(213);\n\nvar _Chat2 = _interopRequireDefault(_Chat);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Internal component to instantiate framework functionalities.\n */\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\nvar SandboxFactory = function () {\n /* private\n _components: \n */\n\n function SandboxFactory(bus) {\n (0, _classCallCheck3.default)(this, SandboxFactory);\n\n var _this = this;\n _this._bus = bus;\n _this._divideURL = _utils.divideURL;\n }\n\n (0, _createClass3.default)(SandboxFactory, [{\n key: 'createSyncher',\n value: function createSyncher(owner, bus, config) {\n return new _Syncher2.default(owner, bus, config);\n }\n }, {\n key: 'createIdentityManager',\n value: function createIdentityManager(hypertyURL, runtimeURL, bus) {\n var _this = this;\n return new _IdentityManager2.default(hypertyURL, runtimeURL, bus);\n }\n }, {\n key: 'createDiscovery',\n value: function createDiscovery(hypertyURL, runtimeURL, bus) {\n var _this = this;\n return new _Discovery2.default(hypertyURL, runtimeURL, bus);\n }\n }, {\n key: 'createSearch',\n value: function createSearch(discovery, identityManager) {\n var _this = this;\n return new _Search2.default(discovery, identityManager);\n }\n }, {\n key: 'createContextObserver',\n value: function createContextObserver(hypertyURL, bus, config, schemes) {\n return new _ContextObserver2.default(hypertyURL, bus, config, schemes, this);\n }\n }, {\n key: 'createContextReporter',\n value: function createContextReporter(hypertyURL, bus, config) {\n var _this = this;\n return new _ContextReporter2.default(hypertyURL, bus, config, this);\n }\n }, {\n key: 'createNotificationHandler',\n value: function createNotificationHandler(bus) {\n var _this = this;\n return new _NotificationHandler2.default(bus);\n }\n }, {\n key: 'createMessageBodyIdentity',\n value: function createMessageBodyIdentity(username, userURL, picture, name, locale, idp, assertion, profile) {\n return new _MessageBodyIdentity2.default(username, userURL, picture, name, locale, idp, assertion, profile);\n }\n }, {\n key: 'createChatManager',\n value: function createChatManager(hypertyURL, bus, configuration, syncher) {\n return new _ChatManager2.default(hypertyURL, bus, configuration, syncher, this);\n }\n }, {\n key: 'createChatController',\n value: function createChatController(syncher, discovery, domain, search, identity, manager) {\n return new _ChatController2.default(syncher, discovery, domain, search, identity, manager);\n }\n }, {\n key: 'createSimpleChatManager',\n value: function createSimpleChatManager(hypertyURL, bus, configuration, syncher) {\n return new _SimpleChatManager2.default(hypertyURL, bus, configuration, syncher, this);\n }\n }, {\n key: 'createChat',\n value: function createChat(syncher, domain, identity, manager) {\n return new _Chat2.default(syncher, domain, identity, manager);\n }\n }, {\n key: 'createRegistrationStatus',\n value: function createRegistrationStatus(observer, runtimeURL, chatUrl, bus) {\n return new _RegistrationStatus2.default(observer, runtimeURL, chatUrl, bus);\n }\n }, {\n key: 'divideURL',\n get: function get() {\n return this._divideURL;\n }\n }]);\n return SandboxFactory;\n}();\n\nexports.default = SandboxFactory;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-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G5cblxuXG59XG5cblxuZXhwb3J0IGRlZmF1bHQgU2FuZGJveEZhY3Rvcnk7XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3NhbmRib3gvU2FuZGJveEZhY3RvcnkuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7O0FBc0JBO0FBQ0E7OztBQUFBO0FBQ0E7OztBQUFBO0FBQ0E7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7QUFBQTtBQUNBOzs7OztBQUNBOzs7QUFyQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF3Q0E7QUFDQTs7OztBQUlBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFLQTtBQUNBO0FBRUE7OztBQVBBO0FBQ0E7QUFDQTs7Ozs7QUFZQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///479\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DataObjectReporter = __webpack_require__(482);\n\nvar _DataObjectReporter2 = _interopRequireDefault(_DataObjectReporter);\n\nvar _DataObjectObserver = __webpack_require__(491);\n\nvar _DataObjectObserver2 = _interopRequireDefault(_DataObjectObserver);\n\nvar _DataProvisional = __webpack_require__(492);\n\nvar _DataProvisional2 = _interopRequireDefault(_DataProvisional);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Syncher'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* The main class for the syncher package.\n* The Syncher is a singleton class per Hyperty/URL and it is the owner of all created Data Sync Objects according to the Reporter - Observer pattern.\n* Main functionality is to create reporters and to subscribe to existing ones.\n*/\nvar Syncher = function () {\n /* private\n _owner: URL\n _bus: MiniBus\n _subURL: URL\n _reporters: \n _observers: \n _provisionals: \n ----event handlers----\n _onNotificationHandler: (event) => void\n _onResume: (event) => void\n */\n\n /**\n * Constructor that should be used by the Hyperty owner\n * @param {HypertyURL} owner - Hyperty URL owner. An URL allocated by the runtime that uniquely identifies the Hyperty.\n * @param {MiniBus} bus - An instance of the MiniBus provided in the sandbox. When an object (Reporter or Observed) is created, the SyncherManager will add a listener in the MiniBus to receive/send Messages of that object.\n * @param {JSON} config - Configuration data. The only required field for now is the runtimeURL.\n */\n function Syncher(owner, bus, config) {\n (0, _classCallCheck3.default)(this, Syncher);\n\n var _this = this;\n\n _this._owner = owner;\n _this._bus = bus;\n\n _this._subURL = config.runtimeURL + '/sm';\n _this._runtimeUrl = config.runtimeURL;\n\n _this._p2pHandler = config.p2pHandler;\n _this._p2pRequester = config.p2pRequester;\n\n _this._reporters = {};\n _this._observers = {};\n _this._provisionals = {};\n\n bus.addListener(owner, function (msg) {\n //ignore msg sent by himself\n if (msg.from !== owner) {\n log.info('[Syncher] Syncher-RCV: ', msg, _this);\n switch (msg.type) {\n case 'forward':\n _this._onForward(msg);break;\n case 'create':\n _this._onRemoteCreate(msg);break;\n case 'delete':\n _this._onRemoteDelete(msg);break;\n case 'execute':\n _this._onExecute(msg);break;\n }\n }\n });\n }\n\n /**\n * The owner of the Syncher and all created reporters.\n * @type {HypertyURL}\n */\n\n\n (0, _createClass3.default)(Syncher, [{\n key: 'create',\n\n\n /**\n * Request a DataObjectReporter creation. The URL will be be requested by the allocation mechanism.\n * @param {SchemaURL} schema - Hyperty Catalogue URL address that can be used to retrieve the JSON-Schema describing the Data Object schema\n * @param {HypertyURL[]} observers - List of hyperties that are pre-authorized for subscription\n * @param {JSON} initialData - Initial data of the reporter\n * @param {boolean} store - (Optional) if true, object will be stored by the runtime\n * @param {boolean} p2p - (Optional) if true, data synchronisation stream will use p2p connection as much as possible\n * @param {string} name - (Optional) the name of the dataobject\n * @param {MessageBodyIdentity} identity - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @param {SyncMetadata} input - (optional) all metadata required to sunc the Data Object.\n * @return {Promise} Return Promise to a new Reporter. The reporter can be accepted or rejected by the PEP\n */\n value: function create(schema, observers, initialData) {\n var store = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var p2p = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n var name = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'no name';\n var identity = arguments[6];\n var input = arguments[7];\n\n\n if (!schema) throw Error('[Syncher - Create] - You need specify the data object schema');\n if (!observers) throw Error('[Syncher - Create] -The observers should be defined');\n\n var _this = this;\n input = input || {};\n var createInput = (0, _assign2.default)({}, input);\n\n createInput.p2p = p2p;\n createInput.store = store;\n createInput.schema = schema;\n createInput.authorise = observers;\n createInput.p2pHandler = _this._p2pHandler;\n createInput.p2pRequester = _this._p2pRequester;\n initialData ? createInput.data = (0, _utils.deepClone)(initialData) : createInput.data = {};\n createInput.name = name.length === 0 ? 'no name' : name;\n createInput.reporter = input.hasOwnProperty('reporter') && typeof input.reporter !== 'boolean' ? input.reporter : _this._owner;\n createInput.resume = false;\n if (input) {\n createInput.mutual = input.hasOwnProperty('mutual') ? input.mutual : false;\n createInput.name = input.hasOwnProperty('name') ? input.name : createInput.name;\n } else {\n createInput.mutual = false;\n }\n\n if (input.hasOwnProperty('reuseURL')) {\n createInput.resource = input.reuseURL;\n }\n\n if (identity) {\n createInput.identity = identity;\n }\n\n //Object.assign(createInput, {resume: false});\n //debugger;\n // console.log('[syncher - create] - create Reporter - createInput: ', createInput);\n\n return _this._create(createInput);\n }\n\n /**\n * Request a DataObjectReporter creation. The URL will be be requested by the allocation mechanism.\n * @param {Object} criteria - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @return {Promise[]} Return a promise with a list of DataObjectReporter to be resumed;\n */\n\n }, {\n key: 'resumeReporters',\n value: function resumeReporters(criteria) {\n var _this = this;\n log.log('[syncher - create] - resume Reporter - criteria: ', criteria);\n\n (0, _assign2.default)(criteria, { resume: true });\n\n return _this._resumeCreate(criteria);\n }\n\n /**\n * Request a subscription to an existent reporter object.\n * @param {SchemaURL} schema - Hyperty Catalogue URL address that can be used to retrieve the JSON-Schema describing the Data Object schema\n * @param {ObjectURL} objURL - Address of the existent reporter object to be observed\n * @param {Boolean} [store=false] - Save the subscription on the Syncher Manager for further resume (Default is false)\n * @param {Boolean} [p2p=false] - Info about if should use p2p connection (Default is false)\n * @param {Boolean} [mutual=true] - Info about if messages of this object should be encrypted (Default is true)\n * @param {MessageBodyIdentity} identity - (optional) identity data to be added to identity the user reporter. To be used for legacy identities.\n * @return {Promise} Return Promise to a new observer. It's associated with the reporter.\n */\n\n }, {\n key: 'subscribe',\n value: function subscribe(input) {\n /* let _this = this;\n let criteria = {};\n criteria.p2p = p2p;\n criteria.store = store;\n criteria.schema = schema;\n criteria.domain_subscription = domain_subscription;\n criteria.resource = objURL;\n if (identity) { criteria.identity = identity; }\n //TODO: For Further Study\n criteria.mutual = mutual;\n log.log('[syncher - subscribe] - subscribe criteria: ', criteria);\n Object.assign(criteria, {resume: false});*/\n\n return this._subscribe(input);\n }\n\n /**\n * Request a subscription to an existent reporter object.\n * @param {criteria} criteria - Information to discovery the observer object\n * @return {Promise} Return Promise to a new observer. It's associated with the reporter.\n */\n\n }, {\n key: 'resumeObservers',\n value: function resumeObservers(criteria) {\n var _this = this;\n var _criteria = criteria || {};\n\n (0, _assign2.default)(_criteria, { resume: true });\n\n return _this._resumeSubscribe(_criteria);\n }\n\n /**\n * Request a read action on the reporter object\n * @param {ObjectURL} objURL - URL of the reporter object to be read\n * @return {Promise} Return Promise to last available data of the reporter\n */\n\n }, {\n key: 'read',\n value: function read(objURL, criteria) {\n var _this = this;\n console.log('[Syncher.read] ', objURL);\n\n return new _promise2.default(function (resolve, reject) {\n // in case the object is synched in a remote storage, lets sync with it\n /* if (_this._observers[objURL] && _this._observers[objURL].metadata.hasOwnProperty('backup') && _this._observers[objURL].metadata.backup) {\n \n let readMsg = {\n type: 'read', from: _this._owner, to: _this._subURL, \n body: { resource: objURL}\n };\n \n if (criteria) readMsg.body.criteria = criteria;\n \n let callback = (reply) => {\n return _this._readCallBack(reply, resolve, reject);\n };\n \n _this._bus.postMessage(readMsg, callback, false);\n \n } else {*/\n _this._readReporter(objURL).then(function (result) {\n resolve(result);\n });\n // }\n });\n }\n }, {\n key: '_readCallBack',\n value: function _readCallBack(reply, resolve, reject) {\n var _this = this;\n\n console.log('[Syncher.read] reply: ', reply);\n\n var childrens = {};\n var value = {};\n var n = 0;\n\n if (reply.body.code < 300) {\n if (!reply.body.value.hasOwnProperty('responses')) {\n _this._bus.removeResponseListener(reply.from, reply.id);\n resolve(reply.body.value);\n } else {\n //data object is sent in separated messages\n if (n === 0) {\n //initial response without childrens\n value = reply.body.value;\n ++n;\n } else {\n // received response contains childrens\n delete reply.body.value.responses;\n var children = void 0;\n for (children in reply.body.value) {\n if (!childrens.hasOwnProperty(children)) childrens[children] = {};\n (0, _assign2.default)(childrens[children], reply.body.value[children]);\n }\n ++n;\n if (n === value.responses) {\n value.childrenObjects = childrens;\n delete value.responses;\n _this._bus.removeResponseListener(reply.from, reply.id);\n resolve(value);\n }\n }\n }\n } else {\n\n reject(reply.body.desc);\n }\n }\n }, {\n key: '_readReporter',\n value: function _readReporter(objURL) {\n var _this = this;\n\n //FLOW-OUT: this message will be sent directly to reporter object (maybe there is no listener available, so it will be resolved with MessageBus -> resolve)\n //will reach the remote object in DataObjectReporter -> _onRead\n var readMsg = {\n type: 'read', from: _this._owner, to: objURL\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._bus.postMessage(readMsg, function (reply) {\n return _this._readCallBack(reply, resolve, reject);\n }, false);\n });\n }\n\n /**\n * Setup the callback to process create and delete events of remove Reporter objects.\n * This is releated to the messagens sent by create to the observers Hyperty array.\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onNotification',\n value: function onNotification(callback) {\n this._onNotificationHandler = callback;\n }\n\n /**\n * Setup the callback to process close events from the runtime.\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onClose',\n value: function onClose(callback) {\n this._onClose = callback;\n }\n }, {\n key: '_create',\n value: function _create(input) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var reporterInput = (0, _assign2.default)({}, input);\n\n var resume = input.resume;\n\n reporterInput.created = new Date().toISOString();\n reporterInput.runtime = _this._runtimeUrl;\n\n var requestValue = (0, _utils.deepClone)(reporterInput);\n\n delete requestValue.p2p;\n delete requestValue.store;\n delete requestValue.observers;\n delete requestValue.identity;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onCreate\n //debugger;\n var requestMsg = {\n type: 'create', from: _this._owner, to: _this._subURL,\n body: { resume: resume, value: requestValue }\n };\n\n requestMsg.body.schema = reporterInput.schema;\n\n if (reporterInput.p2p) requestMsg.body.p2p = reporterInput.p2p;\n if (reporterInput.store) requestMsg.body.store = reporterInput.store;\n if (reporterInput.identity) requestMsg.body.identity = reporterInput.identity;\n\n console.log('[syncher._create]: ', reporterInput, requestMsg);\n\n //request create to the allocation system. Can be rejected by the PolicyEngine.\n _this._bus.postMessage(requestMsg, function (reply) {\n log.log('[syncher - create] - create-response: ', reply);\n if (reply.body.code === 200) {\n //reporter creation accepted\n reporterInput.url = reply.body.resource;\n\n /* if (reply.body.p2pHandler) reporterInput.p2pHandler = reply.body.p2pHandler;\n if (reply.body.p2pRequester) reporterInput.p2pRequester = reply.body.p2pRequester;*/\n\n reporterInput.status = 'live'; // pch: do we ned this?\n reporterInput.syncher = _this;\n reporterInput.childrens = reply.body.childrenResources;\n\n var newObj = _this._reporters[reporterInput.url];\n\n if (!newObj) {\n newObj = new _DataObjectReporter2.default(reporterInput);\n _this._reporters[reporterInput.url] = newObj;\n }\n\n newObj.inviteObservers(input.authorise, input.p2p);\n\n resolve(newObj);\n } else {\n //reporter creation rejected\n reject(reply.body.desc);\n }\n });\n });\n }\n }, {\n key: '_resumeCreate',\n value: function _resumeCreate(criteria) {\n var _this2 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var resume = criteria.resume;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onCreate\n var requestMsg = {\n type: 'create', from: _this._owner, to: _this._subURL,\n body: { resume: resume }\n };\n\n log.log('[syncher - create]: ', criteria, requestMsg);\n if (criteria) {\n requestMsg.body.value = criteria;\n if (criteria.hasOwnProperty('reporter')) {\n requestMsg.body.value.reporter = criteria.reporter;\n } else {\n requestMsg.body.value.reporter = _this._owner;\n }\n }\n\n if (criteria.p2p) requestMsg.body.p2p = criteria.p2p;\n if (criteria.store) requestMsg.body.store = criteria.store;\n if (criteria.observers) requestMsg.body.authorise = criteria.observers;\n if (criteria.identity) requestMsg.body.identity = criteria.identity;\n\n log.log('[syncher._resumeCreate] - resume message: ', requestMsg);\n\n //debugger;\n\n //request create to the allocation system. Can be rejected by the PolicyEngine.\n\n _this._bus.postMessage(requestMsg, function (reply) {\n log.log('[syncher._resumeCreate] - create-resumed-response: ', reply);\n if (reply.body.code === 200) {\n //debugger;\n var listOfReporters = reply.body.value;\n\n for (var index in listOfReporters) {\n\n var dataObject = listOfReporters[index];\n\n //reporter creation accepted\n\n dataObject.data = (0, _utils.deepClone)(dataObject.data) || {};\n\n if (dataObject.childrenObjects) {\n dataObject.childrenObjects = (0, _utils.deepClone)(dataObject.childrenObjects);\n }\n\n dataObject.mutual = false;\n dataObject.resume = true;\n dataObject.status = 'live'; // pch: do we ned this?\n dataObject.syncher = _this;\n\n log.log('[syncher._resumeCreate] - create-resumed-dataObjectReporter', dataObject);\n\n var newObj = new _DataObjectReporter2.default(dataObject);\n\n if (dataObject.childrenObjects) {\n newObj.resumeChildrens(dataObject.childrenObjects);\n }\n _this._reporters[dataObject.url] = newObj;\n }\n\n resolve(_this._reporters);\n if (_this2._onReportersResume) _this2._onReportersResume(_this2._reporters);\n } else if (reply.body.code === 404) {\n resolve({});\n } else {\n //reporter creation rejected\n reject(reply.body.desc);\n }\n });\n });\n }\n }, {\n key: '_subscribe',\n value: function _subscribe(input) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onLocalSubscribe\n var subscribeMsg = {\n type: 'subscribe', from: _this._owner, to: _this._subURL,\n body: input\n };\n\n // Hyperty request to be an Observer\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#hyperty-request-to-be-an-observer\n\n // Resume Subscriptions for the same Hyperty URL\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-the-same-hyperty-url\n\n // Resume Subscriptions for a certain user and data schema independently of the Hyperty URL.\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-a-certain-user-and-data-schema-independently-of-the-hyperty-url\n /* if (input) {\n if (input.hasOwnProperty('p2p')) subscribeMsg.body.p2p = input.p2p;\n if (input.hasOwnProperty('store')) subscribeMsg.body.store = input.store;\n if (input.hasOwnProperty('schema')) subscribeMsg.body.schema = input.schema;\n if (input.hasOwnProperty('identity')) subscribeMsg.body.identity = input.identity;\n if (input.hasOwnProperty('resource')) subscribeMsg.body.resource = input.resource;\n if (input.hasOwnProperty('domain_subscription')) subscribeMsg.body.domain_subscription = input.domain_subscription;\n }\n \n \n subscribeMsg.body.resume = input.resume;\n \n //TODO: For Further Study\n if (input.hasOwnProperty('mutual')) subscribeMsg.body.mutual = input.mutual;*/\n\n log.log('[syncher_subscribe] - subscribe message: ', input, subscribeMsg);\n\n //request subscription\n //Provisional data is applied to the DataObjectObserver after confirmation. Or discarded if there is no confirmation.\n //for more info see the DataProvisional class documentation.\n _this._bus.postMessage(subscribeMsg, function (reply) {\n log.log('[syncher] - subscribe-response: ', reply);\n\n var objURL = reply.body.resource;\n\n var newProvisional = _this._provisionals[objURL];\n delete _this._provisionals[objURL];\n if (newProvisional) newProvisional._releaseListeners();\n\n if (reply.body.code < 200) {\n log.log('[syncher] - new DataProvisional: ', reply.body.childrenResources, objURL);\n newProvisional = new _DataProvisional2.default(_this._owner, objURL, _this._bus, reply.body.childrenResources);\n _this._provisionals[objURL] = newProvisional;\n } else if (reply.body.code === 200) {\n log.log('[syncher] - new Data Object Observer: ', reply, _this._provisionals);\n\n var observerInput = reply.body.value;\n\n observerInput.syncher = _this;\n observerInput.p2p = input.p2p;\n observerInput.store = input.store;\n observerInput.identity = input.identity;\n observerInput.resume = false;\n\n // todo: For Further Study\n observerInput.mutual = input.mutual;\n\n //observerInput.children = newProvisional.children;\n\n //TODO: mutual For Further Study\n var newObj = _this._observers[objURL];\n if (!newObj) {\n newObj = new _DataObjectObserver2.default(observerInput);\n _this._observers[objURL] = newObj;\n } else {\n newObj.sync();\n }\n\n log.log('[syncher] - new Data Object Observer already exist: ', newObj);\n\n resolve(newObj);\n\n if (newProvisional) {\n newProvisional.apply(newObj);\n }\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n /*\n _processOfflineSubscription(subscription, redirectTo) {\n let _this = this;\n \n let forward = {\n from: subscription.from,\n type: 'forward',\n to: redirectTo,\n body: subscription\n };\n \n console.log('[Syncher._processOfflineSubscription] forwading ', forward);\n \n _this._bus.postMessage(forward);\n \n let result = {\n code: 302,\n desc: \"Found \" + redirectTo\n };\n \n return(result);\n \n }*/\n\n }, {\n key: '_resumeSubscribe',\n value: function _resumeSubscribe(criteria) {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onLocalSubscribe\n var subscribeMsg = {\n type: 'subscribe', from: _this._owner, to: _this._subURL,\n body: {}\n };\n\n // Hyperty request to be an Observer\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#hyperty-request-to-be-an-observer\n\n // Resume Subscriptions for the same Hyperty URL\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-the-same-hyperty-url\n\n // Resume Subscriptions for a certain user and data schema independently of the Hyperty URL.\n // https://github.com/reTHINK-project/specs/blob/master/messages/data-sync-messages.md#resume-subscriptions-for-a-certain-user-and-data-schema-independently-of-the-hyperty-url\n if (criteria) {\n if (criteria.hasOwnProperty('p2p')) subscribeMsg.body.p2p = criteria.p2p;\n if (criteria.hasOwnProperty('store')) subscribeMsg.body.store = criteria.store;\n if (criteria.hasOwnProperty('schema')) subscribeMsg.body.schema = criteria.schema;\n if (criteria.hasOwnProperty('identity')) subscribeMsg.body.identity = criteria.identity;\n if (criteria.hasOwnProperty('resource')) subscribeMsg.body.resource = criteria.resource;\n }\n\n subscribeMsg.body.resume = criteria.resume;\n\n //TODO: For Further Study\n var mutual = criteria.mutual;\n if (criteria.hasOwnProperty('mutual')) subscribeMsg.body.mutual = mutual;\n\n console.log('[syncher] - subscribe message: ', criteria, subscribeMsg);\n\n //request subscription\n //Provisional data is applied to the DataObjectObserver after confirmation. Or discarded if there is no confirmation.\n //for more info see the DataProvisional class documentation.\n _this._bus.postMessage(subscribeMsg, function (reply) {\n console.log('[syncher] - subscribe-resumed-response: ', reply);\n\n var objURL = reply.body.resource;\n\n var newProvisional = _this._provisionals[objURL];\n delete _this._provisionals[objURL];\n if (newProvisional) newProvisional._releaseListeners();\n\n if (reply.body.code < 200) {\n // todo: check if this is needed for the resume\n\n log.log('[syncher] - resume new DataProvisional: ', reply, objURL);\n newProvisional = new _DataProvisional2.default(_this._owner, objURL, _this._bus, reply.body.childrenResources);\n _this._provisionals[objURL] = newProvisional;\n } else if (reply.body.code === 200) {\n\n var listOfObservers = reply.body.value;\n\n for (var index in listOfObservers) {\n\n var dataObject = listOfObservers[index];\n console.log('[syncher] - Resume Object Observer: ', reply, dataObject, _this._provisionals);\n\n if (dataObject.childrenObjects) {\n dataObject.childrenObjects = (0, _utils.deepClone)(dataObject.childrenObjects);\n }\n\n dataObject.data = (0, _utils.deepClone)(dataObject.data) || {};\n dataObject.resume = true;\n dataObject.syncher = _this;\n\n //TODO: mutual For Further Study\n console.log('[syncher._resumeSubscribe] - create new dataObject: ', dataObject);\n var newObj = new _DataObjectObserver2.default(dataObject);\n\n if (dataObject.childrenObjects) {\n newObj.resumeChildrens(dataObject.childrenObjects);\n }\n log.log('[syncher._resumeSubscribe] - new dataObject', newObj);\n _this._observers[newObj.url] = newObj;\n\n if (_this._provisionals[newObj.url]) {\n _this._provisionals[newObj.url].apply(newObj);\n }\n\n //lets sync with Reporter\n // it was commented to let hyperties decide when to sync\n //newObj.sync();\n }\n\n resolve(_this._observers);\n\n if (_this3._onObserversResume) _this3._onObserversResume(_this._observers);\n } else if (reply.body.code === 404) {\n resolve({});\n } else {\n reject(reply.body.desc);\n }\n });\n });\n }\n\n //FLOW-IN: message received from a local runtime ReporterObject -> _onRemoteSubscribe\n\n }, {\n key: '_onForward',\n value: function _onForward(msg) {\n var _this = this;\n\n var reporter = _this._reporters[msg.body.to];\n reporter._onForward(msg);\n }\n\n //FLOW-IN: message received from a remote Syncher -> create (this is actually an invitation to subscribe)\n\n }, {\n key: '_onRemoteCreate',\n value: function _onRemoteCreate(msg) {\n var _this = this;\n var resource = msg.from.slice(0, -13); //remove \"/subscription\" from the URL\n var dividedURL = (0, _utils.divideURL)(resource);\n var domain = dividedURL.domain;\n\n var event = {\n type: msg.type,\n from: msg.body.source,\n url: resource,\n domain: domain,\n schema: msg.body.schema,\n value: msg.body.value,\n identity: msg.body.identity,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType }\n });\n }\n };\n\n if (_this._onNotificationHandler) {\n log.info('[Syncher] NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler(event);\n }\n }\n\n //FLOW-IN: message received from a remote DataObjectReporter -> delete\n\n }, {\n key: '_onRemoteDelete',\n value: function _onRemoteDelete(msg) {\n var _this = this;\n\n //remove \"/subscription\" from the URL\n var resource = msg.body.resource;\n\n var object = _this._observers[resource];\n\n var unsubscribe = {\n from: _this.owner,\n to: _this._subURL,\n id: msg.id,\n type: 'unsubscribe',\n body: { resource: msg.body.resource }\n };\n\n _this._bus.postMessage(unsubscribe);\n\n delete _this._observers[resource];\n\n if (object) {\n var event = {\n type: msg.type,\n url: resource,\n identity: msg.body.identity,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //TODO: any other different options for the release process, like accept but nor release local?\n if (lType === 200) {\n object.delete();\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType, source: _this._owner }\n });\n }\n };\n\n if (_this._onNotificationHandler) {\n log.log('NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler(event);\n }\n } else {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 404, source: _this._owner }\n });\n }\n }\n\n // close event received from runtime registry\n\n }, {\n key: '_onExecute',\n value: function _onExecute(msg) {\n var _this = this;\n\n var reply = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n };\n\n if ((msg.from === _this._runtimeUrl + '/registry/' || msg.from === _this._runtimeUrl + '/registry') && msg.body && msg.body.method && msg.body.method === 'close' && _this._onClose) {\n var event = {\n type: 'close',\n\n ack: function ack(type) {\n if (type) {\n reply.body.code = type;\n }\n\n //send ack response message\n _this._bus.postMessage(reply);\n }\n };\n\n log.info('[Syncher] Close-EVENT: ', event);\n _this._onClose(event);\n } else {\n _this._bus.postMessage(reply);\n }\n }\n\n /**\n * Callback system to trigger the resumed reporters\n * @param {Function} callback - function callback which will be invoked\n * @return {Object} Return one object with all resumed reporters;\n */\n\n }, {\n key: 'onReportersResume',\n value: function onReportersResume(callback) {\n this._onReportersResume = callback;\n }\n\n /**\n * Callback system to trigger the resumed observers\n * @param {Function} callback - function callback which will be invoked\n * @return {Object} Return one object with all resumed observers;\n */\n\n }, {\n key: 'onObserversResume',\n value: function onObserversResume(callback) {\n this._onObserversResume = callback;\n }\n }, {\n key: 'owner',\n get: function get() {\n return this._owner;\n }\n\n /**\n * All owned reporters, the ones that were created by a create\n * @type {Object}\n */\n\n }, {\n key: 'reporters',\n get: function get() {\n return this._reporters;\n }\n\n /**\n * All owned observers, the ones that were created by a local subscription\n * @type {Object}\n */\n\n }, {\n key: 'observers',\n get: function get() {\n return this._observers;\n }\n }]);\n return Syncher;\n}();\n\nexports.default = Syncher;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1N5bmNoZXIuanM/NmRkMiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMT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0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFWQTtBQUNBO0FBWUE7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7OztBQUtBO0FBQ0E7QUFDQTs7O0FBenVCQTtBQUFBO0FBQUE7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQUE7QUFBQTs7Ozs7QUFpdUJBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///480\n")},function(module,exports,__webpack_require__){eval("var core = __webpack_require__(11);\nvar $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });\nmodule.exports = function stringify(it) { // eslint-disable-line no-unused-vars\n return $JSON.stringify.apply($JSON, arguments);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9qc29uL3N0cmluZ2lmeS5qcz9hYTQyIl0sInNvdXJjZXNDb250ZW50IjpbInZhciBjb3JlID0gcmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9fY29yZScpO1xudmFyICRKU09OID0gY29yZS5KU09OIHx8IChjb3JlLkpTT04gPSB7IHN0cmluZ2lmeTogSlNPTi5zdHJpbmdpZnkgfSk7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIHN0cmluZ2lmeShpdCkgeyAvLyBlc2xpbnQtZGlzYWJsZS1saW5lIG5vLXVudXNlZC12YXJzXG4gIHJldHVybiAkSlNPTi5zdHJpbmdpZnkuYXBwbHkoJEpTT04sIGFyZ3VtZW50cyk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2pzb24vc3RyaW5naWZ5LmpzXG4vLyBtb2R1bGUgaWQgPSA0ODFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///481\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _DataObject2 = __webpack_require__(206);\n\nvar _DataObject3 = _interopRequireDefault(_DataObject2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectReporter'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n * The class returned from the Syncher create call.\n * To be used as a reporter point, changes will be submited to DataObjectObserver instances.\n */\nvar DataObjectReporter = function (_DataObject) {\n (0, _inherits3.default)(DataObjectReporter, _DataObject);\n\n /* private\n _subscriptions: \n ----event handlers----\n _onSubscriptionHandler: (event) => void\n _onResponseHandler: (event) => void\n _onReadHandler: (event) => void\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the Syncher.create method\n */\n\n //constructor(syncher, url, created, reporter, runtime, schema, name, initialStatus, initialData, childrens, mutual = true, resumed = false, description, tags, resources, observerStorage, publicObservation) {\n function DataObjectReporter(input) {\n (0, _classCallCheck3.default)(this, DataObjectReporter);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (DataObjectReporter.__proto__ || (0, _getPrototypeOf2.default)(DataObjectReporter)).call(this, input));\n\n var _this = _this2;\n\n _this._subscriptions = {};\n\n _this._syncObj.observe(function (event) {\n log.log('[Syncher.DataObjectReporter] ' + _this.url + ' publish change: ', event);\n _this._onChange(event);\n });\n\n _this._allocateListeners();\n\n _this.invitations = []; // array of promises with pending invitations\n _this._childrenSizeThreshold = 50000; // to be used when replying to sync requests to ensure each response msg is not too large\n\n return _this2;\n }\n\n (0, _createClass3.default)(DataObjectReporter, [{\n key: '_allocateListeners',\n value: function _allocateListeners() {\n (0, _get3.default)(DataObjectReporter.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectReporter.prototype), '_allocateListeners', this).call(this);\n var _this = this;\n\n _this._objectListener = _this._bus.addListener(_this._url, function (msg) {\n log.log('[Syncher.DataObjectReporter] listener ' + _this._url + ' Received: ', msg);\n switch (msg.type) {\n case 'response':\n _this._onResponse(msg);break;\n case 'read':\n _this._onRead(msg);break;\n case 'execute':\n _this._onExecute(msg);break;\n case 'create':\n _this._onChildCreate(msg);break; // to create child objects that were sent whenn offline\n }\n });\n\n _this._runtimeStatusListener = _this._bus.addListener(_this._syncher._runtimeUrl + '/status', function (evt) {\n console.log('[Syncher.DataObjectReporter] runtime status event received ' + evt);\n\n if (evt.body && evt.body.resource && evt.body.resource === _this._url && evt.body.value && evt.body.value.backupRevision) {\n // broadcast backupRevision update\n\n _this.data.backupRevision = evt.body.value.backupRevision;\n console.log('[Syncher.DataObjectReporter] DO updated with backup revision ' + _this.data.backupRevision);\n }\n });\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n (0, _get3.default)(DataObjectReporter.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectReporter.prototype), '_releaseListeners', this).call(this);\n var _this = this;\n\n _this._objectListener.remove();\n }\n\n /**\n * Send invitations (create messages) to hyperties, observers list.\n * @param {HypertyURL[]} observers List of Hyperty URL's\n */\n\n }, {\n key: 'inviteObservers',\n value: function inviteObservers(observers, p2p) {\n var _this = this;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onCreate\n // TODO: remove value and add resources? should similar to 1st create\n\n var toInvite = observers;\n\n // let invitePromises = [];\n\n /* observers.forEach((observer)=> {\n if (!_this.invitations[observer]) {\n toInvite.push(observer);\n _this.invitations[observer] = observer;\n }\n });*/\n\n if (toInvite.length > 0) {\n log.log('[Syncher.DataObjectReporter] InviteObservers ', toInvite, _this._metadata);\n\n toInvite.forEach(function (observer) {\n\n var invitation = new _promise2.default(function (resolve, reject) {\n\n var inviteMsg = {\n type: 'create', from: _this._syncher._owner, to: _this._syncher._subURL,\n body: { resume: false, resource: _this._url, schema: _this._schema, value: _this._metadata, authorise: [observer] }\n };\n\n if (p2p) inviteMsg.body.p2p = p2p;\n\n if (!_this.data.mutual) inviteMsg.body.mutual = _this.data.mutual;\n\n _this._bus.postMessage(inviteMsg, function (reply) {\n log.log('[Syncher.DataObjectReporter] Invitation reply ', reply);\n\n var result = {\n invited: observer,\n code: reply.body && reply.body.code ? reply.body.code : 500,\n desc: reply.body && reply.body.desc ? reply.body.desc : 'Unknown'\n };\n\n if (result.code < 300) resolve(result);\n /* else if (result.code >= 300) {\n if (_this.metadata.offline) {\n resolve(_this._processOfflineInvitation(inviteMsg));\n }*/else reject(result);\n // } \n });\n });\n\n _this.invitations.push(invitation);\n });\n\n // return(invitePromises);\n }\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n if (_this._heartBeat) _this._heartBeat.stop();\n\n _this._deleteChildrens().then(function (result) {\n log.log(result);\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onDelete\n var deleteMsg = {\n type: 'delete', from: _this._owner, to: _this._syncher._subURL,\n body: { resource: _this._url }\n };\n\n _this._bus.postMessage(deleteMsg, function (reply) {\n log.log('DataObjectReporter-DELETE: ', reply);\n if (reply.body.code === 200) {\n _this._releaseListeners();\n delete _this._syncher._reporters[_this._url];\n\n //_this._syncObj.unobserve();\n _this._syncObj = {};\n }\n });\n });\n }\n\n /**\n * Subscriptions requested and accepted to this reporter\n * @type {Object}\n */\n\n }, {\n key: 'onSubscription',\n\n\n /**\n * Setup the callback to process subscribe and unsubscribe notifications\n * @param {function(event: MsgEvent)} callback function to receive events\n */\n value: function onSubscription(callback) {\n this._onSubscriptionHandler = callback;\n }\n\n /**\n * Setup the callback to process response notifications of the create's\n * @param {function(event: MsgEvent)} callback function to receive events\n */\n\n }, {\n key: 'onResponse',\n value: function onResponse(callback) {\n this._onResponseHandler = callback;\n }\n\n /**\n * Setup the callback to process read notifications\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onRead',\n value: function onRead(callback) {\n this._onReadHandler = callback;\n }\n\n /**\n * Setup the callback to process execute notifications\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onExecute',\n value: function onExecute(callback) {\n this._onExecuteHandler = callback;\n }\n\n //FLOW-IN: message received from parent Syncher -> _onForward\n\n }, {\n key: '_onForward',\n value: function _onForward(msg) {\n var _this = this;\n\n log.log('DataObjectReporter-RCV: ', msg);\n switch (msg.body.type) {\n case 'subscribe':\n _this._onSubscribe(msg);break;\n case 'unsubscribe':\n _this._onUnSubscribe(msg);break;\n }\n }\n\n //FLOW-IN: message received from this -> _onForward: emitted by a remote Syncher -> subscribe\n\n }, {\n key: '_onSubscribe',\n value: function _onSubscribe(msg) {\n var _this = this;\n var hypertyUrl = msg.body.from;\n var dividedURL = (0, _utils.divideURL)(hypertyUrl);\n var domain = dividedURL.domain;\n var mutual = true;\n\n if (msg.body.hasOwnProperty('mutual') && !msg.body.mutual) mutual = false;\n\n console.log('[DataObjectReporter._onSubscribe]', msg, domain, dividedURL);\n\n var event = {\n type: msg.body.type,\n url: hypertyUrl,\n\n domain: domain,\n\n identity: msg.body.identity,\n\n nutual: mutual,\n\n accept: function accept() {\n //create new subscription\n var sub = { url: hypertyUrl, status: 'live' };\n _this._subscriptions[hypertyUrl] = sub;\n if (_this.metadata.subscriptions) {\n _this.metadata.subscriptions.push(sub.url);\n }\n\n var msgValue = (0, _utils.deepClone)(_this._metadata);\n msgValue.data = (0, _utils.deepClone)(_this.data);\n msgValue.version = _this._version;\n\n //process and send childrens data\n // let childrenValues = {};\n //\n // if (_this._childrenObjects) {\n // Object.keys(_this._childrenObjects).forEach((childrenId) => {\n // let childrenData = _this._childrenObjects[childrenId];\n // childrenValues[childrenId] = deepClone(childrenData);\n // });\n // msgValue.childrenObjects = childrenValues;\n // }\n\n var sendMsg = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, schema: _this._schema, value: msgValue }\n };\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual') && !msg.body.mutual) {\n sendMsg.body.mutual = msg.body.mutual; // TODO: remove?\n _this.data.mutual = false;\n }\n\n if (_this._heartBeat) {\n sendMsg.body.value.childrenObjects = {};\n sendMsg.body.value.childrenObjects.heartbeat = _this._heartBeat.heartbeat;\n }\n\n console.log('[DataObjectReporter._onSubscribe.accept] sending response: ', sendMsg);\n\n //send ok response message\n _this._bus.postMessage(sendMsg);\n\n return sub;\n },\n\n reject: function reject(reason) {\n //send reject response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 403, desc: reason }\n });\n }\n };\n\n if (_this._onSubscriptionHandler) {\n log.log('SUBSCRIPTION-EVENT: ', event);\n _this._onSubscriptionHandler(event);\n }\n }\n\n //FLOW-IN: message received from this -> _onForward: emitted by a remote DataObjectObserver -> unsubscribe\n\n }, {\n key: '_onUnSubscribe',\n value: function _onUnSubscribe(msg) {\n var _this = this;\n var hypertyUrl = msg.body.from;\n var dividedURL = (0, _utils.divideURL)(hypertyUrl);\n var domain = dividedURL.domain;\n\n log.log('[DataObjectReporter._onUnSubscribe]', msg, domain, dividedURL);\n\n //let sub = _this._subscriptions[hypertyUrl];\n delete _this._subscriptions[hypertyUrl];\n delete _this.invitations[hypertyUrl];\n\n var event = {\n type: msg.body.type,\n url: hypertyUrl,\n domain: domain,\n identity: msg.body.identity\n };\n\n // TODO: check if the _onSubscriptionHandler it is the same of the subscriptions???\n if (_this._onSubscriptionHandler) {\n log.log('UN-SUBSCRIPTION-EVENT: ', event);\n _this._onSubscriptionHandler(event);\n }\n }\n\n //FLOW-IN: message received from ReporterURL address: emited by a remote Syncher -> _onRemoteCreate -> event.ack\n\n }, {\n key: '_onResponse',\n value: function _onResponse(msg) {\n var _this = this;\n\n var event = {\n type: msg.type,\n url: msg.from,\n code: msg.body.code\n };\n\n if (_this._onResponseHandler) {\n log.log('RESPONSE-EVENT: ', event);\n _this._onResponseHandler(event);\n }\n }\n\n //FLOW-IN: message received from ReporterURL address: emited by a remote Syncher -> read\n\n }, {\n key: '_onRead',\n value: function _onRead(msg) {\n var _this = this;\n var childrensSize = (0, _stringify2.default)(_this.childrensJSON).length;\n\n var largeObject = childrensSize > _this._childrenSizeThreshold ? true : false;\n\n var event = {\n type: msg.type,\n url: msg.from,\n\n accept: function accept() {\n if (largeObject) _this._syncReplyForLargeData(msg);else _this._syncReply(msg);\n },\n\n reject: function reject(reason) {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 401, desc: reason }\n });\n }\n };\n\n // if the requester is an authorised observer, the data object is responded otherwise an event is triggered\n var subscriptions = [];\n\n if (_this.metadata.subscriptions) {\n subscriptions = _this.metadata.subscriptions;\n } else if (_this._subscriptions) {\n subscriptions = (0, _keys2.default)(_this._subscriptions).map(function (key) {\n return _this._subscriptions[key].url;\n });\n }\n\n if (subscriptions.indexOf(msg.from) != -1) {\n if (largeObject) _this._syncReplyForLargeData(msg);else _this._syncReply(msg);\n } else if (_this._onReadHandler) {\n log.log('READ-EVENT: ', event);\n _this._onReadHandler(event);\n }\n }\n }, {\n key: '_syncReply',\n value: function _syncReply(msg) {\n var _this = this;\n\n var objectValue = (0, _utils.deepClone)(_this.metadata);\n\n objectValue.data = (0, _utils.deepClone)(_this.data);\n objectValue.childrenObjects = (0, _utils.deepClone)(_this.childrensJSON);\n\n objectValue.version = _this._version;\n\n var response = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, value: objectValue }\n };\n\n _this._bus.postMessage(response);\n }\n\n // This function is only used if the data object to be synched has childrenOjects too large\n\n }, {\n key: '_syncReplyForLargeData',\n value: function _syncReplyForLargeData(msg) {\n //set attribute with number of spllited messages\n var _this = this;\n\n // lets set the initial message with no childObjects\n\n var objectValue = (0, _utils.deepClone)(_this.metadata);\n\n objectValue.data = (0, _utils.deepClone)(_this.data);\n\n objectValue.version = _this._version;\n\n delete objectValue.childrenObjects;\n\n var children = void 0;\n var values = []; // array of values to be sent in separated responses\n var childrenValue = {}; // value to be used in each response\n\n for (child in _this._childrenObjects) {\n // let child;\n childrenValue[child] = {};\n // for (child in _this._childrenObjects[children]) {\n if ((0, _stringify2.default)(childrenValue).length > _this._childrenSizeThreshold) {\n //childrenValue big enough to be sent in a response message\n values.push(childrenValue);\n // childrenValue = {};\n // childrenValue[child] = {};\n }\n childrenValue[child] = {};\n childrenValue[child].value = _this._childrenObjects[child].metadata;\n childrenValue[child].identity = _this._childrenObjects[child].identity;\n // }\n }\n\n values.push(childrenValue);\n\n objectValue.responses = values.length + 1; //number of responses to be sent\n\n var initialResponse = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 100, value: objectValue }\n };\n\n _this._bus.postMessage(initialResponse);\n\n values.forEach(function (value) {\n\n var response = (0, _utils.deepClone)(initialResponse);\n\n response.body.value = value;\n\n response.body.value.responses = objectValue.responses;\n\n setTimeout(function () {\n _this._bus.postMessage(response);\n }, 50);\n\n // should put a timeout?\n });\n }\n\n // Execute request received\n\n }, {\n key: '_onExecute',\n value: function _onExecute(msg) {\n var _this = this;\n\n if (!msg.body.method) throw '[DataObjectReporter._onExecute] method missing ', msg;\n\n var response = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n };\n\n var event = {\n type: msg.type,\n url: msg.from,\n method: msg.body.method,\n params: msg.body.params,\n\n accept: function accept() {\n _this._bus.postMessage(response);\n },\n\n reject: function reject(reason) {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 401, desc: reason }\n });\n }\n };\n\n if (_this._onExecuteHandler) {\n log.log('[DataObjectReporter] EXECUTE-EVENT: ', event);\n _this._onExecuteHandler(event);\n }\n }\n }, {\n key: 'subscriptions',\n get: function get() {\n return this._subscriptions;\n }\n }, {\n key: 'childrensJSON',\n get: function get() {\n var _this = this;\n var childrens = {};\n\n // let children;\n\n // for (children in _this._childrenObjects) {\n var child = void 0;\n // childrens[children] = {};\n for (child in _this._childrenObjects) {\n childrens[child] = {};\n childrens[child].value = _this._childrenObjects[child].metadata;\n childrens[child].identity = _this._childrenObjects[child].identity;\n }\n // }\n\n return childrens;\n }\n }]);\n return DataObjectReporter;\n}(_DataObject3.default /* implements SyncStatus */);\n\nexports.default = DataObjectReporter;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFPYmplY3RSZXBvcnRlci5qcz81ZGY2Il0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU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3NhZ2UoaW52aXRlTXNnLCAocmVwbHkpPT57XG4gICAgICAgICAgICBsb2cubG9nKCdbU3luY2hlci5EYXRhT2JqZWN0UmVwb3J0ZXJdIEludml0YXRpb24gcmVwbHkgJywgcmVwbHkpO1xuXG4gICAgICAgICAgICBsZXQgcmVzdWx0ID0ge1xuICAgICAgICAgICAgICBpbnZpdGVkOiBvYnNlcnZlcixcbiAgICAgICAgICAgICAgY29kZTogcmVwbHkuYm9keSAmJiByZXBseS5ib2R5LmNvZGUgPyByZXBseS5ib2R5LmNvZGUgOiA1MDAsXG4gICAgICAgICAgICAgIGRlc2M6IHJlcGx5LmJvZHkgJiYgcmVwbHkuYm9keS5kZXNjID8gcmVwbHkuYm9keS5kZXNjIDogJ1Vua25vd24nXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBpZiAocmVzdWx0LmNvZGUgPCAzMDApIHJlc29sdmUocmVzdWx0KTtcbi8qICAgICAgICAgICAgZWxzZSBpZiAocmVzdWx0LmNvZGUgPj0gMzAwKSB7XG4gICAgICAgICAgICAgIGlmIChfdGhpcy5tZXRhZGF0YS5vZmZsaW5lKSB7XG4gICAgICAgICAgICAgICAgcmVzb2x2ZShfdGhpcy5fcHJvY2Vzc09mZmxpbmVJbnZpdGF0aW9uKGludml0ZU1zZykpO1xuICAgICAgICAgICAgICB9Ki8gZWxzZSByZWplY3QocmVzdWx0KTtcbi8vICAgICAgICAgICAgfSBcbiAgICAgICAgICB9KTtcbiAgICAgICAgfSk7XG5cbiAgICAgICAgX3RoaXMuaW52aXRhdGlvbnMucHVzaChpbnZpdGF0aW9uKTtcblxuICAgICAgfSk7XG5cbiAgICAgIC8vICAgICAgcmV0dXJuKGludml0ZVByb21pc2VzKTtcblxuICAgIH1cbiAgfVxuXG5cbiAgLyoqXG4gICAqIFJlbGVhc2UgYW5kIGRlbGV0ZSBvYmplY3QgZGF0YVxuICAgKi9cbiAgZGVsZXRlKCkge1xuICAgIGxldCBfdGhpcyA9IHRoaXM7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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFDQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUlBO0FBZkE7QUFDQTtBQWlCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUE5VkE7QUFBQTtBQUFBOzs7QUF3TkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFwWkE7QUFDQTtBQTRnQkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///482\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(484), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDgzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzJiYTEiXSwic291cmNlc0NvbnRlbnQiOlsibW9kdWxlLmV4cG9ydHMgPSB7IFwiZGVmYXVsdFwiOiByZXF1aXJlKFwiY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3JcIiksIF9fZXNNb2R1bGU6IHRydWUgfTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2NvcmUtanMvb2JqZWN0L2dldC1vd24tcHJvcGVydHktZGVzY3JpcHRvci5qc1xuLy8gbW9kdWxlIGlkID0gNDgzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///483\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(485);\nvar $Object = __webpack_require__(11).Object;\nmodule.exports = function getOwnPropertyDescriptor(it, key) {\n return $Object.getOwnPropertyDescriptor(it, key);\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzcyNzkiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYub2JqZWN0LmdldC1vd24tcHJvcGVydHktZGVzY3JpcHRvcicpO1xudmFyICRPYmplY3QgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0O1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSkge1xuICByZXR1cm4gJE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoaXQsIGtleSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL29iamVjdC9nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ4NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///484\n")},function(module,exports,__webpack_require__){eval("// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)\nvar toIObject = __webpack_require__(50);\nvar $getOwnPropertyDescriptor = __webpack_require__(148).f;\n\n__webpack_require__(138)('getOwnPropertyDescriptor', function () {\n return function getOwnPropertyDescriptor(it, key) {\n return $getOwnPropertyDescriptor(toIObject(it), key);\n };\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5vYmplY3QuZ2V0LW93bi1wcm9wZXJ0eS1kZXNjcmlwdG9yLmpzPzg4ODkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMTkuMS4yLjYgT2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcihPLCBQKVxudmFyIHRvSU9iamVjdCA9IHJlcXVpcmUoJy4vX3RvLWlvYmplY3QnKTtcbnZhciAkZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yID0gcmVxdWlyZSgnLi9fb2JqZWN0LWdvcGQnKS5mO1xuXG5yZXF1aXJlKCcuL19vYmplY3Qtc2FwJykoJ2dldE93blByb3BlcnR5RGVzY3JpcHRvcicsIGZ1bmN0aW9uICgpIHtcbiAgcmV0dXJuIGZ1bmN0aW9uIGdldE93blByb3BlcnR5RGVzY3JpcHRvcihpdCwga2V5KSB7XG4gICAgcmV0dXJuICRnZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IodG9JT2JqZWN0KGl0KSwga2V5KTtcbiAgfTtcbn0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm9iamVjdC5nZXQtb3duLXByb3BlcnR5LWRlc2NyaXB0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDQ4NVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///485\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Class to handle Children Data Object Heart beats \n * required to manage synchronisation with remote storage servers.\n */\nvar HeartBeat = function () {\n /* private\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the DataObject constructor\n */\n function HeartBeat(bus, hypertyUrl, runtimeUrl, dataObject) {\n var heartBeatRate = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 60;\n (0, _classCallCheck3.default)(this, HeartBeat);\n\n var _this = this;\n\n function throwMandatoryParmMissingError(par) {\n throw '[HeartBeat] ' + par + ' mandatory parameter is missing';\n }\n\n bus ? _this._bus = bus : throwMandatoryParmMissingError('bus');\n dataObject ? _this._dataObject = dataObject : throwMandatoryParmMissingError('dataObject');\n heartBeatRate ? _this._heartBeatRate = heartBeatRate : throwMandatoryParmMissingError('heartBeatRate');\n runtimeUrl ? _this._runtimeUrl = runtimeUrl : throwMandatoryParmMissingError('runtimeUrl');\n hypertyUrl ? _this._hypertyUrl = hypertyUrl : throwMandatoryParmMissingError('hypertyUrl');\n this.heartbeat = 0;\n\n _this._stop = {\n heartBeat: false,\n sync: function sync(bus) {\n var stopSyncMsg = {\n from: hypertyUrl,\n to: runtimeUrl + '/sm',\n type: 'execute',\n body: {\n method: 'stopSync',\n params: [dataObject.url]\n }\n };\n\n console.log('[Heartbeat.stop.sync()] sending msg:', stopSyncMsg);\n\n bus.postMessage(stopSyncMsg);\n }\n\n };\n }\n\n (0, _createClass3.default)(HeartBeat, [{\n key: 'start',\n value: function start(resume) {\n var _this2 = this;\n\n console.log('[HeartBeat] starting ... ');\n\n if (resume) {\n this._getLastHearBeat().then(function () {\n var isHeartBeatActive = _this2._isHeartBeatActive(_this2.heartBeat, _this2._heartBeatRate * 2);\n\n if (!isHeartBeatActive) {\n console.log('[HeartBeat] heart beats are disabled for ', _this2._dataObject);\n\n // Is disabled: lets start observer heart beat and start synching with remote storage server\n _this2._stop.heartBeat = _this2._startHeartBeat(_this2._heartBeatRate);\n console.log('[HeartBeat] ', _this2._hypertyUrl, ' started synching with remote storage server');\n _this2._startSync();\n } else {\n // heart beat is active, \n // it means the data object is already being synchronised with remote storage server\n // we only need to watch the heart beat and try to replace it in case it fails.\n _this2._watchHeartBeat(_this2._heartBeatRate, true, _this2._onHertbeatStopped);\n }\n });\n } else {\n this._startHeartBeat(this._heartBeatRate);\n this._startSync();\n }\n }\n }, {\n key: '_getLastHearBeat',\n value: function _getLastHearBeat() {\n var _this3 = this;\n\n return new _promise2.default(function (resolve) {\n\n setTimeout(function () {\n console.log('[HeartBeat._getLastHearBeat] stop waiting ');\n resolve();\n }, _this3._heartBeatRate * 1000 * 1.5);\n });\n }\n }, {\n key: 'stop',\n value: function stop() {\n if (this._stop.heartBeat) this._stop.heartBeat();\n\n this._stop.sync(this._bus);\n }\n }, {\n key: 'onNewHeartbeat',\n value: function onNewHeartbeat(heartbeat) {\n this.heartbeat = heartbeat;\n }\n }, {\n key: '_isHeartBeatActive',\n value: function _isHeartBeatActive(lastHeartbeat, maxHeartBeatInterval) {\n var lastHeartPeriodInterval = (0, _utils.secondsSinceEpoch)() - lastHeartbeat;\n console.log('[HeartBeat._isHeartBeatActive] now - lastHeartBeat', lastHeartPeriodInterval);\n\n console.log('[HeartBeat._isHeartBeatActive] ', !(lastHeartPeriodInterval > maxHeartBeatInterval * 2));\n return !(lastHeartPeriodInterval > maxHeartBeatInterval * 2);\n }\n }, {\n key: '_startHeartBeat',\n value: function _startHeartBeat(rate) {\n var _this = this;\n\n var msg = {\n from: _this._hypertyUrl,\n to: _this._dataObject.url + '/children/',\n type: 'create',\n body: {\n resource: 'heartbeat',\n mutual: false,\n value: (0, _utils.secondsSinceEpoch)()\n }\n };\n console.log('[HeartBeat._startHeartBeat] starting ... ', msg.body.value);\n\n this._bus.postMessage(msg);\n\n this.heartbeat = (0, _utils.secondsSinceEpoch)();\n\n var id = setInterval(function () {\n\n var msg = {\n from: _this._hypertyUrl,\n to: _this._dataObject.url + '/children/',\n type: 'create',\n body: {\n resource: 'heartbeat',\n mutual: false,\n value: (0, _utils.secondsSinceEpoch)()\n }\n };\n console.log('[HeartBeat] ', msg);\n _this._bus.postMessage(msg);\n this.heartbeat = (0, _utils.secondsSinceEpoch)();\n }, rate * 1000);\n\n // returns function to stop the heart beat\n\n return function () {\n clearInterval(id);\n };\n }\n }, {\n key: '_startSync',\n value: function _startSync() {\n\n console.log('[HeartBeat._startSync] starting observer sync ', this._dataObject.data);\n var backupRevision = this._dataObject.data.backupRevision;\n console.log('[HeartBeat._startSync] backupRevision ', backupRevision);\n var msg = {\n from: this._hypertyUrl,\n to: this._runtimeUrl + '/sm',\n type: 'execute',\n body: {\n method: 'sync',\n params: [this._dataObject.url, backupRevision]\n }\n };\n\n console.log('[HeartBeat._startSync] sending msg ', msg);\n\n this._bus.postMessage(msg);\n }\n }, {\n key: '_watchHeartBeat',\n value: function _watchHeartBeat(rate, onWatchingIsEnabled, callback) {\n // qdo o heartBeat terminar chama callback \n // usa heartBeat Rating para iniciar timer no respectivo \n // campo do DO chamando isHeartBeatActive()\n var _this = this;\n\n var syncFun = callback;\n console.log('[HeartBeat._watchHeartBeat] started watching ', _this.heartBeat);\n\n //let heartBeat = type + 'HeartBeat';\n\n var watcher = setInterval(function () {\n\n if (onWatchingIsEnabled && !_this._isHeartBeatActive(_this.heartBeat, _this._heartBeatRate)) {\n console.log('[HeartBeat._watchHeartBeat] has stopped ', _this._dataObject.data);\n\n clearInterval(watcher);\n syncFun(_this);\n } else if (!onWatchingIsEnabled && this._isHeartBeatActive(_this.heartBeat, _this._heartBeatRate)) {\n console.log('[HeartBeat._watchHeartBeat] has changed to disabled ', _this._dataObject.data);\n\n clearInterval(watcher);\n syncFun();\n }\n }, rate * 1000 * 2);\n }\n }, {\n key: '_onHertbeatStopped',\n value: function _onHertbeatStopped(_this) {\n\n _this._startHeartBeat(_this._heartBeatRate);\n _this._startSync();\n }\n }, {\n key: 'heartBeat',\n get: function get() {\n if (this.heartbeat) return this.heartbeat;else return 0;\n }\n }]);\n return HeartBeat;\n}();\n\nexports.default = HeartBeat;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0hlYXJ0QmVhdC5qcz8yODUzIl0sInNvdXJjZXNDb250ZW50IjpbIlxuXG5pbXBvcnQgeyBzZWNvbmRzU2luY2VFcG9jaCB9IGZyb20gJy4uL3V0aWxzL3V0aWxzLmpzJztcblxuLyoqXG4gKiBDbGFzcyB0byBoYW5kbGUgQ2hpbGRyZW4gRGF0YSBPYmplY3QgSGVhcnQgYmVhdHMgXG4gKiByZXF1aXJlZCB0byBtYW5hZ2Ugc3luY2hyb25pc2F0aW9uIHdpdGggcmVtb3RlIHN0b3JhZ2Ugc2VydmVycy5cbiAqL1xuY2xhc3MgSGVhcn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FDQTtBQUNBO0FBRUE7QUFFQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBckhBO0FBQ0E7QUFHQTs7Ozs7QUF1SEE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///486\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _FileHypertyResource = __webpack_require__(488);\n\nvar _FileHypertyResource2 = _interopRequireDefault(_FileHypertyResource);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HypertyResourceFactory = function () {\n\n /**\n * HypertyResourceFactory constructor\n *\n */\n\n function HypertyResourceFactory() {\n (0, _classCallCheck3.default)(this, HypertyResourceFactory);\n }\n\n (0, _createClass3.default)(HypertyResourceFactory, [{\n key: 'createHypertyResource',\n value: function createHypertyResource(isSender, type, metadata) {\n var newHypertyResource = void 0;\n\n switch (type) {\n case 'file':\n newHypertyResource = new _FileHypertyResource2.default(isSender, metadata);\n break;\n default:\n throw new Error('[HypertyResourceFactory.createHypertyResource] not supported type: ', type);\n break;\n }\n\n return newHypertyResource;\n }\n }, {\n key: 'createHypertyResourceWithContent',\n value: function createHypertyResourceWithContent(isSender, type, content, metadata) {\n var newHypertyResource = void 0;\n\n return new _promise2.default(function (resolve) {\n\n switch (type) {\n case 'file':\n newHypertyResource = new _FileHypertyResource2.default(isSender, metadata);\n break;\n default:\n reject();\n break;\n }\n\n newHypertyResource.init(content).then(function () {\n return newHypertyResource.save(); // skip save?\n }).then(function () {\n resolve(newHypertyResource);\n });\n });\n }\n }]);\n return HypertyResourceFactory;\n}(); /**\n * The Hyperty Resource Data Model is used to model resouces handled by Hyperties and Data Objects including chat messages, files, real time human audio and video..\n *\n */\n\nexports.default = HypertyResourceFactory;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0h5cGVydHlSZXNvdXJjZUZhY3RvcnkuanM/YTY1NiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogVGhlIEh5cGVydHkgUmVzb3VyY2UgRGF0YSBNb2RlbCBpcyB1c2VkIHRvIG1vZGVsIHJlc291Y2VzIGhhbmRsZWQgYnkgSHlwZXJ0aWVzIGFuZCBEYXRhIE9iamVjdHMgaW5jbHVkaW5nIGNoYXQgbWVzc2FnZXMsIGZpbGVzLCByZWFsIHRpbWUgaHVtYW4gYXVkaW8gYW5kIHZpZGVvLi5cbipcbiovXG5cbmltcG9ydCBGaWxlSHlwZXJ0eVJlc291cmNlIGZyb20gJy4vRmlsZUh5cGVydHlSZXNvdXJjZSc7XG5cbmNsYXNzIEh5cGVydHlSZXNvdXJjZUZhY3Rvcnkge1xuXG4gIC8qKlxuICAqIEh5cGVydHlSZXNvdXJjZUZhY3RvcnkgY29uc3RydWN0b3JcbiAgKlxuICAqL1xuXG4gIGNvbnN0cnVjdG9yKCkge1xuXG4gIH1cblxuICBjcmVhdGVIeXBlcnR5UmVzb3VyY2UoaXNTZW5kZXIsIHR5cGUsIG1ldGFkYXRhKSB7XG4gICAgbGV0IG5ld0h5cGVydHlSZXNvdXJjZTtcblxuICAgIHN3aXRjaCAodHlwZSkge1xuICAgICAgY2FzZSAnZmlsZSc6XG4gICAgICAgIG5ld0h5cGVydHlSZXNvdXJjZSA9IG5ldyBGaWxlSHlwZXJ0eVJlc291cmNlKGlzU2VuZGVyLCBtZXRhZGF0YSk7XG4gICAgICAgIG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yY2UvSHlwZXJ0eVJlc291cmNlRmFjdG9yeS5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBS0E7QUFDQTs7Ozs7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBS0E7QUFBQTtBQUVBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTkE7QUFDQTtBQVFBO0FBRUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQU5BO0FBQ0E7QUFRQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTs7O0FBeERBOzs7OztBQTJEQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///487\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _HypertyResource2 = __webpack_require__(489);\n\nvar _HypertyResource3 = _interopRequireDefault(_HypertyResource2);\n\nvar _utils = __webpack_require__(6);\n\nvar _ImageTools = __webpack_require__(490);\n\nvar _ImageTools2 = _interopRequireDefault(_ImageTools);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('FileHypertyResource'); /**\n * The Hyperty Resource Data Model is used to model resouces handled by Hyperties and Data Objects including chat messages, files, real time human audio and video..\n *\n */\n\n// Log System\n\nvar FileHypertyResource = function (_HypertyResource) {\n (0, _inherits3.default)(FileHypertyResource, _HypertyResource);\n\n /**\n * FileHypertyResource constructor\n *\n * @param {URL} owner HypertyURL of the Hyperty handling this resource\n * @param {URL} runtime Runtime URL where this resource is hosted\n * @param {Bus} bus sandbox message bus\n * @param {DataObject} parent Parent Data Object where the HypertyResource is handled as a child\n * @param {File} file file to be encoded as HypertyResource\n * @param {Boolean} isReporter indicates if parent is Reporter or an Observer\n * @param {Array} input optional input parameters\n */\n\n function FileHypertyResource(isSender, input) {\n (0, _classCallCheck3.default)(this, FileHypertyResource);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (FileHypertyResource.__proto__ || (0, _getPrototypeOf2.default)(FileHypertyResource)).call(this, isSender, input));\n\n var _this = _this2;\n\n _this.metadata.resourceType = 'file';\n\n return _this2;\n }\n\n (0, _createClass3.default)(FileHypertyResource, [{\n key: 'init',\n value: function init(file) {\n var _this = this;\n\n if (!file) throw new Error('[FileHypertyResource.constructor] missing mandatory *file* input ');\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._metadata.name = file.name;\n _this._metadata.lastModified = file.lastModified;\n _this._metadata.size = file.size;\n _this._metadata.mimetype = file.type;\n\n log.log('[FileHypertyResource.init] file: ', file);\n\n if (_this._isSender) {\n\n var mimetype = file.type.split('/')[0];\n\n switch (mimetype) {\n case 'image':\n _this._getImagePreview(file).then(function (preview) {\n _this._metadata.preview = preview;\n _this._content = file;\n resolve();\n });\n break;\n default:\n _this._content = file;\n resolve();\n break;\n }\n\n // if too big lets store as File and asArray Buffer\n\n // if (file.size > _this.arraybufferSizeLimit) {\n /* } else {\n let reader = new FileReader();\n reader.onload = function(theFile) {\n log.log('[FileHypertyResource.init] file loaded ', theFile);\n _this._content = theFile.target.result;\n resolve();\n }\n reader.readAsArrayBuffer(file);\n }*/\n } else {\n _this._content = file.content;\n if (file.preview) _this._metadata.preview = file.preview;\n resolve();\n }\n });\n }\n }, {\n key: '_getImagePreview',\n value: function _getImagePreview(image) {\n var reader = new FileReader();\n return new _promise2.default(function (resolve, reject) {\n\n _ImageTools2.default.resize(image, {\n width: 100, // maximum width\n height: 100 // maximum height\n }, function (blob, didItResize) {\n // didItResize will be true if it managed to resize it, otherwise false (and will return the original file as 'blob')\n if (didItResize) {\n reader.readAsDataURL(blob);\n\n reader.onload = function (theImage) {\n resolve(theImage.target.result);\n };\n } else {\n log.warn('[FileHypertyResource._getImagePreview] unable to create image preview from original image ');\n resolve(undefined);\n }\n });\n });\n }\n }, {\n key: 'toMessage',\n\n\n /**\n * Share file as a data object child of a data object parent\n *\n * @param {string} children Data Object Parent children name where the file is shared\n */\n\n /* share(children) {\n let _this = this;\n \n return new Promise(function(resolve, reject) {\n //to be improved and adapted\n \n if (!_this._isSender) return reject('[FileHypertyResource.share] Observers can not share files');\n \n let file2share = _this._metadata;\n file2share.type = _this._type;\n \n _this._parent.addChild(children, file2share).then(function(dataObjectChild) {\n log.log('[FileHypertyResource.share] object child: ', dataObjectChild);\n \n let sharedFile = dataObjectChild.data;\n \n resolve(sharedFile);\n \n }).catch(function(reason) {\n log.error('Reason:', reason);\n reject(reason);\n });\n \n });\n \n }*/\n\n /**\n * Returns file content optimised to be displayed in a message line\n *\n * @param {string} children Data Object Parent children name where the file is shared\n */\n\n value: function toMessage() {\n //TODO: to be implemented. It should return HTML with img attribute as a thumbnail plus the name.\n }\n }, {\n key: 'name',\n get: function get() {\n var _this = this;\n return _this._metadata.name;\n }\n }, {\n key: 'preview',\n get: function get() {\n var _this = this;\n return _this._metadata.preview;\n }\n }]);\n return FileHypertyResource;\n}(_HypertyResource3.default);\n\nexports.default = FileHypertyResource;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0ZpbGVIeXBlcnR5UmVzb3VyY2UuanM/ZjM5YiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogVGhlIEh5cGVydHkgUmVzb3VyY2UgRGF0YSBNb2RlbCBpcyB1c2VkIHRvIG1vZGVsIHJlc291Y2VzIGhhbmRsZWQgYnkgSHlwZXJ0aWVzIGFuZCBEYXRhIE9iamVjdHMgaW5jbHVkaW5nIGNoYXQgbWVzc2FnZXMsIGZpbGVzLCByZWFsIHRpbWUgaHVtYW4gYXVkaW8gYW5kIHZpZGVvLi5cbipcbiovXG5cbi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignRmlsZUh5cGVydHlSZXNvdXJjZScpO1xuXG5pbXBvcnQgSHlwZXJ0eVJlc291cmNlIGZyb20gJy4vSHlwZXJ0eVJlc291cmNlJztcbmltcG9ydCB7IGRlZXBDbG9uZSB9IGZyb20gJy4uL3V0aWxzL3V0aWxzLmpzJztcbmltcG9ydCBJbWFnZVRvb2xzIGZyb20gJy4uL3V0aWxzL0ltYWdlVG9vbHMuanMnO1xuXG5cbmNsYXNzIEZpbGVIeXBlcnR5UmVzb3VyY2UgZXh0ZW5kcyBIeXBlcnR5UmVzb3VyY2Uge1xuXG4gIC8qKlxuICAqIEZpbGVIeXBlcnR5UmVzb3VyY2UgY29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UNBO0FBQ0E7QUFGQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBY0E7Ozs7OztBQU1BOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUEyQkE7Ozs7OztBQU1BO0FBQ0E7QUFDQTs7O0FBbkRBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBdEhBO0FBQ0E7QUFxS0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///488\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DataObjectChild2 = __webpack_require__(208);\n\nvar _DataObjectChild3 = _interopRequireDefault(_DataObjectChild2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('HypertyResource'); /**\n * The Hyperty Resource Data Model is used to model resouces handled by Hyperties and Data Objects including chat messages, files, real time human audio and video..\n *\n */\n\n// Log System\n\nvar HypertyResource = function (_DataObjectChild) {\n (0, _inherits3.default)(HypertyResource, _DataObjectChild);\n\n /**\n * HypertyResource constructor\n *\n * @param {URL} localRuntimeURL RuntimeURL of local runtime\n * @param {URL} input.owner HypertyURL of the Hyperty handling this resource\n * @param {URL} input.runtime Runtime URL where this resource is hosted\n * @param {Bus} input.bus sandbox message bus\n * @param {DataObject} input.parent Parent Data Object where the HypertyResource is handled as a child\n * @param {Boolean} isSender indicates if parent is Reporter or an Observer\n * @param {Array} input optional input parameters\n */\n\n function HypertyResource(isSender, input) {\n (0, _classCallCheck3.default)(this, HypertyResource);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (HypertyResource.__proto__ || (0, _getPrototypeOf2.default)(HypertyResource)).call(this, input));\n\n var _this = _this2;\n\n _this.arraybufferSizeLimit = 5242880; //above this limit content is not saved as ArrayBuffer\n\n _this._isSender = isSender;\n\n _this._localStorageURL = _this._parentObject._syncher._runtimeUrl + '/storage';\n\n return _this2;\n }\n\n (0, _createClass3.default)(HypertyResource, [{\n key: 'save',\n\n\n /*\n set parent(parent) {\n let _this = this;\n _this._parent = parent;\n }*/\n\n value: function save() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n from: _this._owner,\n to: _this._localStorageURL,\n type: 'create',\n body: { value: (0, _utils.deepClone)(_this._metadata) }\n };\n\n var callback = function callback(reply) {\n log.info('[HypertyResource.save] reply: ', reply);\n _this._bus.removeResponseListener(_this._owner, reply.id);\n if (reply.body.code === 200) {\n if (reply.body.value) {\n if (!_this._metadata.contentURL) _this._metadata.contentURL = [];\n _this._metadata.contentURL.push(reply.body.value);\n }\n resolve();\n } else reject(reply.body.code + ' ' + reply.body.desc);\n };\n\n msg.body.value.content = _this._content;\n\n _this._bus.postMessage(msg, callback, false);\n });\n }\n\n /**\n * Function to Read HypertyResource\n *\n * @param {} callback callback to be called with progress information in terms of percentage\n * @return {Promise} input optional input parameters\n */\n\n }, {\n key: 'read',\n value: function read(callback) {\n var _this = this;\n log.info('[HypertyResource.read] ', this);\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this.content) {\n resolve(_this);\n } else {\n\n //TODO: use an iteration to get online runtime storages when some are offline\n var storage = _this._getBestContentURL(_this._metadata.contentURL);\n\n log.log('Storage:', storage);\n\n var msg = {\n from: _this._owner,\n to: storage.url,\n type: 'read',\n body: { resource: storage.url + '/' + storage.resource, p2p: true }\n };\n\n if (_this.metadata.p2pRequester && _this.metadata.p2pHandler) {\n msg.body.p2pRequester = _this.metadata.p2pRequester;\n msg.body.p2pHandler = _this.metadata.p2pHandler;\n }\n\n // get the resource first on the Local Hyperty Resource Storage;\n _this._getBestResource(msg, callback).then(function (reply) {\n log.info('[HypertyResource] - get locally the resource:', reply);\n resolve(_this);\n }).catch(function (reply) {\n\n log.warn('[HypertyResource] - get locally the resource fail', reply);\n\n // Generate new message to not use the same id of the last one;\n var msg = {\n from: _this._owner,\n to: storage.remoteURL,\n type: 'read',\n body: { resource: storage.remoteURL + '/' + storage.resource, p2p: true }\n };\n\n if (_this.metadata.p2pRequester && _this.metadata.p2pHandler) {\n msg.body.p2pRequester = _this.metadata.p2pRequester;\n msg.body.p2pHandler = _this.metadata.p2pHandler;\n }\n\n // get the resource on the Remote Hyperty Resource Storage;\n _this._getBestResource(msg, callback).then(function (reply) {\n log.warn('[HypertyResource] - get remotely the resource', reply);\n resolve(_this);\n }).catch(function (reply) {\n log.warn('[HypertyResource] - get remotely the resource fail', reply);\n reject(reply.body.code + ' ' + reply.body.desc);\n });\n });\n }\n });\n }\n }, {\n key: '_getBestResource',\n value: function _getBestResource(msg, inProgressCallback) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var waitForResponse = setTimeout(function () {\n\n // If Reporter does not reply the promise is rejected\n _this._bus.removeResponseListener(_this._owner, id);\n\n msg.body.code = 408;\n msg.body.desc = 'Response timeout';\n\n return reject(msg);\n }, 3000);\n\n var callback = function callback(reply) {\n log.log('[HypertyResource.read] reply: ', reply);\n var id = reply.id;\n\n clearTimeout(waitForResponse);\n\n switch (reply.body.code) {\n case 200:\n _this._content = reply.body.value.content;\n\n // save locally if not too big\n if (reply.body.value.size < _this.arraybufferSizeLimit) {\n _this.save();\n }\n\n _this._bus.removeResponseListener(_this._owner, id);\n resolve(reply);\n\n break;\n\n case 183:\n inProgressCallback(reply.body.value);\n break;\n\n default:\n _this._bus.removeResponseListener(_this._owner, id);\n reject(reply);\n break;\n }\n };\n\n var id = _this._bus.postMessage(msg, callback, false);\n });\n }\n\n // Remove Hyperty from the local storage\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n log.info('[HypertyResource.delete]', _this.metadata);\n\n var msg = {\n from: _this._owner,\n to: _this._localStorageURL,\n type: 'delete',\n body: { resources: _this.metadata.contentURL }\n };\n\n return new _promise2.default(function (resolve) {\n _this._bus.postMessage(msg, function (reply) {\n if (reply.body.code < 300) resolve(true);else resolve(false);\n });\n });\n }\n }, {\n key: '_getBestContentURL',\n value: function _getBestContentURL(contentURLList) {\n\n var _this = this;\n\n var contentURL = contentURLList[0];\n var splitedResource = contentURL.substr(contentURL.lastIndexOf('/') + 1);\n var url = _this._localStorageURL; // contentURL.substr(0, contentURL.lastIndexOf('/'));\n var remoteResource = contentURL.substr(0, contentURL.lastIndexOf('/'));\n\n return { url: url, resource: splitedResource, remoteURL: remoteResource };\n }\n }, {\n key: 'resourceType',\n get: function get() {\n var _this = this;\n return _this.metadata.resourceType;\n }\n }, {\n key: 'mimetype',\n get: function get() {\n var _this = this;\n return _this._metadata.type;\n }\n }, {\n key: 'content',\n get: function get() {\n var _this = this;\n return _this._content;\n }\n }, {\n key: 'contentURL',\n get: function get() {\n var _this = this;\n return _this._metadata.contentURL;\n }\n }, {\n key: 'shareable',\n get: function get() {\n var _this = this;\n var shareable = (0, _get3.default)(HypertyResource.prototype.__proto__ || (0, _getPrototypeOf2.default)(HypertyResource.prototype), 'metadata', this);\n shareable.resourceType = _this.resourceType;\n return shareable;\n }\n }]);\n return HypertyResource;\n}(_DataObjectChild3.default);\n\nexports.default = HypertyResource;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDg5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0h5cGVydHlSZXNvdXJjZS5qcz82NWVjIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBUaGUgSHlwZXJ0eSBSZXNvdXJjZSBEYXRhIE1vZGVsIGlzIHVzZWQgdG8gbW9kZWwgcmVzb3VjZXMgaGFuZGxlZCBieSBIeXBlcnRpZXMgYW5kIERhdGEgT2JqZWN0cyBpbmNsdWRpbmcgY2hhdCBtZXNzYWdlcywgZmlsZXMsIHJlYWwgdGltZSBodW1hbiBhdWRpbyBhbmQgdmlkZW8uLlxuKlxuKi9cblxuLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdIeXBlcnR5UmVzb3VyY2UnKTtcblxuaW1wb3J0IHsgZGVlcENsb25lIH0gZnJvbSAnLi4vdXRpbHMvdXRpbHMuanMnO1xuaW1wb3J0IERhdGFPYmplY3RDaGlsZCBmcm9tICcuLi9zeW5jaGVyL0RhdGFPYmplY3RDaGlsZC5qcyc7XG5cbmNsYXNzIEh5cGVydHlSZXNvdXJjZSBleHRlbmRzIERhdGFPYmplY3RDaGlsZCB7XG5cbiAgLyoqXG4gICog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cbiAgICAgICAgX3RoaXMuX2J1cy5yZW1vdmVSZXNwb25zZUxpc3RlbmVyKF90aGlzLl9vd25lciwgaWQpO1xuXG4gICAgICAgIG1zZy5ib2R5LmNvZGUgPSA0MDg7XG4gICAgICAgIG1zZy5ib2R5LmRlc2MgPSAnUmVzcG9uc2UgdGltZW91dCdcblxuICAgICAgICByZXR1cm4gcmVqZWN0KG1zZyk7XG5cbiAgICAgIH0sIDMwMDApO1xuXG4gICAgICBsZXQgY2FsbGJhY2sgPSAocmVwbHkpID0+IHtcbiAgICAgICAgbG9nLmxvZygnW0h5cGVydHlSZXNvdXJjZS5yZWFkXSByZXBseTogJywgcmVwbHkpO1xuICAgICAgICBsZXQgaWQgPSByZXBseS5pZDtcblxuICAgICAgICBjbGVhclRpbWVvdXQod2FpdEZvclJlc3BvbnNlKTtcblxuICAgICAgICBzd2l0Y2ggKHJlcGx5LmJvZHkuY29kZSkge1xuICAgICAgICAgIGNhc2UgMjAwOlxuICAgICAgICAgICAgX3RoaXMuX2NvbnRlbnQgPSByZXBseS5ib2R5LnZhbHVlLmNvbnRlbnQ7XG5cbiAgICAgICAgICAgIC8vIHNhdmUgbG9jYWxseSBpZiBub3QgdG9vIGJpZ1xuICAgICAgICAgICAgaWYgKHJlcGx5LmJvZHkudmFsdWUuc2l6ZSA8IF90aGlzLmFycmF5YnVmZmVyU2l6ZUxpbWl0KSB7XG4gICAgICAgICAgICAgIF90aGlzLnNhdmUoKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgX3RoaXMuX2J1cy5yZW1vdmVSZXNwb25zZUxpc3RlbmVyKF90aGlzLl9vd25lciwgaWQpO1xuICAgICAgICAgICAgcmVzb2x2ZShyZXBseSk7XG5cbiAgICAgICAgICAgIGJyZWFrO1xuXG4gICAgICAgICAgY2FzZSAxODM6XG4gICAgICAgICAgICBpblByb2dyZXNzQ2FsbGJhY2socmVwbHkuYm9keS52YWx1ZSk7XG4gICAgICAgICAgICBicmVhaztcblxuICAgIC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7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBOzs7QUFsT0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBbkRBO0FBQ0E7QUFnUUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///489\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar hasBlobConstructor = typeof Blob !== 'undefined' && function () {\n try {\n return Boolean(new Blob());\n } catch (e) {\n return false;\n }\n}();\n\nvar hasArrayBufferViewSupport = hasBlobConstructor && typeof Uint8Array !== 'undefined' && function () {\n try {\n return new Blob([new Uint8Array(100)]).size === 100;\n } catch (e) {\n return false;\n }\n}();\n\nvar hasToBlobSupport = typeof HTMLCanvasElement !== \"undefined\" ? HTMLCanvasElement.prototype.toBlob : false;\n\nvar hasBlobSupport = hasToBlobSupport || typeof Uint8Array !== 'undefined' && typeof ArrayBuffer !== 'undefined' && typeof atob !== 'undefined';\n\nvar hasReaderSupport = typeof FileReader !== 'undefined' || typeof URL !== 'undefined';\n\nvar ImageTools = function () {\n function ImageTools() {\n (0, _classCallCheck3.default)(this, ImageTools);\n }\n\n (0, _createClass3.default)(ImageTools, null, [{\n key: 'resize',\n value: function resize(file, maxDimensions, callback) {\n if (typeof maxDimensions === 'function') {\n callback = maxDimensions;\n maxDimensions = {\n width: 640,\n height: 480\n };\n }\n\n var maxWidth = maxDimensions.width;\n var maxHeight = maxDimensions.height;\n\n if (!ImageTools.isSupported() || !file.type.match(/image.*/)) {\n callback(file, false);\n return false;\n }\n\n if (file.type.match(/image\\/gif/)) {\n // Not attempting, could be an animated gif\n callback(file, false);\n // TODO: use https://github.com/antimatter15/whammy to convert gif to webm\n return false;\n }\n\n var image = document.createElement('img');\n\n image.onload = function (imgEvt) {\n var width = image.width;\n var height = image.height;\n var isTooLarge = false;\n\n if (width >= height && width > maxDimensions.width) {\n // width is the largest dimension, and it's too big.\n height *= maxDimensions.width / width;\n width = maxDimensions.width;\n isTooLarge = true;\n } else if (height > maxDimensions.height) {\n // either width wasn't over-size or height is the largest dimension\n // and the height is over-size\n width *= maxDimensions.height / height;\n height = maxDimensions.height;\n isTooLarge = true;\n }\n\n if (!isTooLarge) {\n // early exit; no need to resize\n callback(file, false);\n return;\n }\n\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n\n var ctx = canvas.getContext('2d');\n ctx.drawImage(image, 0, 0, width, height);\n\n if (hasToBlobSupport) {\n canvas.toBlob(function (blob) {\n callback(blob, true);\n }, file.type);\n } else {\n var blob = ImageTools._toBlob(canvas, file.type);\n callback(blob, true);\n }\n };\n ImageTools._loadImage(image, file);\n\n return true;\n }\n }, {\n key: '_toBlob',\n value: function _toBlob(canvas, type) {\n var dataURI = canvas.toDataURL(type);\n var dataURIParts = dataURI.split(',');\n var byteString = void 0;\n if (dataURIParts[0].indexOf('base64') >= 0) {\n // Convert base64 to raw binary data held in a string:\n byteString = atob(dataURIParts[1]);\n } else {\n // Convert base64/URLEncoded data component to raw binary data:\n byteString = decodeURIComponent(dataURIParts[1]);\n }\n var arrayBuffer = new ArrayBuffer(byteString.length);\n var intArray = new Uint8Array(arrayBuffer);\n\n for (var i = 0; i < byteString.length; i += 1) {\n intArray[i] = byteString.charCodeAt(i);\n }\n\n var mimeString = dataURIParts[0].split(':')[1].split(';')[0];\n var blob = null;\n\n if (hasBlobConstructor) {\n blob = new Blob([hasArrayBufferViewSupport ? intArray : arrayBuffer], { type: mimeString });\n } else {\n var bb = new BlobBuilder();\n bb.append(arrayBuffer);\n blob = bb.getBlob(mimeString);\n }\n\n return blob;\n }\n }, {\n key: '_loadImage',\n value: function _loadImage(image, file, callback) {\n if (typeof URL === 'undefined') {\n var reader = new FileReader();\n reader.onload = function (evt) {\n image.src = evt.target.result;\n if (callback) {\n callback();\n }\n };\n reader.readAsDataURL(file);\n } else {\n image.src = URL.createObjectURL(file);\n if (callback) {\n callback();\n }\n }\n }\n }, {\n key: 'isSupported',\n value: function isSupported() {\n return typeof HTMLCanvasElement !== 'undefined' && hasBlobSupport && hasReaderSupport;\n }\n }]);\n return ImageTools;\n}();\n\nexports.default = ImageTools;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9JbWFnZVRvb2xzLmpzPzVmMDkiXSwic291cmNlc0NvbnRlbnQiOlsibGV0IGhhc0Jsb2JDb25zdHJ1Y3RvciA9IHR5cGVvZihCbG9iKSAhPT0gJ3VuZGVmaW5lZCcgJiYgKGZ1bmN0aW9uICgpIHtcbiAgICB0cnkge1xuICAgICAgICByZXR1cm4gQm9vbGVhbihuZXcgQmxvYigpKTtcbiAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG59KCkpO1xuXG5sZXQgaGFzQXJyYXlCdWZmZXJWaWV3U3VwcG9ydCA9IGhhc0Jsb2JDb25zdHJ1Y3RvciAmJiB0eXBlb2YoVWludDhBcnJheSkgIT09ICd1bmRlZmluZWQnICYmIChmdW5jdGlvbiAoKSB7XG4gICAgdHJ5IHtcbiAgICAgICAgcmV0dXJuIG5ldyBCbG9iKFtuZXcgV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C8gd2lkdGg7XG4gICAgICAgICAgICAgICAgd2lkdGggPSBtYXhEaW1lbnNpb25zLndpZHRoO1xuICAgICAgICAgICAgICAgIGlzVG9vTGFyZ2UgPSB0cnVlO1xuICAgICAgICAgICAgfSBlbHNlIGlmIChoZWlnaHQgPiBtYXhEaW1lbnNpb25zLmhlaWdodCkge1xuICAgICAgICAgICAgICAgIC8vIGVpdGhlciB3aWR0aCB3YXNuJ3Qgb3Zlci1zaXplIG9yIGhlaWdodCBpcyB0aGUgbGFyZ2VzdCBkaW1lbnNpb25cbiAgICAgICAgICAgICAgICAvLyBhbmQgdGhlIGhlaWdodCBpcyBvdmVyLXNpemVcbiAgICAgICAgICAgICAgICB3aWR0aCAqPSBtYXhEaW1lbnNpb25zLmhlaWdodCAvIGhlaWdodDtcbiAgICAgICAgICAgICAgICBoZWlnaHQgPSBtYXhEaW1lbnNpb25zLmhlaWdodDtcbiAgICAgICAgICAgICAgICBpc1Rvb0xhcmdlID0gdHJ1ZTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKCFpc1Rvb0xhcmdlKSB7XG4gICAgICAgICAgICAgICAgLy8gZWFybHkgZXhpdDsgbm8gbmVlZCB0byByZXNpemVcbiAgICAgICAgICAgICAgICBjYWxsYmFjayhmaWxlLCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBsZXQgY2FudmFzID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnY2FudmFzJyk7XG4gICAgICAgICAgICBjYW52YXMud2lkdGggPSB3aWR0aDtcbiAgICAgICAgICAgIGNhbnZhcy5oZWlnaHQgPSBoZWlnaHQ7XG5cbiAgICAgICAgICAgIGxldCBjdHggPSBjYW52YXMuZ2V0Q29udGV4dCgnMmQnKTtcbiAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoaW1hZ2UsIDAsIDAsIHdpZHRoLCBoZWlnaHQpO1xuXG4gICAg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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUtBOzs7OztBQS9IQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///490\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DataObject2 = __webpack_require__(206);\n\nvar _DataObject3 = _interopRequireDefault(_DataObject2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectObserver'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n\nvar FilterType = { ANY: 'any', START: 'start', EXACT: 'exact' };\n\n/**\n * The class returned from the Syncher subscribe call.\n * To be used as an observation point from a DataObjectReporter change.\n */\n\nvar DataObjectObserver = function (_DataObject) {\n (0, _inherits3.default)(DataObjectObserver, _DataObject);\n\n /* private\n _changeListener: MsgListener\n ----event handlers----\n _filters: {: {type: , callback: } }\n */\n\n /**\n * @ignore\n * Should not be used directly by Hyperties. It's called by the Syncher.subscribe method\n */\n\n //TODO: For Further Study\n function DataObjectObserver(input) {\n (0, _classCallCheck3.default)(this, DataObjectObserver);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (DataObjectObserver.__proto__ || (0, _getPrototypeOf2.default)(DataObjectObserver)).call(this, input));\n //todo: check why\n //input.initialData = input.initialData.data;\n\n var _this = _this2;\n\n _this._version = input.version;\n _this._filters = {};\n\n _this._syncObj.observe(function (event) {\n _this._onFilter(event);\n });\n\n _this._allocateListeners();\n return _this2;\n }\n\n /**\n * Sync Data Object Observer with last version of Data Object Reporter. Useful for Resumes\n */\n\n\n (0, _createClass3.default)(DataObjectObserver, [{\n key: 'sync',\n value: function sync() {\n\n var _this = this;\n log.info('[DataObjectObserver_sync] synchronising ');\n\n return new _promise2.default(function (resolve, reject) {\n\n var criteria = {};\n\n // if (this.metadata.backupRevision) criteria.backupRevision = this.metadata.backupRevision;\n\n _this._syncher.read(_this._metadata.url, criteria).then(function (value) {\n log.info('[DataObjectObserver_sync] value to sync: ', value);\n\n (0, _assign2.default)(_this.data, (0, _utils.deepClone)(value.data));\n\n _this._version = value.version;\n\n _this._metadata.lastModified = value.lastModified;\n\n //TODO: check first if there are new childrenObjects to avoid overhead\n\n if (value.childrenObjects) {\n _this.resumeChildrens(value.childrenObjects);\n _this._storeChildrens();\n resolve(true);\n } else resolve(true);\n\n /*if (value.version != _this._version) {\n log.info('[DataObjectObserver_sync] updating existing data: ', _this.data);\n Object.assign(_this.data || {}, deepClone(value.data));\n _this._metadata = deepClone(value);\n delete _this._metadata.data;\n _this._version = value.version;\n } else {\n log.info('[DataObjectObserver_sync] existing data is updated: ', value);\n }*/\n }).catch(function (reason) {\n log.info('[DataObjectObserver_sync] sync failed: ', reason);\n resolve(false);\n });\n });\n }\n }, {\n key: '_storeChildrens',\n value: function _storeChildrens() {\n var _this = this;\n\n var childrens = {};\n\n //TODO: to be sent to HypertyResourceStorage when ready to handle Chat Messages\n\n (0, _keys2.default)(_this._childrenObjects).forEach(function (childId) {\n var children = _this._childrenObjects;\n // childrens[childrenResource] = {};\n\n // Object.keys(children).forEach((childId) => {\n childrens[childId] = {};\n childrens[childId].value = children[childId].metadata;\n childrens[childId].identity = children[childId].identity;\n // });\n });\n\n var msg = {\n\n from: _this._owner,\n to: _this._syncher._subURL,\n type: 'create',\n body: {\n resource: _this._url,\n attribute: 'childrenObjects',\n value: childrens\n }\n };\n\n _this._bus.postMessage(msg);\n }\n }, {\n key: '_allocateListeners',\n value: function _allocateListeners() {\n (0, _get3.default)(DataObjectObserver.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectObserver.prototype), '_allocateListeners', this).call(this);\n var _this = this;\n\n _this._changeListener = _this._bus.addListener(_this._url + '/changes', function (msg) {\n if (msg.type === 'update') {\n log.log('DataObjectObserver-' + _this._url + '-RCV: ', msg);\n _this._changeObject(_this._syncObj, msg);\n }\n });\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n (0, _get3.default)(DataObjectObserver.prototype.__proto__ || (0, _getPrototypeOf2.default)(DataObjectObserver.prototype), '_releaseListeners', this).call(this);\n var _this = this;\n\n _this._changeListener.remove();\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n\n if (_this._heartBeat) _this._heartBeat.stop();\n\n _this._deleteChildrens().then(function () {\n _this.unsubscribe();\n _this._releaseListeners();\n delete _this._syncher._observers[_this._url];\n });\n }\n\n /**\n * Release and delete object data\n */\n\n }, {\n key: 'unsubscribe',\n value: function unsubscribe() {\n var _this = this;\n\n //FLOW-OUT: this message will be sent to the runtime instance of SyncherManager -> _onLocalUnSubscribe\n var unSubscribeMsg = {\n type: 'unsubscribe', from: _this._owner, to: _this._syncher._subURL,\n body: { resource: _this._url }\n };\n\n _this._bus.postMessage(unSubscribeMsg, function (reply) {\n log.log('DataObjectObserver-UNSUBSCRIBE: ', reply);\n if (reply.body.code === 200) {\n _this._releaseListeners();\n delete _this._syncher._observers[_this._url];\n }\n });\n }\n\n /**\n * Register the change listeners sent by the reporter\n * @param {string} filter - Filter that identifies the field (separated dot path). Accepts * at the end for a more unrestricted filtering.\n * @param {function(event: MsgEvent)} callback\n */\n\n }, {\n key: 'onChange',\n value: function onChange(filter, callback) {\n var key = filter;\n var filterObj = {\n type: FilterType.EXACT,\n callback: callback\n };\n\n var idx = filter.indexOf('*');\n if (idx === filter.length - 1) {\n if (idx === 0) {\n filterObj.type = FilterType.ANY;\n } else {\n filterObj.type = FilterType.START;\n key = filter.substr(0, filter.length - 1);\n }\n }\n\n this._filters[key] = filterObj;\n }\n }, {\n key: '_onFilter',\n value: function _onFilter(event) {\n var _this = this;\n\n (0, _keys2.default)(_this._filters).forEach(function (key) {\n var filter = _this._filters[key];\n if (filter.type === FilterType.ANY) {\n //match anything\n filter.callback(event);\n } else if (filter.type === FilterType.START) {\n //if starts with filter...\n if (event.field.indexOf(key) === 0) {\n filter.callback(event);\n }\n } else if (filter.type === FilterType.EXACT) {\n //exact match\n if (event.field === key) {\n filter.callback(event);\n }\n }\n });\n }\n }, {\n key: 'onDisconnected',\n value: function onDisconnected(callback) {\n var _this3 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3._subscribeRegistration().then(function () {\n _this3._onDisconnected = callback;\n resolve();\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n }, {\n key: '_subscribeRegistration',\n value: function _subscribeRegistration() {\n var _this4 = this;\n\n var msg = {\n type: 'subscribe',\n from: this._owner,\n to: this._syncher._runtimeUrl + '/subscriptions',\n body: {\n resources: [this._url + '/registration']\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this4._bus.postMessage(msg, function (reply) {\n log.log('[DataObjectObserver._subscribeRegistration] ' + _this4._url + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n _this4._generateListener(_this4._url + '/registration');\n resolve();\n } else {\n log.error('Error subscribing registration status for ', _this4._url);\n reject('Error subscribing registration status for ' + _this4._url);\n }\n });\n });\n }\n }, {\n key: '_generateListener',\n value: function _generateListener(notificationURL) {\n var _this = this;\n\n _this._bus.addListener(notificationURL, function (msg) {\n log.log('[DataObjectObserver.registrationNotification] ' + _this._url + ': ', msg);\n if (msg.body.value && msg.body.value === 'disconnected' && _this._onDisconnected) {\n log.log('[DataObjectObserver] ' + _this._url + ': was disconnected ', msg);\n _this._onDisconnected();\n }\n });\n }\n\n /**\n * Requests the reporter to execute a method on the data object\n * @param {string} method - Name of the function to be executed.\n * @param {array} params - array of parameters for the requested function\n * @return {promise}\n */\n\n }, {\n key: 'execute',\n value: function execute(method, params) {\n var _this5 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n type: 'execute',\n from: _this5._owner,\n to: _this._url,\n body: {\n method: method,\n params: params\n }\n };\n\n _this._bus.postMessage(msg, function (reply) {\n log.log('[DataObjectObserver.execute] ' + _this._url + ' rcved reply ', reply);\n\n if (reply.body.code === 200) {\n resolve();\n } else {\n log.warn('[DataObjectObserver.execute] execution of method ' + method + ' was reject by reporter');\n reject('[DataObjectObserver.execute] execution of method ' + method + ' was reject by reporter');\n }\n });\n });\n }\n }]);\n return DataObjectObserver;\n}(_DataObject3.default /* implements SyncStatus */);\n\nexports.default = DataObjectObserver;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data: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DQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7OztBQU9BO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUpBO0FBQ0E7QUFTQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXpUQTtBQUNBO0FBMlRBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///491\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataProvisional'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * @access private\n * This class is responsible for collecting delta changes in remote objects, before the response of subscription reach the observer.\n * It's used in Syncher -> subscribe. The flow is defined as:\n * 1. (observer) --subscribe--\x3e (reporter)\n * 2. (observer) <--delta updates-- (reporter)\n * 3. (observer) <--subscribe response-- (reporter)\n * This means that there could be delta updates transferred before the subscription confirmation.\n * Since there is no DataObjectObserver before the ubscription confirmation, there should be some other object collecting the updates.\n * Provisional data is applied to the DataObjectObserver after confirmation. Or discarded if there is no confirmation.\n */\n\n// Log System\n\nvar DataProvisional = function () {\n /* private\n _childrenListeners: [MsgListener]\n _listener: MsgListener\n _changes: []\n */\n\n function DataProvisional(owner, url, bus, children) {\n (0, _classCallCheck3.default)(this, DataProvisional);\n\n var _this = this;\n\n _this._owner = owner;\n _this._url = url;\n _this._bus = bus;\n _this._children = children;\n\n _this._changes = [];\n _this._allocateListeners();\n }\n\n (0, _createClass3.default)(DataProvisional, [{\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this = this;\n\n _this._listener = _this._bus.addListener(_this._url, function (msg) {\n log.log('DataProvisional-' + _this._url + '-RCV: ', msg);\n _this._changes.push(msg);\n });\n\n /*\n _this._childrenListeners = [];\n if (_this._children) {\n let childBaseURL = url + '/children/';\n _this._children.forEach((child) => {\n let childURL = childBaseURL + child;\n let listener = _this._bus.addListener(childURL, (msg) => {\n //ignore msg sent by himself\n if (msg.from !== owner) {\n log.log(msg);\n }\n });\n _this._childrenListeners.push(listener);\n });\n }*/\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._listener.remove();\n\n /*_this._childrenListeners.forEach((listener) => {\n listener.remove();\n });*/\n }\n }, {\n key: 'apply',\n value: function apply(observer) {\n var _this = this;\n _this._changes.forEach(function (change) {\n observer._changeObject(observer._syncObj, change);\n });\n }\n }, {\n key: 'children',\n get: function get() {\n return this._children;\n }\n }]);\n return DataProvisional;\n}();\n\nexports.default = DataProvisional;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL0RhdGFQcm92aXNpb25hbC5qcz81MjUwIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4qIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW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URL=webpack-internal:///492\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar NotificationHandler = function () {\n function NotificationHandler(bus) {\n (0, _classCallCheck3.default)(this, NotificationHandler);\n\n\n if (!bus) throw Error('[NotificationHandler Constructor] bus input is mandatory');\n this._bus = bus;\n this._onNotificationHandler = {};\n }\n\n (0, _createClass3.default)(NotificationHandler, [{\n key: 'onNotification',\n value: function onNotification(scheme, callback) {\n this._onNotificationHandler[scheme] = callback;\n }\n }, {\n key: 'onCreate',\n value: function onCreate(msg) {\n\n var _this = this;\n // let resource = msg.from.slice(0, -13); //remove \"/subscription\" from the URL\n\n var resource = msg.body.hasOwnProperty('resource') ? msg.body.resource : msg.from.slice(0, -13);\n var dividedURL = (0, _utils.divideURL)(resource);\n var domain = dividedURL.domain;\n var scheme = resource.split('://')[0];\n\n var _error = function _error(reason) {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 400, desc: 'Bad Request: ' + reason }\n });\n };\n\n if (!msg.body.hasOwnProperty('source')) {\n _error('Missing source');\n }\n if (!msg.body.hasOwnProperty('schema')) {\n _error('Missing schema');\n }\n if (!msg.body.hasOwnProperty('value')) {\n _error('Missing value');\n }\n if (!msg.body.hasOwnProperty('identity')) {\n _error('Missing identity');\n }\n\n var event = {\n type: msg.type,\n from: msg.body.source,\n url: resource,\n domain: domain,\n schema: msg.body.schema,\n value: msg.body.value,\n identity: msg.body.identity,\n to: msg.to,\n via: msg.body.via,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType }\n });\n },\n error: function error(reason) {\n _error(reason);\n }\n };\n if (_this._onNotificationHandler[scheme]) {\n console.info('[NotificationHandler] NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler[scheme](event);\n }\n }\n }, {\n key: 'onDelete',\n value: function onDelete(msg) {\n var _this = this;\n\n //remove \"/subscription\" from the URL\n var resource = msg.body.resource;\n\n var object = _this._observers[resource];\n\n var unsubscribe = {\n from: _this.owner,\n to: _this._subURL,\n id: msg.id,\n type: 'unsubscribe',\n body: { resource: msg.body.resource }\n };\n\n _this._bus.postMessage(unsubscribe);\n\n delete _this._observers[resource];\n\n if (object) {\n var event = {\n type: msg.type,\n url: resource,\n identity: msg.body.identity,\n\n ack: function ack(type) {\n var lType = 200;\n if (type) {\n lType = type;\n }\n\n //TODO: any other different options for the release process, like accept but nor release local?\n if (lType === 200) {\n object.delete();\n }\n\n //send ack response message\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: lType, source: _this._owner }\n });\n }\n };\n\n if (_this._onNotificationHandler) {\n log.log('NOTIFICATION-EVENT: ', event);\n _this._onNotificationHandler(event);\n }\n } else {\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 404, source: _this._owner }\n });\n }\n }\n }]);\n return NotificationHandler;\n}(); /**\n * The Notitification Handler is used to handle notifications not processed by the syncher when running in a sandbox.\n */\n\nexports.default = NotificationHandler;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDkzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL05vdGlmaWNhdGlvbkhhbmRsZXIuanM/MzNlMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogVGhlIE5vdGl0aWZpY2F0aW9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FBQ0E7QUF6QkE7QUEyQkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUxBO0FBQ0E7QUFPQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBSUE7QUFyQkE7QUFDQTtBQXVCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFJQTtBQUNBOzs7QUFqSUE7Ozs7QUFvSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///493\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Core IdentityManager interface\n* Class to allow applications to search for Identities registered in runtime-core\n*/\nvar IdentityManager = function () {\n\n /**\n * To initialise the IdentityManager, which will provide the support for hyperties to\n * query about identities registered\n * @param {String} owner owner\n * @param {String} runtimeURL runtimeURL\n * @param {MessageBus} msgbus msgbus\n */\n function IdentityManager(owner, runtimeURL, msgBus) {\n (0, _classCallCheck3.default)(this, IdentityManager);\n\n var _this = this;\n _this.messageBus = msgBus;\n\n _this.domain = (0, _utils.divideURL)(owner).domain;\n _this.owner = owner;\n _this.runtimeURL = runtimeURL;\n }\n\n /**\n * Function to query the runtime registry about the identity to which the hyperty was associated\n * @param {String} type (Optional) type of user info required\n * @param {String} owner (Optional) owner to search for\n * @return {Promise} userURL userURL associated to the hyperty\n */\n\n\n (0, _createClass3.default)(IdentityManager, [{\n key: 'discoverUserRegistered',\n value: function discoverUserRegistered(type, hyperty) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var activeHypertyURL = void 0;\n\n // if any type of search is selected query for that type, otherwise query for default user info\n var searchType = type ? type : '.';\n\n if (!hyperty) {\n activeHypertyURL = _this.owner;\n } else {\n activeHypertyURL = hyperty;\n }\n\n var msg = {\n type: 'read', from: activeHypertyURL, to: _this.runtimeURL + '/registry/', body: { resource: searchType, criteria: activeHypertyURL }\n };\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var userURL = reply.body.resource;\n\n if (userURL && reply.body.code === 200) {\n resolve(userURL);\n } else {\n reject('code: ' + reply.body.code + ' No user was found');\n }\n });\n });\n }\n\n /**\n * Function to query the Identity Module about authenticated identities from a certain domain\n * @param {String} idp idp domain of the identity to be discovered\n * @return {Promise} identity\n */\n\n }, {\n key: 'discoverIdentityPerIdP',\n value: function discoverIdentityPerIdP(idp) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n type: 'read', from: this.owner, to: _this.runtimeURL + '/idm', body: { resource: idp, criteria: 'idp' }\n };\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n resolve(reply.body.value);\n } else {\n reject(reply.body.code + ' ' + reply.body.desc);\n }\n });\n });\n }\n }]);\n return IdentityManager;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = IdentityManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0eU1hbmFnZXIuanM/ZjI3ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuKiBDb3B5cmlnaHQgMjAxNiBBcGl6ZWVcbiogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbipcbiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZX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IC8vXG4vLyBzcmMvaWRlbnRpdHkvSWRlbnRpdHlNYW5hZ2VyLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFzQkE7QUFDQTs7O0FBQ0E7Ozs7QUFJQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFPQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFEQTtBQUNBO0FBR0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBN0dBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFnSEE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///494\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _DiscoveredObject = __webpack_require__(496);\n\nvar _DiscoveredObject2 = _interopRequireDefault(_DiscoveredObject);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Discovery'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* Core Discovery interface\n* Class to allow applications to search for hyperties and DataObjects using the message bus\n*/\nvar Discovery = function () {\n\n /**\n * To initialise the HypertyDiscover, which will provide the support for hyperties to\n * query users registered in outside the internal core.\n * @param {MessageBus} msgbus msgbus\n * @param {RuntimeURL} runtimeURL runtimeURL\n */\n function Discovery(hypertyURL, runtimeURL, msgBus) {\n (0, _classCallCheck3.default)(this, Discovery);\n\n var _this = this;\n _this.messageBus = msgBus;\n _this.runtimeURL = runtimeURL;\n\n _this.domain = (0, _utils.divideURL)(hypertyURL).domain;\n _this.discoveryURL = hypertyURL;\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n\n (0, _createClass3.default)(Discovery, [{\n key: '_isLegacyUser',\n value: function _isLegacyUser(userIdentifier) {\n if (userIdentifier.includes(':') && !userIdentifier.includes('user://')) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerUserProfileData',\n value: function discoverHypertiesPerUserProfileData(userIdentifier, schema, resources) {\n var _this = this;\n var filteredHyperties = [];\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/userprofile/' + userIdentifier\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._isLegacyUser(userIdentifier)) {\n // todo: to reomve when discovery of legcay users are supported\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n reply.body.value.map(function (hyperty) {\n if (hyperty.hypertyID != _this.discoveryURL) filteredHyperties.push(hyperty);\n });\n if (filteredHyperties.length === 0) resolve([]);else {\n log.log(\"[Discovery.discoverHypertiesPerUserProfileData] Reply log: \", filteredHyperties);\n resolve(filteredHyperties);\n }\n } else {\n log.warn(\"[Discovery.discoverHypertiesPerUserProfileData] Error Reply for \" + userIdentifier + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n } else {\n resolve([{ hypertyID: userIdentifier, status: 'live' }]);\n }\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * returns DiscoveredObject\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerUserProfileDataDO',\n value: function discoverHypertiesPerUserProfileDataDO(userIdentifier, schema, resources) {\n var _this2 = this,\n _arguments = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this2.discoverHypertiesPerUserProfileData.apply(_this2, _arguments).then(function (hyperties) {\n resolve(_this2._convertToDiscoveredObject(hyperties));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverDataObjectsPerUserProfileData',\n value: function discoverDataObjectsPerUserProfileData(userIdentifier, schema, resources) {\n var _this = this;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/userprofile/' + userIdentifier\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._isLegacyUser(userIdentifier)) {\n // todo: to reomve when discovery of legcay users are supported\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerUserProfileData] Error Reply for \" + userIdentifier + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n } else {\n resolve([{ hypertyID: userIdentifier, status: 'live' }]);\n }\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerUserProfileDataDO',\n value: function discoverDataObjectsPerUserProfileDataDO(guidURL, schema, resources) {\n var _this3 = this,\n _arguments2 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this3.discoverDataObjectsPerUserProfileData.apply(_this3, _arguments2).then(function (registryObjects) {\n return resolve(_this3._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some GUID\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerGUID',\n value: function discoverHypertiesPerGUID(guidURL, schema, resources) {\n var _this = this;\n var filteredHyperties = [];\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/guid/' + guidURL\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n reply.body.value.map(function (hyperty) {\n if (hyperty.hypertyID != _this.discoveryURL) filteredHyperties.push(hyperty);\n });\n if (filteredHyperties.length === 0) reject('No Hyperty was found');else {\n log.log(\"Reply log: \", filteredHyperties);\n resolve(filteredHyperties);\n }\n } else {\n log.warn(\"[Discovery.discoverHypertiesPerGUID] Error Reply for \" + guidURL + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some GUID\n * returns DiscoveredObject\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerGUIDDO',\n value: function discoverHypertiesPerGUIDDO(guidURL, schema, resources) {\n var _this4 = this,\n _arguments3 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this4.discoverHypertiesPerGUID.apply(_this4, _arguments3).then(function (hyperties) {\n resolve(_this4._convertToDiscoveredObject(hyperties));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some GUID\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerGUID',\n value: function discoverDataObjectsPerGUID(guidURL, schema, resources) {\n var _this = this;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/guid/' + guidURL\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerGUID] Error Reply for \" + guidURL + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} guidURL guid URL e.g user-guid://\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerGUIDDO',\n value: function discoverDataObjectsPerGUIDDO(guidURL, schema, resources) {\n var _this5 = this,\n _arguments4 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this5.discoverDataObjectsPerGUID.apply(_this5, _arguments4).then(function (registryObjects) {\n return resolve(_this5._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHyperties',\n value: function discoverHyperties(user, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n var filteredHyperties = [];\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/user/' + user\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n if (!_this._isLegacyUser(user)) {\n // todo: to reomve when discovery of legcay users are supported\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200 || reply.body.code === 500) {\n reply.body.value.map(function (hyperty) {\n if (hyperty.hypertyID != _this.discoveryURL) filteredHyperties.push(hyperty);\n });\n /* if(filteredHyperties.length === 0)\n reject('No Hyperty was found');\n else {*/\n log.log(\"[Discovery.discoverHyperties] Reply : \", filteredHyperties);\n resolve(filteredHyperties);\n // }\n } else {\n log.warn(\"[Discovery.discoverHyperties] Error Reply for \" + user + \" Reason: \", reply.body.description);\n resolve(filteredHyperties);\n }\n });\n } else {\n resolve([{ hypertyID: user, status: 'live' }]);\n }\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry,\n *returns DiscoveredObject\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHypertiesDO',\n value: function discoverHypertiesDO(user, schema, resources, domain) {\n var _this6 = this,\n _arguments5 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this6.discoverHyperties.apply(_this6, _arguments5).then(function (hyperties) {\n resolve(_this6._convertToDiscoveredObject(hyperties));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /** Advanced Search for DataObjects registered in domain registry\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjects',\n value: function discoverDataObjects(user, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/user/' + user\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjects] Error Reply for \" + user + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsDO',\n value: function discoverDataObjectsDO(user, schema, resources, domain) {\n var _this7 = this,\n _arguments6 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this7.discoverDataObjects.apply(_this7, _arguments6).then(function (registryObjects) {\n return resolve(_this7._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about hyperties registered in domain registry, and\n * return the hyperty information, if found.\n * @param {String} url hyperty URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertyPerURL',\n value: function discoverHypertyPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/hyperty/url/' + url,\n criteria: {\n domain: activeDomain\n }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverHypertyPerURL] Error Reply for \" + url + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about hyperties registered in domain registry, and\n * returns discoveredObject.\n * @param {String} url hyperty URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertyPerURLDO',\n value: function discoverHypertyPerURLDO(url, domain) {\n var _this8 = this,\n _arguments7 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this8.discoverHypertyPerURL.apply(_this8, _arguments7).then(function (hyperty) {\n return resolve(new _DiscoveredObject2.default(hyperty, _this8.runtimeURL, _this8.discoveryURL, _this8.messageBus, _this8));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * return the dataObject information, if found.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectPerURL',\n value: function discoverDataObjectPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/url/' + url,\n criteria: {\n domain: activeDomain\n }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectPerURL] Error Reply for \" + url + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectPerURLDO',\n value: function discoverDataObjectPerURLDO(url, domain) {\n var _this9 = this,\n _arguments8 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this9.discoverDataObjectPerURL.apply(_this9, _arguments8).then(function (registryObject) {\n return resolve(new _DiscoveredObject2.default(registryObject, _this9.runtimeURL, _this9.discoveryURL, _this9.messageBus, _this9));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about an dataObjects registered in domain registry with a given name, and\n * return the dataObjects information, if found.\n * @param {String} name dataObject URL\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerName',\n value: function discoverDataObjectsPerName(name, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/name/' + name\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerName] Error Reply for \" + name + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} name dataObject URL\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerNameDO',\n value: function discoverDataObjectsPerNameDO(name, schema, resources, domain) {\n var _this10 = this,\n _arguments9 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this10.discoverDataObjectsPerName.apply(_this10, _arguments9).then(function (registryObjects) {\n return resolve(_this10._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n\n /**\n * function to request about specific reporter dataObject registered in domain registry, and\n * return the dataObjects from that reporter.\n * @param {String} reporter dataObject reporter\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerReporter',\n value: function discoverDataObjectsPerReporter(reporter, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: _this.runtimeURL + '/discovery/',\n body: {\n resource: '/dataObject/reporter/' + reporter\n }\n };\n\n if (schema || resources) {\n msg.body['criteria'] = {\n resources: resources,\n dataSchemes: schema,\n domain: activeDomain\n };\n } else {\n msg.body['criteria'] = {\n domain: activeDomain\n };\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code === 200) {\n log.log(\"Reply Value Log: \", reply.body.value);\n resolve(reply.body.value);\n } else {\n log.warn(\"[Discovery.discoverDataObjectsPerName] Error Reply for \" + reporter + \" Reason: \", reply.body.description);\n resolve([]);\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * returns discoveredObject.\n * @param {String} name dataObject URL\n * @param {Array} schema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerReporterDO',\n value: function discoverDataObjectsPerReporterDO(reporter, schema, resources, domain) {\n var _this11 = this,\n _arguments10 = arguments;\n\n return new _promise2.default(function (resolve, reject) {\n _this11.discoverDataObjectsPerReporter.apply(_this11, _arguments10).then(function (registryObjects) {\n return resolve(_this11._convertToDiscoveredObject(registryObjects));\n }).catch(function (error) {\n return reject(error);\n });\n });\n }\n }, {\n key: '_convertToDiscoveredObject',\n value: function _convertToDiscoveredObject(registryObjects) {\n var _this12 = this;\n\n return registryObjects.map(function (registryObject) {\n return new _DiscoveredObject2.default(registryObject, _this12.runtimeURL, _this12.discoveryURL, _this12.messageBus, _this12);\n });\n }\n\n /** Advanced Search for dataObjects registered in domain registry\n * @deprecated Deprecated. Use discoverDataObjectsPerName instead\n * @param {String} name name of the dataObject\n * @param {Array} schema (Optional) types of dataObject schemas\n * @param {Array} resources (Optional) types of dataObject resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObject',\n value: function discoverDataObject(name, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n //let userIdentifier = convertToUserURL(user);\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: name,\n criteria: { resources: resources, dataSchemes: schema }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n log.log('[Discovery]', reply);\n\n if (reply.body.code > 299) {\n log.warn(\"[Discovery.discoverDataObject] Error Reply for \" + name + \" Reason: \", reply.body.description);\n return resolve([]);\n }\n\n var hyperties = reply.body.value;\n\n if (hyperties) {\n resolve(hyperties);\n } else {\n resolve([]);\n }\n });\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry\n * @deprecated Deprecated. Use discoverHyperties instead\n * @param {String} user user identifier, either in url or email format\n * @param {Array} schema (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHyperty',\n value: function discoverHyperty(user, schema, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n var userIdentifier = (0, _utils.convertToUserURL)(user);\n\n if (!domain) {\n activeDomain = _this.domain;\n } else {\n activeDomain = domain;\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n log.log('[Discovery.discoverHyperty] ACTIVE DOMAIN -> ', activeDomain, 'user->', user, 'schema->', schema, 'resources->', resources, 'domain->', domain);\n if (user.includes(':') && !user.includes('user://')) {\n log.log('[Discovery.discoverHyperty] ' + user + ' is legacy domain');\n var legacyUser = { userID: user, hypertyID: user, schema: schema, resources: resources };\n return resolve(legacyUser);\n }\n var msg = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: userIdentifier,\n criteria: { resources: resources, dataSchemes: schema }\n }\n };\n\n log.info('[Discovery] msg to send->', msg);\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n log.info('[Discovery] ON discoverHyperty->', reply);\n var hyperties = reply.body.value;\n\n if (hyperties) {\n resolve(hyperties);\n } else {\n reject('No Hyperty was found');\n }\n });\n });\n }\n\n /**\n * function to request about users registered in domain registry, and\n * return the last hyperty instance registered by the user.\n * @deprecated Deprecated. Use discoverHyperty instead\n * @param {email} email\n * @param {domain} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertyPerUser',\n value: function discoverHypertyPerUser(email, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n // Hack for legacy users\n if (email.includes(':') && !email.includes('user://')) {\n log.log('[Discovery.discoverHyperty] ' + email + 'is legacy domain');\n var legacyUser = { id: email, hypertyURL: email, descriptor: 'unknown' };\n return resolve(legacyUser);\n }\n\n if (!domain) {\n activeDomain = _this.domain;\n } else {\n activeDomain = domain;\n }\n\n var identityURL = 'user://' + email.substring(email.indexOf('@') + 1, email.length) + '/' + email.substring(0, email.indexOf('@'));\n\n // message to query domain registry, asking for a user hyperty.\n var message = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: identityURL }\n };\n\n log.info('[Discovery] Message: ', message, activeDomain, identityURL);\n\n //log.info('[Discovery] message READ', message);\n\n _this.messageBus.postMessage(message, function (reply) {\n log.info('[Discovery] message reply', reply);\n\n var hyperty = void 0;\n var mostRecent = void 0;\n var lastHyperty = void 0;\n var value = reply.body.value;\n\n for (hyperty in value) {\n if (value[hyperty].lastModified !== undefined) {\n if (mostRecent === undefined) {\n mostRecent = new Date(value[hyperty].lastModified);\n lastHyperty = hyperty;\n } else {\n var hypertyDate = new Date(value[hyperty].lastModified);\n if (mostRecent.getTime() < hypertyDate.getTime()) {\n mostRecent = hypertyDate;\n lastHyperty = hyperty;\n }\n }\n }\n }\n\n log.info('[Discovery] Last Hyperty: ', lastHyperty, mostRecent);\n\n var hypertyURL = lastHyperty;\n\n if (hypertyURL === undefined) {\n return reject('User Hyperty not found');\n }\n\n var idPackage = {\n id: email,\n descriptor: value[hypertyURL].descriptor,\n hypertyURL: hypertyURL\n };\n\n log.info('[Discovery] ===> hypertyDiscovery messageBundle: ', idPackage);\n resolve(idPackage);\n });\n });\n }\n\n /**\n * function to request about users registered in domain registry, and\n * return the all the hyperties registered by the user\n * @deprecated Deprecated. Use discoverHyperty instead\n * @param {email} email\n * @param {domain} domain (Optional)\n */\n\n }, {\n key: 'discoverHypertiesPerUser',\n value: function discoverHypertiesPerUser(email, domain) {\n var _this = this;\n var activeDomain = void 0;\n log.log('on Function->', email);\n return new _promise2.default(function (resolve, reject) {\n\n if (email.includes(':') && !email.includes('user://')) {\n log.log('[Discovery.discoverHyperty] is legacy domain');\n var legacyUser = { userID: email, hypertyID: email, schema: schema, resources: resources };\n return resolve(legacyUser);\n }\n\n if (!domain) {\n activeDomain = _this.domain;\n } else {\n activeDomain = domain;\n }\n\n var identityURL = 'user://' + email.substring(email.indexOf('@') + 1, email.length) + '/' + email.substring(0, email.indexOf('@'));\n\n // message to query domain registry, asking for a user hyperty.\n var message = {\n type: 'read', from: _this.discoveryURL, to: 'domain://registry.' + activeDomain, body: { resource: identityURL }\n };\n\n log.log('[Discovery] Message discoverHypertiesPerUser: ', message, activeDomain, identityURL);\n\n //log.info('[Discovery] message READ', message);\n\n _this.messageBus.postMessage(message, function (reply) {\n log.info('[Discovery] discoverHypertiesPerUser reply', reply);\n\n var value = reply.body.value;\n\n if (!value) {\n return reject('User Hyperty not found');\n }\n\n resolve(value);\n });\n });\n }\n\n /**\n * function to request about users registered in domain registry, and\n * return the all the hyperties registered by the user\n * @deprecated Deprecated. Use discoverHyperty instead\n * @param {email} email\n * @param {domain} domain (Optional)\n */\n\n }, {\n key: 'resumeDiscoveries',\n value: function resumeDiscoveries() {\n\n var _this = this;\n\n log.log('[Discovery] resumeDiscoveries');\n\n return new _promise2.default(function (resolve, reject) {\n\n var msg = {\n type: 'read', from: _this.discoveryURL, to: _this.runtimeURL + '/subscriptions', body: { resource: _this.discoveryURL }\n };\n\n _this.messageBus.postMessage(msg, function (reply) {\n log.log('[Discovery.resumeDiscoveries] reply: ', reply);\n\n var notifications = [];\n\n if (reply.body.code === 200) {\n var urls = reply.body.value; // URLs to add listeners to\n\n //lets create one DiscoveryObject per notification\n urls.forEach(function (url) {\n var objectUrl = url.split('/registration')[0];\n var data = {};\n data.url = objectUrl;\n log.log('[Discovery.resumeDiscoveries] adding listener to: ', objectUrl);\n\n if (objectUrl.includes('hyperty://')) {\n notifications.push(_this.discoverHypertyPerURLDO(objectUrl));\n } else {\n notifications.push(_this.discoverDataObjectPerURLDO(objectUrl));\n }\n });\n _promise2.default.all(notifications).then(function (values) {\n resolve(values);\n });\n } else {\n resolve([]);\n }\n });\n });\n }\n }]);\n return Discovery;\n}();\n\nexports.default = Discovery;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJma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UNBOzs7Ozs7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7OztBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBREE7QUFDQTtBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFFQTs7Ozs7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///495\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _RegistrationStatus2 = __webpack_require__(150);\n\nvar _RegistrationStatus3 = _interopRequireDefault(_RegistrationStatus2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Discovered Object interface\n*/\nvar DiscoveredObject = function (_RegistrationStatus) {\n (0, _inherits3.default)(DiscoveredObject, _RegistrationStatus);\n (0, _createClass3.default)(DiscoveredObject, [{\n key: 'data',\n get: function get() {\n return this._data;\n }\n }]);\n\n function DiscoveredObject(data, runtimeURL, discoveryURL, msgBus, discovery) {\n (0, _classCallCheck3.default)(this, DiscoveredObject);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (DiscoveredObject.__proto__ || (0, _getPrototypeOf2.default)(DiscoveredObject)).call(this, data.hypertyID || data.url, runtimeURL, discoveryURL, msgBus));\n\n _this2._data = data;\n _this2._discovery = discovery;\n return _this2;\n }\n\n /**\n * function to check the status of the DiscoveredObject.\n * Depending on existing subscribers it may trigger onLive or onDisconnected events.\n *\n */\n\n (0, _createClass3.default)(DiscoveredObject, [{\n key: 'check',\n value: function check() {\n // query DR for the status and call processNotification with msg received\n\n var _this = this;\n var message = {\n body: {}\n };\n\n if (_this._discoveredObjectURL.startsWith('hyperty://')) {\n _this._discovery.discoverHypertyPerURL(_this._discoveredObjectURL).then(function (registration) {\n message.body.status = registration.status;\n _this._processNotification(message);\n });\n } else {\n _this._discovery.discoverDataObjectsPerURL(_this._discoveredObjectURL).then(function (registration) {\n message.body.status = registration.status;\n _this._processNotification(message);\n });\n }\n }\n }]);\n return DiscoveredObject;\n}(_RegistrationStatus3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n//import {divideURL, convertToUserURL} from '../utils/utils';\n\n\nexports.default = DiscoveredObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvRGlzY292ZXJlZE9iamVjdC5qcz8wNzRmIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXC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gICAgfSBlbHNlIHtcbiAgICAgIF90aGlzLl9kaXNjb3ZlcnkuZGlzY292ZXJEYXRhT2JqZWN0c1BlclVSTChfdGhpcy5fZGlzY292ZXJlZE9iamVjdFVSTCkudGhlbigocmVnaXN0cmF0aW9uKT0+e1xuICAgICAgICBtZXNzYWdlLmJvZHkuc3RhdHVzID0gcmVnaXN0cmF0aW9uLnN0YXR1cztcbiAgICAgICAgX3RoaXMuX3Byb2Nlc3NOb3RpZmljYXRpb24obWVzc2FnZSk7XG4gICAgICB9KTtcbiAgICB9XG4gIH1cblxuXG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgRGlzY292ZXJlZE9iamVjdDtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvZGlzY292ZXJ5L0Rpc2NvdmVyZWRPYmplY3QuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBd0JBO0FBQ0E7Ozs7O0FBQ0E7OztBQUdBOzs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUFBO0FBQ0E7QUFEQTtBQUNBO0FBRUE7QUFDQTtBQUpBO0FBS0E7QUFDQTtBQUlBOzs7Ozs7OztBQU1BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBQ0E7QUFHQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXpDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFOQTtBQUNBO0FBQ0E7QUFtREE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///496\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Search = function () {\n function Search(discovery, identityManager) {\n (0, _classCallCheck3.default)(this, Search);\n\n\n if (!discovery) throw new Error('The discovery component is a needed parameter');\n if (!identityManager) throw new Error('The identityManager component is a needed parameter');\n\n var _this = this;\n\n _this.discovery = discovery;\n _this.identityManager = identityManager;\n }\n\n (0, _createClass3.default)(Search, [{\n key: 'myIdentity',\n value: function myIdentity() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.identityManager.discoverUserRegistered().then(function (result) {\n resolve(result);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'hyperties',\n value: function hyperties(users, schemes, resources) {\n var globalFlag = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n }\n //TODO: reuse users or the other way around\n\n /**\n * List of usersURL to search\n * @param {array} users List of UserUR, like this format user:///\n * @return {Promise}\n */\n\n }, {\n key: 'users',\n value: function users(usersURLs, providedDomains, schemes, resources) {\n var globalFlag = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n\n if (!usersURLs) throw new Error('You need to provide a list of users');\n if (!providedDomains) throw new Error('You need to provide a list of domains');\n if (!resources) throw new Error('You need to provide a list of resources');\n if (!schemes) throw new Error('You need to provide a list of schemes');\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n console.info('[Search] Users: ', usersURLs, usersURLs.length);\n console.info('[Search] Domains: ', providedDomains, providedDomains.length);\n if (usersURLs.length === 0) {\n console.info('Don\\'t have users to discovery');\n resolve(usersURLs);\n } else {\n var getUsers = [];\n\n usersURLs.forEach(function (userURL, index) {\n var currentDomain = providedDomains[index];\n console.info('[Search] Search user ' + userURL + ' for provided domain:', currentDomain);\n if (!globalFlag) {\n getUsers.push(_this.discovery.discoverHyperties(userURL, schemes, resources, currentDomain));\n } else {\n getUsers.push(_this.discovery.discoverHypertiesPerUserProfileData(userURL, schemes, resources));\n }\n });\n\n console.info('Requests promises: ', getUsers);\n\n _promise2.default.all(getUsers.map(function (promise) {\n return promise.then(function (hyperty) {\n return hyperty;\n }, function (error) {\n return error;\n });\n })).then(function (hyperties) {\n\n console.info('[Search] Hyperties from new Discovery', hyperties);\n var result = hyperties.map(function (hyperty) {\n\n if (hyperty.hasOwnProperty('hypertyID')) return hyperty;\n var recent = (0, _keys2.default)(hyperty).reduceRight(function (a, b) {\n var hypertyDate = new Date(hyperty[b].lastModified);\n var hypertyDateP = new Date(hyperty[a].lastModified);\n if (hypertyDateP.getTime() < hypertyDate.getTime()) {\n return b;\n }\n return a;\n });\n\n return hyperty[recent];\n });\n\n var clean = result.filter(function (hyperty) {\n return hyperty.hasOwnProperty('hypertyID');\n });\n\n console.log('Requests result: ', clean);\n\n hyperties.forEach(function (entry) {\n if (entry !== 'No Hyperty was found') {\n return resolve(clean);\n }\n });\n\n reject('No Hyperty was found');\n }).catch(function (reason) {\n console.error(reason);\n resolve(usersURLs);\n });\n }\n });\n }\n }]);\n return Search;\n}();\n\nexports.default = Search;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9TZWFyY2guanM/ZjE4NCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBTZWFyY2gge1xuXG4gIGNvbnN0cnVjdG9yKGRpc2NvdmVyeSwgaWRlbnRpdHlNYW5hZ2VyKSB7XG5cbiAgICBpZiAoIWRpc2NvdmVyeSkgdGhyb3cgbmV3IEVycm9yKCdUaGUgZGlzY292ZXJ5IGNvbX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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBR0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///497\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _EventEmitter2 = __webpack_require__(209);\n\nvar _EventEmitter3 = _interopRequireDefault(_EventEmitter2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Context Observer;\n* @author Paulo Chainho [paulo-g-chainho@alticelabs.com]\n*/\n\nvar ContextObserver = function (_EventEmitter) {\n (0, _inherits3.default)(ContextObserver, _EventEmitter);\n\n function ContextObserver(hypertyURL, bus, configuration, contextResourceTypes, factory, syncher) {\n (0, _classCallCheck3.default)(this, ContextObserver);\n\n if (!hypertyURL) throw new Error('The hypertyURL is a needed parameter');\n if (!bus) throw new Error('The MiniBus is a needed parameter');\n if (!configuration) throw new Error('The configuration is a needed parameter ');\n if (!factory) throw new Error('The factory is a needed parameter ');\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (ContextObserver.__proto__ || (0, _getPrototypeOf2.default)(ContextObserver)).call(this));\n\n var _this = _this2;\n\n _this._contextResourceTypes = contextResourceTypes;\n _this._url = hypertyURL;\n _this._discoverUsersPromises = {}; // object with promises executed at discoverUsers function\n _this._observePromises = {}; // object with promises executed at observe function\n\n\n //let identityManager = new IdentityManager(hypertyURL, configuration.runtimeURL, bus);\n console.log('[ContextObserver] started with hypertyURL->', hypertyURL);\n _this._domain = factory.divideURL(configuration.runtimeURL).domain;\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + _this._domain + '/.well-known/dataschema/Context';\n\n _this._users2observe = [];\n _this._observers = {};\n\n _this2._syncher = syncher ? syncher : factory.createSyncher(hypertyURL, bus, configuration);\n\n var discovery = factory.createDiscovery(hypertyURL, configuration.runtimeURL, bus);\n _this._discovery = discovery;\n\n _this._discoveries = {}; //list of discovered objects\n //_this.identityManager = identityManager;\n //_this.search = new Search(discovery, identityManager);\n window.discovery = _this._discovery;\n return _this2;\n }\n\n (0, _createClass3.default)(ContextObserver, [{\n key: 'start',\n value: function start(resumedContext, disconnectedCallBack) {\n var _this = this;\n console.log('[ContextObserver.start] ');\n\n return new _promise2.default(function (resolve, reject) {\n _this._syncher.resumeObservers({ store: true }).then(function (observers) {\n\n var observersList = (0, _keys2.default)(observers);\n\n if (observersList.length > 0) {\n\n console.log('[ContextObserver.start] resuming: ', observers);\n\n /*observersList.forEach((i)=>{\n _this._users2observe.push(new UserAvailabilityController(observers[i]));\n });*/\n _this._observers = observers;\n\n resolve(observers);\n\n observersList.forEach(function (observer) {\n var Context = observers[observer];\n\n // By default resumed context is set with resumedContext.\n if (resumedContext) context.data.values = resumedContext;\n\n // Context will will be updated with value synchronized with reporter if connected\n Context.sync();\n\n //Add listener to be notified when reporter is abruptly disconnected\n if (disconnectedCallBack) Context.onDisconnected(disconnectedCallBack);\n });\n } else {\n resolve(false);\n }\n }).catch(function (reason) {\n console.info('[ContextObserver] Resume Observer failed | ', reason);\n resolve(false);\n });\n }).catch(function (reason) {\n reject('[ContextObserver] Start failed | ', reason);\n });\n }\n }, {\n key: 'resumeDiscoveries',\n value: function resumeDiscoveries() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._discovery.resumeDiscoveries().then(function (discoveries) {\n\n console.log('[ContextObserver._resumeDiscoveries] found: ', discoveries);\n\n discoveries.forEach(function (discovery) {\n\n if (discovery.data.resources && discovery.data.resources[0] === _this._contextResourceTypes[0]) {\n console.log('[ContextObserver._resumeDiscoveries] resuming: ', discovery);\n\n if (discovery.data.status === 'live') {\n // previously discovered object is now live\n resolve([discovery.data]);\n discovery.unsubscribeLive(_this._url);\n } else {\n // previously discovered object is still disconnected\n discovery.onLive(_this._url, function () {\n console.log('[ContextObserver._resumeDiscoveries] disconnected Hyperty is back to live', discovery);\n resolve([discovery.data]);\n discovery.unsubscribeLive(_this._url);\n });\n }\n }\n });\n });\n }).catch(function (reason) {\n reject('[ContextObserver] resumeDiscoveries failed | ', reason);\n });\n }\n }, {\n key: 'onResumeObserver',\n value: function onResumeObserver(callback) {\n var _this = this;\n _this._onResumeObserver = callback;\n }\n }, {\n key: 'discoverUsers',\n value: function discoverUsers(email, domain) {\n var _this = this;\n\n var user = email + '@' + domain;\n\n if (!_this._discoverUsersPromises[user]) {\n _this._discoverUsersPromises[user] = new _promise2.default(function (resolve, reject) {\n\n _this._discovery.discoverHypertiesDO(email, ['context'], _this._contextResourceTypes, domain).then(function (hyperties) {\n //_this.search.users([email], [domain], ['context'], ['Context_context']).then(function(a) {\n console.log('[ContextObserver.discoverUsers] discovery result->', hyperties);\n var discovered = [];\n var disconnected = [];\n hyperties.forEach(function (hyperty) {\n _this._discoveries[hyperty.data.hypertyID] = hyperty;\n if (hyperty.data.status === 'live') {\n discovered.push(hyperty.data);\n } else {\n disconnected.push(hyperty);\n }\n });\n\n if (discovered.length > 0) {\n console.log('[ContextObserver.discoverUsers] returning discovered hyperties data->', discovered);\n resolve(discovered);\n } else if (disconnected.length > 0) {\n console.log('[ContextObserver.discoverUsers] disconnected Hyperties ', disconnected);\n\n //resolve([]);\n\n disconnected[0].onLive(_this._url, function () {\n console.log('[ContextObserver.discoverUsers] disconnected Hyperty is back to live', disconnected[0]);\n\n discovered.push(disconnected[0].data);\n resolve(discovered);\n disconnected[0].unsubscribeLive(_this._url);\n });\n }\n });\n });\n }\n return _this._discoverUsersPromises[user];\n }\n\n /**\n * This function is used to start the user Context observation for a certain user Context reporter\n * @param {DiscoveredObject} hyperty Hyperty to be observed.\n * @return { DataObjectObserver} It returns as a Promise the UserAvailability Data Object Observer.\n */\n\n }, {\n key: 'observe',\n value: function observe(hyperty) {\n var domainSubscription = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n\n var _this = this;\n if (!_this._observePromises[hyperty.hypertyID]) {\n _this._observePromises[hyperty.hypertyID] = new _promise2.default(function (resolve, reject) {\n //check if we are already observing it\n _this._users2observe.forEach(function (Context) {\n if (Context._reporter === hyperty.hypertyID) return resolve(Context);\n });\n\n _this._discovery.discoverDataObjectsPerReporter(hyperty.hypertyID, ['context'], _this._contextResourceTypes, _this._domain).then(function (dataObjects) {\n console.log('[ContextObserver.discoverAvailability] discovered context objects ', dataObjects);\n var last = 0;\n var url = void 0;\n\n dataObjects.forEach(function (dataObject) {\n if (dataObject.hasOwnProperty('lastModified') && dataObject.hasOwnProperty('url') && Date.parse(dataObject.lastModified) > last) {\n last = dataObject.lastModified;\n url = dataObject.url;\n\n //console.log('URL DATA Object', url);\n }\n });\n if (last != 0 && url) {\n resolve(_this._subscribeContext(hyperty, url, domainSubscription));\n } else {\n reject('[ContextObserver.observe] discovered DataObjecs are invalid', dataObjects);\n }\n });\n });\n }\n return _this._observePromises[hyperty.hypertyID];\n }\n }, {\n key: '_subscribeContext',\n value: function _subscribeContext(hyperty, url) {\n var domainSubscription = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _this = this;\n\n // avoid duplicated subscriptions\n\n return new _promise2.default(function (resolve, reject) {\n _this._users2observe.forEach(function (Context) {\n if (Context.url === url) return resolve(Context);\n });\n\n var input = {\n schema: _this._objectDescURL,\n resource: url,\n store: null,\n p2p: null,\n mutual: null,\n domain_subscription: domainSubscription\n };\n\n _this._syncher.subscribe(input).then(function (Context) {\n console.log('[ContextObserver._subscribeContext] observer object', Context);\n\n //let newUserAvailability = new UserAvailabilityController(Context, userID);\n\n _this._users2observe.push(Context);\n\n // When Object is disconnected set user Context status as unavailable\n Context.onDisconnected(function () {\n console.log('[ContextObserver.onDisconnected]: ', Context);\n\n Context.data.values[0].value = 'unavailable';\n Context.sync();\n });\n\n resolve(Context);\n });\n });\n }\n }, {\n key: '_discoverAndSubscribeLegacyUsers',\n value: function _discoverAndSubscribeLegacyUsers(name) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this._discovery.discoverDataObjectsPerName(name).then(function (result) {\n console.log('[ContextObserver._discoverAndSubscribeLegacyUsers] All DataObjects Result', result);\n result.forEach(function (obj) {\n if (obj.status === 'live') {\n console.log('Live obj', obj);\n if (!obj.hypertyID) {\n obj.hypertyID = obj.reporter;\n }\n _this._subscribeContext(obj.schema, obj.url).then(function (resultSubscribe) {\n console.log('[ContextObserver._discoverAndSubscribeLegacyUsers] _subscribeContext', resultSubscribe);\n return resolve(resultSubscribe);\n });\n }\n });\n }).catch(function (err) {\n console.log('error ', err);\n });\n });\n }\n\n /**\n * This function is used to stop the user Context observation for a certain user\n * @param {string} Context the UserAvailability Data Object Observer URL to be unobserved.\n */\n\n }, {\n key: 'unobserve',\n value: function unobserve(Context) {\n var _this = this;\n\n _this._users2observe.forEach(function (user, index) {\n if (user.url === Context) {\n user.unsubscribe();\n _this._users2observe.splice(index, 1);\n }\n });\n }\n }]);\n return ContextObserver;\n}(_EventEmitter3.default); //import IdentityManager from '../identityManager/IdentityManager';\n//import Syncher from '../syncher/Syncher.js';\n//import Discovery from '../discovery/Discovery.js';\n//import {divideURL} from '../utils/utils';\n\n//import Search from '../utils/Search';\n\n\nexports.default = ContextObserver;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jb250ZXh0TWFuYWdlci9Db250ZXh0T2JzZXJ2ZXIuanM/MzVhZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvL2ltcG9ydCBJZGVudGl0eU1hbmFnZXIgZnJvbSAnLi4vaWRlbnRpdHlNYW5hZ2VyL0lkZW50aXR5TWFuYWdlcic7XG4vL2ltcG9ydCBTeW5jaGVyIGZyb20gJy4uL3N5bmNoZXIvU3luY2hlci5qcyc7XG4vL2ltcG9ydCBEaXNjb3ZlcnkgZnJvbSAnLi4vZGlzY292ZXJ5L0Rpc2NvdmVyeS5qcyc7XG4vL2ltcG9ydCB7ZGl2aWRlVVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbi8vaW1wb3J0IFNlYXJjaCBmcm9tICcuLi91dGlscy9TZWFyY2gnO1xuaW1wb3J0IEV2ZW50RW1pdHRlciBmcm9tICcuLi91dGlscy9FdmVudEVtaXR0ZXInO1xuXG4vKipcbiogQ29udGV4dCBPYnNlcnZlcjtcbiogQGF1dGhvciBQYXVsbyBDaGFpbmhvIFtwYXVsby1nLWNoYWluaG9AYWx0aWNlbGFicy5jb21dXG4qL1xuXG5jbGFzcyBDb250ZXh0T2JzZXJ2ZXIgZXh0ZW5kcyBFdmVudEVtaXR0ZXIge1xuXG4gIGNvbnN0cnVjdG9yKGh5cGVydHlVUkwsIGJ1cywgY29uZmlndXJhdGlvbiwgY29udGV4dFJlc291cmNlVHlwZXMsIGZhY3RvcnksIHN5bmNoZXIpIHtcbiAgICBpZiAoIWh5cGVydHlVU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QUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFOQTtBQUNBO0FBUUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBOzs7QUE1UkE7QUFaQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQXNTQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///498\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _EventEmitter2 = __webpack_require__(209);\n\nvar _EventEmitter3 = _interopRequireDefault(_EventEmitter2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//import {divideURL} from '../utils/utils.js';\n\n// import availability from './availability.js';\n\n/**\n* Context Reporter;\n* @author Paulo Chainho [paulo-g-chainho@alticelabs.com]\n*/\nvar ContextReporter = function (_EventEmitter) {\n (0, _inherits3.default)(ContextReporter, _EventEmitter);\n\n function ContextReporter(hypertyURL, bus, configuration, factory, syncher) {\n (0, _classCallCheck3.default)(this, ContextReporter);\n\n if (!hypertyURL) throw new Error('The hypertyURL is a needed parameter');\n if (!bus) throw new Error('The MiniBus is a needed parameter');\n if (!configuration) throw new Error('The configuration is a needed parameter');\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (ContextReporter.__proto__ || (0, _getPrototypeOf2.default)(ContextReporter)).call(this, hypertyURL, bus, configuration));\n\n var _this = _this2;\n\n console.info('[ContextReporter] started with url: ', hypertyURL);\n\n _this2.syncher = syncher ? syncher : factory.createSyncher(hypertyURL, bus, configuration);\n\n // this.discovery = new Discovery(hypertyURL, bus);\n _this2.domain = factory.divideURL(configuration.runtimeURL).domain;\n _this2.contexts = {};\n\n _this2.contextDescURL = 'hyperty-catalogue://catalogue.' + _this2.domain + '/.well-known/dataschema/Context';\n\n // this.heartbeat = [];\n\n _this2.syncher.onNotification(function (event) {\n var _this = _this2;\n _this.onNotification(event);\n });\n\n //TODO: uncomment when used with service framework develop branch\n\n _this2.syncher.onClose(function (event) {\n\n console.log('[ContextReporter.onClose]');\n var _this = _this2;\n _this.setStatus(event.id, 'unavailable');\n event.ack();\n });\n\n return _this2;\n }\n\n //TODO: move to User availability Reporter or to abstract HypertyContextReporter\n\n (0, _createClass3.default)(ContextReporter, [{\n key: 'start',\n value: function start() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3.syncher.resumeReporters({ store: true }).then(function (reporters) {\n\n var reportersList = (0, _keys2.default)(reporters);\n\n if (reportersList.length > 0) {\n\n console.log('[ContextReporter.start] resuming ', reporters[reportersList[0]]);\n\n // set availability to available\n\n _this.contexts = reporters;\n\n //TODO:\n reportersList.forEach(function (context) {\n _this._onSubscription(_this.contexts[context]);\n });\n\n resolve(_this.contexts);\n } else {\n console.log('[ContextReporter.start] nothing to resume ', reporters);\n resolve(false);\n }\n }).catch(function (reason) {\n console.error('[ContextReporter] Resume failed | ', reason);\n });\n }).catch(function (reason) {\n reject('[ContextReporter] Start failed | ', reason);\n });\n }\n }, {\n key: 'processNotification',\n value: function processNotification(event) {\n var _this = this;\n console.log('[ContextReporter.processNotification: ', event);\n\n event.ack();\n }\n\n /**\n * This function is used to create a new status object syncher\n * @param {URL.UserURL} contacts List of Users\n * @return {Promise}\n */\n\n }, {\n key: 'create',\n value: function create(id, init, resources) {\n var name = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'myContext';\n var reporter = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;\n var reuseURL = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;\n\n //debugger;\n var _this = this;\n var input = void 0;\n return new _promise2.default(function (resolve, reject) {\n if (!reporter && !reuseURL) {\n input = { resources: resources, expires: 30 };\n } else if (reporter && !reuseURL) {\n input = { resources: resources, expires: 30, reporter: reporter };\n } else if (!reporter && reuseURL) {\n input = { resources: resources, expires: 30, reuseURL: reuseURL };\n } else {\n input = { resources: resources, expires: 30, reuseURL: reuseURL, reporter: reporter };\n }\n\n console.info('[ContextReporter.create] lets create a new User availability Context Object ', input);\n _this.syncher.create(_this.contextDescURL, [], init, true, false, name, null, input).then(function (context) {\n _this.contexts[id] = context;\n\n _this._onSubscription(context);\n resolve(context);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: '_onSubscription',\n value: function _onSubscription(context) {\n context.onSubscription(function (event) {\n console.info('[ContextReporter._onSubscription] accepting: ', event);\n event.accept();\n });\n }\n }, {\n key: 'setContext',\n value: function setContext(id, newContext) {\n var _this = this;\n console.log('THIS [ContextReporter.setContext] before change :', _this.contexts[id]);\n console.log('[ContextReporter.setContext] before change :', _this.contexts[id].data);\n\n // _this.contexts[id].data.values[0].value = newContext;\n\n _this.contexts[id].data.values = newContext;\n console.debug('[ContextReporter.setContext] after change :', _this.contexts[id].data);\n _this.trigger(id + '-context-update', newContext);\n }\n }]);\n return ContextReporter;\n}(_EventEmitter3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Service Framework\n//import Syncher from '../syncher/Syncher';\n\n// Utils\n\n\nexports.default = ContextReporter;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDk5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jb250ZXh0TWFuYWdlci9Db250ZXh0UmVwb3J0ZXIuanM/MzE1MCJdLCJzb3VyY2VzQ29udGVudC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BQUVBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7O0FBL0lBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQTRKQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///499\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _UserProfile = __webpack_require__(501);\n\nvar _UserProfile2 = _interopRequireDefault(_UserProfile);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar MessageBodyIdentity = function MessageBodyIdentity(username, userURL, picture, name, locale, idp, assertion, profile) {\n (0, _classCallCheck3.default)(this, MessageBodyIdentity);\n\n\n if (!idp) throw new Error('IDP should be a parameter');\n if (!username) throw new Error('username should be a parameter');\n\n this.idp = idp;\n\n if (assertion) {\n this.assertion = assertion;\n }\n this.userProfile = new _UserProfile2.default(username, userURL, picture, name, locale, profile);\n}; /**\n * The Identity info to be added to Message.Body.Identity\n */\n\nexports.default = MessageBodyIdentity;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9NZXNzYWdlQm9keUlkZW50aXR5LmpzP2M1OWMiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIFRoZSBJZGVudGl0eSBpbmZvIHRvIGJlIGFkZGVkIHRvIE1lc3NhZ2UuQm9keS5JZGVudGl0eVxuKi9cblxuaW1wb3J0IFVzZXJQcm9maWxlIGZyb20gJy4vVXNlclByb2ZpbGUnO1xuXG5jbGFzcyBNZXNzYWdlQm9keUlkZW50aXR5IHtcblxuICBjb25zdHJ1Y3Rvcih1c2VybmFtZSwgdXNlclVSTCwgcGljdHVyZSwgbmFtZSwgbG9jYWxlLCBpZHAsIGFzc2VydGlvbiwgcHJvZmlsZSkge1xuXG4gICAgaWYgKCFpZHApIHRocm93IG5ldyBFcnJvcignSURQIHNob3VsZCBiZSBhIHBhcmFtZXRlcicpO1xuICAgIGlmICghdXNlcm5hbWUpIHRocm93IG5ldyBFcnJvcigndXNlcm5hbWUgc2hvdWxkIGJlIGEgcGFyYW1ldGVyJyk7XG5cbiAgICB0aGlzLmlkcCA9IGlkcDtcblxuICAgIGlmIChhc3NlcnRpb24pICAgICAgeyB0aGlzLmFzc2VydGlvbiA9IGFzc2VydGlvbjsgfVxuICAgIHRoaXMudXNlclByb2ZpbGUgPSBuZXcgVXNlclByb2ZpbGUodXNlcm5hbWUsIHVzZXJVUkwsIHBpY3R1cmUsIG5hbWUsIGxvY2FsZSwgcHJvZmlsZSk7XG5cbiAgfVxuXG59XG5cblxuZXhwb3J0IGRlZmF1bHQgTWVzc2FnZUJvZHlJZGVudGl0eTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvaWRlbnRpdHkvTWVzc2FnZUJvZHlJZGVudGl0eS5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztBQUlBO0FBQ0E7Ozs7O0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFFQTs7OztBQUtBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///500\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* The UserProfile according to User Identity Data Model\n*/\n\nvar UserProfile = function UserProfile(username, userURL, picture, name, locale, profile) {\n (0, _classCallCheck3.default)(this, UserProfile);\n\n\n if (username) {\n this.preferred_username = username;\n }\n if (picture) {\n this.picture = picture;\n }\n if (name) {\n this.name = name;\n }\n if (locale) {\n this.locale = locale;\n }\n if (userURL) {\n this.userURL = userURL;\n }\n if (profile) (0, _assign2.default)(this, profile);\n};\n\nexports.default = UserProfile;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9Vc2VyUHJvZmlsZS5qcz9iZjRlIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBUaGUgVXNlclByb2ZpbGUgYWNjb3JkaW5nIHRvIFVzZXIgSWRlbnRpdHkgRGF0YSBNb2RlbFxuKi9cblxuXG5jbGFzcyBVc2VyUHJvZmlsZSB7XG5cbiAgY29uc3RydWN0b3IodXNlcm5hbWUsIHVzZXJVUkwsIHBpY3R1cmUsIG5hbWUsIGxvY2FsZSwgcHJvZmlsZSkge1xuXG4gICAgaWYgKHVzZXJuYW1lKSB7IHRoaXMucHJlZmVycmVkX3VzZXJuYW1lID0gdXNlcm5hbWU7IH1cbiAgICBpZiAocGljdHVyZSkgeyB0aGlzLnBpY3R1cmUgPSBwaWN0dXJlOyB9XG4gICAgaWYgKG5hbWUpIHsgdGhpcy5uYW1lID0gbmFtZTsgfVxuICAgIGlmIChsb2NhbGUpIHsgdGhpcy5sb2NhbGUgPSBsb2NhbGU7IH1cbiAgICBpZiAodXNlclVSTCkgeyB0aGlzLnVzZXJVUkwgPSB1c2VyVVJMOyB9XG4gICAgaWYgKHByb2ZpbGUpIE9iamVjdC5hc3NpZ24odGhpcywgcHJvZmlsZSk7XG5cbiAgfVxufVxuXG5leHBvcnQgZGVmYXVsdCBVc2VyUHJvZmlsZTtcblxuXG5cbi8vIFdFQlBBQ0sgRk9PVEVSIC8vXG4vLyBzcmMvaWRlbnRpdHkvVXNlclByb2ZpbGUuanMiXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQTs7OztBQUtBO0FBRUE7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFFQTtBQUNBO0FBRUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///501\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _communication = __webpack_require__(210);\n\nvar _ChatController = __webpack_require__(211);\n\nvar _ChatController2 = _interopRequireDefault(_ChatController);\n\nvar _UserInfo = __webpack_require__(212);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Hyperty Group Chat Manager API (HypertyChat)\n* @author Vitor Silva [vitor-t-silva@telecom.pt]\n* @version 0.1.0\n*/\nvar ChatManager = function () {\n function ChatManager(myUrl, bus, configuration, syncher, factory) {\n (0, _classCallCheck3.default)(this, ChatManager);\n\n if (!myUrl) throw new Error('[ChatManager.constructor] The myUrl is a needed parameter');\n if (!bus) throw new Error('[ChatManager.constructor] The MiniBus is a needed parameter');\n if (!configuration) throw new Error('[ChatManager.constructor] The configuration is a needed parameter');\n\n var _this = this;\n if (!syncher) {\n syncher = factory.createSyncher(myUrl, bus, configuration);\n }\n\n _this._runtimeURL = configuration.runtimeURL;\n\n var domain = factory.divideURL(_this._runtimeURL).domain;\n var discovery = factory.createDiscovery(myUrl, configuration.runtimeURL, bus);\n var identityManager = factory.createIdentityManager(myUrl, configuration.runtimeURL, bus);\n\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + domain + '/.well-known/dataschema/Communication';\n\n _this._reportersControllers = {};\n _this._observersControllers = {};\n\n _this._myUrl = myUrl;\n _this._bus = bus;\n _this._syncher = syncher;\n _this._domain = domain;\n\n _this.discovery = discovery;\n _this.identityManager = identityManager;\n _this.currentIdentity;\n\n _this.search = factory.createSearch(discovery, identityManager);\n\n _this.communicationObject = _communication.communicationObject;\n\n _this.communicationChildren = _communication.communicationChildren;\n\n console.log('[ChatManager] Discover ', discovery);\n console.log('[ChatManager] Identity Manager ', identityManager);\n }\n\n (0, _createClass3.default)(ChatManager, [{\n key: 'processNotification',\n value: function processNotification(event) {\n var _this = this;\n console.log('[ChatManager.processNotification: ', event);\n\n if (event.type === 'create') {\n\n // TODO: replace the 100 for Message.Response\n // event.ack(200);\n\n if (_this._onInvitation) {\n _this._onInvitation(event);\n }\n }\n\n if (event.type === 'delete') {\n // TODO: replace the 200 for Message.Response\n event.ack(200);\n\n _this._observersControllers[event.url].closeEvent = event;\n\n delete _this._observersControllers[event.url];\n\n _this._observersControllers.closeEvent = event;\n\n _this.communicationObject = _communication.communicationObject;\n\n for (var url in this._reportersControllers) {\n this._reportersControllers[url].close(event);\n }\n\n for (var _url in this._observersControllers) {\n this._observersControllers[_url].close(event);\n }\n }\n }\n }, {\n key: 'myIdentity',\n value: function myIdentity(identity) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n console.info('[ChatManager.myIdentity]');\n if (identity) return resolve(identity);\n\n if (_this._myUrl.includes('hyperty://')) {\n _this.identityManager.discoverUserRegistered().then(function (identity) {\n resolve(identity);\n }).catch(function (reason) {\n reject(reason);\n });\n } else {\n _this.identityManager.discoverIdentityPerIdP().then(function (identity) {\n resolve(identity);\n }).catch(function (reason) {\n reject(reason);\n });\n }\n });\n }\n\n /**\n * This function is used to create a new Group Chat providing the name and the identifiers of users to be invited.\n * @param {string} name Is a string to identify the Group Chat\n * @param {array} users Array of users to be invited to join the Group Chat. Users are identified with reTHINK User URL, like this format user:///\n * @return {ChatController} A ChatController object as a Promise.\n */\n\n }, {\n key: 'create',\n value: function create(name, users) {\n var extra = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n\n var _this = this;\n var syncher = _this._syncher;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.communicationObject = _communication.communicationObject;\n _this.communicationObject.cseq = 1;\n _this.communicationObject.startingTime = new Date().toJSON();\n _this.communicationObject.status = _communication.CommunicationStatus.OPEN;\n\n var myIdentity = void 0;\n\n _this.myIdentity().then(function (identity) {\n myIdentity = identity;\n console.log('[ChatManager.create ] My Identity', identity);\n\n // let url = _this.communicationObject.reporter;\n\n var userInfo = new _UserInfo.UserInfo(_this._myUrl, _this._domain, identity);\n\n // Add my identity\n _this.communicationObject.participants[identity.guid] = userInfo;\n\n console.log('[ChatManager.create ] participants: ', _this.communicationObject.participants);\n console.log('[ChatManager.create ] communicationObject', _this.communicationObject);\n console.info('[ChatManager.create] searching ' + users);\n\n //let usersSearch = _this.search.users(users, domains, ['comm'], ['chat']);\n\n var usersDiscovery = [];\n\n var disconnected = [];\n var live = {};\n\n users.forEach(function (user) {\n var userDiscoveryPromise = _this.discovery.discoverHypertiesDO(user.user, ['comm'], ['chat'], user.domain);\n usersDiscovery.push(userDiscoveryPromise);\n\n //if (user.user.includes('://')) mutual = false;\n });\n\n _promise2.default.all(usersDiscovery).then(function (userDiscoveryResults) {\n console.log('[ChatManager.create] Users Discovery Results->', userDiscoveryResults);\n\n var selectedHyperties = [];\n\n userDiscoveryResults.forEach(function (userDiscoveryResult) {\n\n userDiscoveryResult.forEach(function (discovered) {\n if (discovered.data.status === 'live') {\n selectedHyperties.push(discovered.data.hypertyID);\n live[discovered.data.hypertyID] = discovered;\n } else {\n // To control the number of subscriptions to disconnected devices\n if (disconnected.length < 5) {\n disconnected.push(discovered);\n }\n }\n });\n });\n\n /* return usersSearch;\n }).then((hypertiesIDs) => {\n let selectedHyperties = hypertiesIDs.map((hyperty) => {\n return hyperty.hypertyID;\n }); */\n\n console.info('[ChatManager] ---------------------- Syncher Create ---------------------- \\n');\n console.info('[ChatManager] Selected Hyperties: !!! ', selectedHyperties);\n console.info('Have ' + selectedHyperties.length + ' users;');\n var mutual = extra.mutual ? extra.mutual : true;\n\n var input = (0, _assign2.default)({ resources: ['chat'], mutual: mutual }, extra);\n delete input.name;\n\n if (_this.offline) input.offline = _this.offline;\n\n console.info('[ChatManager] input data:', input);\n return syncher.create(_this._objectDescURL, selectedHyperties, _this.communicationObject, true, false, name, {}, input);\n }).then(function (dataObjectReporter) {\n\n console.info('[ChatManager] 3. Return Create Data Object Reporter', dataObjectReporter);\n\n var chatController = new _ChatController2.default(syncher, _this.discovery, _this._domain, _this.search, myIdentity, _this);\n chatController.dataObjectReporter = dataObjectReporter;\n\n _this._reportersControllers[dataObjectReporter.url] = chatController;\n\n console.log('[ChatManager] chatController invitationsHandler: ', chatController.invitationsHandler);\n\n // process invitations to handle not received invitations\n if (dataObjectReporter.invitations.length > 0) {\n chatController.invitationsHandler.processInvitations(live, dataObjectReporter);\n }\n\n // If any invited User is disconnected let's wait until it is connected again\n if (disconnected.length > 0) chatController.invitationsHandler.inviteDisconnectedHyperties(disconnected, dataObjectReporter);\n\n resolve(chatController);\n }).catch(function (reason) {\n reject(reason);\n });\n }).catch(function (reason) {\n console.log('[ChatManager.create] MyIdentity Error:', reason);\n return reject(reason);\n });\n });\n }\n\n /**\n * This function is used to handle notifications about incoming invitations to join a Group Chat.\n * @param {Function} CreateEvent The CreateEvent fired by the Syncher when an invitaion is received\n */\n\n }, {\n key: 'onInvitation',\n value: function onInvitation(callback) {\n var _this = this;\n _this._onInvitation = callback;\n }\n\n /**\n * This function is used to join a Group Chat.\n * @param {URL.CommunicationURL} invitationURL The Communication URL of the Group Chat to join that is provided in the invitation event\n * @return {ChatController} It returns the ChatController object as a Promise\n */\n\n }, {\n key: 'join',\n value: function join(invitationURL) {\n var mutual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var identity = arguments[2];\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var syncher = _this._syncher;\n var myIdentity = void 0;\n\n console.info('[ChatManager] ------------------------ Syncher subscribe ---------------------- \\n');\n console.info('invitationURL', invitationURL);\n _this.myIdentity(identity).then(function (identity) {\n myIdentity = identity;\n var input = {\n schema: _this._objectDescURL,\n resource: invitationURL,\n store: true,\n p2p: false,\n mutual: mutual,\n domain_subscription: true,\n identity: identity\n };\n\n if (_this.offline) input.offline = _this.offline;\n\n return syncher.subscribe(input);\n }).then(function (dataObjectObserver) {\n console.info('Data Object Observer: ', dataObjectObserver);\n\n var chatController = new _ChatController2.default(syncher, _this.discovery, _this._domain, _this.search, myIdentity, _this);\n resolve(chatController);\n\n chatController.dataObjectObserver = dataObjectObserver;\n\n _this._observersControllers[dataObjectObserver.url] = chatController;\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'offline',\n set: function set(offline) {\n this._offline = offline;\n },\n get: function get() {\n return this._offline ? this._offline : false;\n }\n }]);\n return ChatManager;\n}();\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Service Framework\n//import IdentityManager from '../identityManager/IdentityManager';\n//import RegistrationStatus from '../discovery/RegistrationStatus';\n//import Discovery from '../discovery/Discovery';\n//import Syncher from '../syncher/Syncher';\n\n// Utils\n//import {divideURL} from '../utils/utils';\n//import Search from '../utils/Search';\n\n// Internals\n\n\nexports.default = ChatManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9DaGF0TWFuYWdlci5qcz81ZDE5Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERld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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7O0FBclBBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7OztBQTdGQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUE2U0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///502\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n* To manage Group Chat Invitations\n* @author Paulo Chainho [paulo-g-chainho@alticelabs.com]\n* @version 0.1.0\n*/\n\n// TODO: have an instance per ChatController\n\nvar InvitationsHandler = function () {\n function InvitationsHandler(hypertyURL) {\n (0, _classCallCheck3.default)(this, InvitationsHandler);\n\n\n if (!hypertyURL) throw Error('hypertyURL is a necessary dependecy');\n\n var _this = this;\n _this._hypertyURL = hypertyURL;\n\n _this._pending = {}; // All pending invitations\n }\n\n (0, _createClass3.default)(InvitationsHandler, [{\n key: 'inviteDisconnectedHyperties',\n\n\n /**\n * This function is used to handle notifications for disconnected Hy+erties.\n * @param {DiscoveredObject[]} disconnected array of discovered hyperties that are disconnected\n * @param {DataObjectReporter} DataObjectReporter Data Object Reporter addressed by invitations\n */\n\n value: function inviteDisconnectedHyperties(disconnected, dataObjectReporter) {\n\n var _this = this;\n console.log('[GroupChatManager.InvitationsHandler.inviteDisconnectedHyperties] lets invite ', disconnected);\n\n disconnected.forEach(function (disconnectedHyperty) {\n\n if (!_this._pending[dataObjectReporter]) {\n _this._pending[dataObjectReporter] = {};\n }\n\n _this._pending[dataObjectReporter][disconnectedHyperty.data.hypertyID] = disconnectedHyperty;\n\n disconnectedHyperty.onLive(_this._hypertyURL, function () {\n console.log('[GroupChatManager.create] disconnected Hyperty is back to live', disconnectedHyperty);\n\n dataObjectReporter.inviteObservers([disconnectedHyperty.data.hypertyID]);\n\n disconnectedHyperty.unsubscribeLive(_this._hypertyURL);\n\n delete _this._pending[dataObjectReporter][disconnectedHyperty.data.hypertyID];\n });\n });\n }\n\n /**\n * This function is used to process sent invitations. In case invitations are not acknowledge by recipient it will be handled as a disconnected hyperty\n * @param {DiscoveredObject[]} live array of discovered hyperties that are or were live\n * @param {DataObjectReporter} DataObjectReporter Data Object Reporter addressed by invitations\n */\n\n }, {\n key: 'processInvitations',\n value: function processInvitations(live, dataObjectReporter) {\n var _this2 = this;\n\n var _this = this;\n\n var invitations = dataObjectReporter.invitations || [];\n\n console.log('[GroupChatManager.InvitationsHandler.processInvitations] waiting for replies ', invitations, this._invitationsResponse);\n\n invitations.forEach(function (invitation) {\n invitation.then(function (result) {\n console.log('[GroupChatManager.InvitationsHandler.processInvitations] - OK: ', result, _this2._invitationsResponse);\n if (_this2._invitationsResponse) {\n _this2._invitationsResponse(result);\n }\n }).catch(function (result) {\n console.log('[GroupChatManager.InvitationsHandler.processInvitations] - NOT OK: ', result, _this2._invitationsResponse);\n if (_this2._invitationsResponse) {\n _this2._invitationsResponse(result);\n }\n _this.inviteDisconnectedHyperties([live[result.invited]], dataObjectReporter);\n });\n });\n }\n }, {\n key: 'resumeDiscoveries',\n value: function resumeDiscoveries(discoveryEngine, groupChat) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var live = {};\n var liveHyperties = [];\n var disconnected = [];\n var unsubscriptonPromises = [];\n\n discoveryEngine.resumeDiscoveries().then(function (discoveries) {\n\n console.log('[GroupChatManager.InvitationsHandler.resumeDiscoveries] found: ', discoveries);\n\n discoveries.forEach(function (discovery) {\n\n if (discovery.data.resources && discovery.data.resources[0] === 'chat') {\n console.log('[GroupChatManager.InvitationsHandler.resumeDiscoveries] resuming: ', discovery);\n\n if (discovery.data.status === 'live') {\n // previously discovered object is now live\n live[discovery.data.hypertyID] = discovery;\n liveHyperties.push(discovery.data.hypertyID);\n unsubscriptonPromises.push(discovery.unsubscribeLive(_this._hypertyURL));\n } else {\n // previously discovered object is still disconnected\n disconnected.push(discovery);\n }\n }\n });\n if (disconnected.length > 0) _this.inviteDisconnectedHyperties(disconnected, groupChat);\n\n if ((0, _keys2.default)(live).length > 0) {\n groupChat.inviteObservers(liveHyperties);\n\n if (groupChat.invitations.length > 0) _this.processInvitations(live, groupChat);\n\n _promise2.default.all(unsubscriptonPromises).then(function () {\n resolve();\n });\n } else resolve();\n });\n }).catch(function (reason) {\n reject('[GroupChatManager.InvitationsHandler.resumeDiscoveries] failed | ', reason);\n });\n }\n\n /**\n * This function is used to remove and clean all pending invitations.\n * @param {DataObjectReporter} DataObjectReporter Data Object Reporter addressed by invitations\n * @return {Promise} return a promise when all unsubscriptons for pending invitations are finished\n */\n\n }, {\n key: 'cleanInvitations',\n value: function cleanInvitations(dataObjectReporter) {\n var _this = this;\n\n var chatInvitations = _this._pending[dataObjectReporter];\n\n console.log('[GroupChatManager.InvitationsHandler.cleanInvitations] ', chatInvitations);\n\n if (chatInvitations) {\n\n return new _promise2.default(function (resolve, reject) {\n var pendingInvitations = (0, _keys2.default)(chatInvitations);\n\n var unsubscriptonPromises = [];\n\n pendingInvitations.forEach(function (invitation) {\n unsubscriptonPromises.push(chatInvitations[invitation].unsubscribeLive(_this._hypertyURL));\n });\n\n _promise2.default.all(pendingInvitations).then(function () {\n resolve();\n });\n });\n } else return _promise2.default.resolve();\n }\n }, {\n key: 'invitationResponse',\n set: function set(callback) {\n this._invitationsResponse = callback;\n }\n }]);\n return InvitationsHandler;\n}();\n\nexports.default = InvitationsHandler;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTAzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9JbnZpdGF0aW9uc0hhbmRsZXIuanM/ZWEwMCJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjA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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBRUE7QUFFQTtBQUdBOzs7QUE1SUE7QUFDQTtBQUNBOzs7OztBQThJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///503\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _defineProperty = __webpack_require__(204);\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (obj, key, value) {\n if (key in obj) {\n (0, _defineProperty2.default)(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9kZWZpbmVQcm9wZXJ0eS5qcz82Y2U3Il0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2RlZmluZVByb3BlcnR5ID0gcmVxdWlyZShcIi4uL2NvcmUtanMvb2JqZWN0L2RlZmluZS1wcm9wZXJ0eVwiKTtcblxudmFyIF9kZWZpbmVQcm9wZXJ0eTIgPSBfaW50ZXJvcFJlcXVpcmVEZWZhdWx0KF9kZWZpbmVQcm9wZXJ0eSk7XG5cbmZ1bmN0aW9uIF9pbnRlcm9wUmVxdWlyZURlZmF1bHQob2JqKSB7IHJldHVybiBvYmogJiYgb2JqLl9fZXNNb2R1bGUgPyBvYmogOiB7IGRlZmF1bHQ6IG9iaiB9OyB9XG5cbmV4cG9ydHMuZGVmYXVsdCA9IGZ1bmN0aW9uIChvYmosIGtleSwgdmFsdWUpIHtcbiAgaWYgKGtleSBpbiBvYmopIHtcbiAgICAoMCwgX2RlZmluZVByb3BlcnR5Mi5kZWZhdWx0KShvYmosIGtleSwge1xuICAgICAgdmFsdWU6IHZhbHVlLFxuICAgICAgZW51bWVyYWJsZTogdHJ1ZSxcbiAgICAgIGNvbmZpZ3VyYWJsZTogdHJ1ZSxcbiAgICAgIHdyaXRhYmxlOiB0cnVlXG4gICAgfSk7XG4gIH0gZWxzZSB7XG4gICAgb2JqW2tleV0gPSB2YWx1ZTtcbiAgfVxuXG4gIHJldHVybiBvYmo7XG59O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9kZWZpbmVQcm9wZXJ0eS5qc1xuLy8gbW9kdWxlIGlkID0gNTA0XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///504\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _communication = __webpack_require__(210);\n\nvar _Chat = __webpack_require__(213);\n\nvar _Chat2 = _interopRequireDefault(_Chat);\n\nvar _UserInfo = __webpack_require__(212);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Hyperty Simple Group Chat Manager API \n* @author Vitor Silva [vitor-t-silva@telecom.pt]\n* @version 0.1.0\n*/\nvar SimpleSimpleChatManager = function () {\n function SimpleSimpleChatManager(myUrl, bus, configuration, syncher, factory) {\n (0, _classCallCheck3.default)(this, SimpleSimpleChatManager);\n\n if (!myUrl) throw new Error('[SimpleChatManager.constructor] The myUrl is a needed parameter');\n if (!bus) throw new Error('[SimpleChatManager.constructor] The MiniBus is a needed parameter');\n if (!configuration) throw new Error('[SimpleChatManager.constructor] The configuration is a needed parameter');\n\n var _this = this;\n if (!syncher) {\n syncher = factory.createSyncher(myUrl, bus, configuration);\n }\n\n _this._runtimeURL = configuration.runtimeURL;\n\n var domain = factory.divideURL(_this._runtimeURL).domain;\n // let discovery = factory.createDiscovery(myUrl, configuration.runtimeURL, bus);\n var identityManager = factory.createIdentityManager(myUrl, configuration.runtimeURL, bus);\n\n _this._objectDescURL = 'hyperty-catalogue://catalogue.' + domain + '/.well-known/dataschema/Communication';\n\n _this._reportersControllers = {};\n _this._observersControllers = {};\n\n _this._myUrl = myUrl;\n _this._bus = bus;\n _this._syncher = syncher;\n _this._domain = domain;\n\n // _this.discovery = discovery;\n _this.identityManager = identityManager;\n _this.currentIdentity;\n\n // _this.search = factory.createSearch(discovery, identityManager);\n\n _this.communicationObject = _communication.communicationObject;\n\n _this.communicationChildren = _communication.communicationChildren;\n\n // console.log('[SimpleChatManager] Discover ', discovery);\n console.log('[SimpleChatManager] Identity Manager ', identityManager);\n }\n\n (0, _createClass3.default)(SimpleSimpleChatManager, [{\n key: 'processNotification',\n value: function processNotification(event) {\n var _this = this;\n console.log('[SimpleChatManager.processNotification: ', event);\n\n if (event.type === 'create') {\n\n // TODO: replace the 100 for Message.Response\n // event.ack(200);\n\n if (_this._onInvitation) {\n _this._onInvitation(event);\n }\n }\n\n if (event.type === 'delete') {\n // TODO: replace the 200 for Message.Response\n event.ack(200);\n\n _this._observersControllers[event.url].closeEvent = event;\n\n delete _this._observersControllers[event.url];\n\n _this._observersControllers.closeEvent = event;\n\n _this.communicationObject = _communication.communicationObject;\n\n for (var url in this._reportersControllers) {\n this._reportersControllers[url].close(event);\n }\n\n for (var _url in this._observersControllers) {\n this._observersControllers[_url].close(event);\n }\n }\n }\n }, {\n key: 'myIdentity',\n value: function myIdentity(identity) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n console.info('[SimpleChatManager.myIdentity]');\n if (identity) return resolve(identity);\n\n if (_this._myUrl.includes('hyperty://')) {\n _this.identityManager.discoverUserRegistered().then(function (identity) {\n _this.currentIdentity = identity;\n resolve(identity);\n }).catch(function (reason) {\n reject(reason);\n });\n } else {\n _this.identityManager.discoverIdentityPerIdP().then(function (identity) {\n _this.currentIdentity = identity;\n resolve(identity);\n }).catch(function (reason) {\n reject(reason);\n });\n }\n });\n }\n\n /**\n * This function is used to create a new Group Chat providing the name and the identifiers of users to be invited.\n * @param {string} name Is a string to identify the Group Chat\n * @param {array} hyperties Array of hyperties to be invited to join the Group Chat. Users are identified with reTHINK User URL, like this format user:///\n * @return {ChatController} A ChatController object as a Promise.\n */\n\n }, {\n key: 'create',\n value: function create(name, hyperties) {\n var extra = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n\n var _this = this;\n var syncher = _this._syncher;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.communicationObject = _communication.communicationObject;\n _this.communicationObject.cseq = 1;\n _this.communicationObject.startingTime = new Date().toJSON();\n _this.communicationObject.status = _communication.CommunicationStatus.OPEN;\n\n var myIdentity = void 0;\n\n _this.myIdentity().then(function (identity) {\n myIdentity = identity;\n console.log('[SimpleChatManager.create ] My Identity', identity);\n\n // let url = _this.communicationObject.reporter;\n\n var userInfo = new _UserInfo.UserInfo(_this._myUrl, _this._domain, identity);\n\n // Add my identity\n _this.communicationObject.participants[identity.guid] = userInfo;\n\n console.log('[SimpleChatManager.create ] participants: ', _this.communicationObject.participants);\n console.log('[SimpleChatManager.create ] communicationObject', _this.communicationObject);\n\n console.info('[SimpleChatManager] ---------------------- Syncher Create ---------------------- \\n');\n console.info('[SimpleChatManager] Selected Hyperties: !!! ', hyperties);\n // console.info(`Have ${hyperties.length} users;`);\n var mutual = extra.mutual ? extra.mutual : true;\n\n var input = (0, _assign2.default)({ resources: ['chat'], mutual: mutual }, extra);\n delete input.name;\n\n if (_this.offline) input.offline = _this.offline;\n if (_this.backup) input.backup = _this.backup;\n\n console.log('[SimpleChatManager] input data:', input);\n return syncher.create(_this._objectDescURL, hyperties, _this.communicationObject, true, false, name, {}, input);\n }).then(function (dataObjectReporter) {\n\n console.info('[SimpleChatManager] 3. Return Create Data Object Reporter', dataObjectReporter);\n\n var chat = new _Chat2.default(syncher, _this._domain, myIdentity, _this);\n chat.dataObjectReporter = dataObjectReporter;\n\n _this._reportersControllers[dataObjectReporter.url] = chat;\n\n // console.log('[SimpleChatManager] chat invitationsHandler: ', chat.invitationsHandler);\n\n // process invitations to handle not received invitations\n /* if (dataObjectReporter.invitations.length > 0) {\n chat.invitationsHandler.processInvitations(live, dataObjectReporter);\n }\n \n // If any invited User is disconnected let's wait until it is connected again\n if (disconnected.length > 0) chat.invitationsHandler.inviteDisconnectedHyperties(disconnected, dataObjectReporter);\n */\n resolve(chat);\n }).catch(function (reason) {\n reject(reason);\n });\n }).catch(function (reason) {\n console.log('[SimpleChatManager.create] MyIdentity Error:', reason);\n return reject(reason);\n });\n // });\n }\n\n /**\n * This function is used to handle notifications about incoming invitations to join a Group Chat.\n * @param {Function} CreateEvent The CreateEvent fired by the Syncher when an invitaion is received\n */\n\n }, {\n key: 'onInvitation',\n value: function onInvitation(callback) {\n var _this = this;\n _this._onInvitation = callback;\n }\n\n /**\n * This function is used to join a Group Chat.\n * @param {URL.CommunicationURL} invitationURL The Communication URL of the Group Chat to join that is provided in the invitation event\n * @return {ChatController} It returns the ChatController object as a Promise\n */\n\n }, {\n key: 'join',\n value: function join(invitationURL) {\n var mutual = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var identity = arguments[2];\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var syncher = _this._syncher;\n var myIdentity = void 0;\n\n console.info('[SimpleChatManager] ------------------------ Syncher subscribe ---------------------- \\n');\n console.info('invitationURL', invitationURL);\n _this.myIdentity(identity).then(function (identity) {\n myIdentity = identity;\n var input = {\n schema: _this._objectDescURL,\n resource: invitationURL,\n store: true,\n p2p: false,\n mutual: mutual,\n domain_subscription: true,\n identity: identity\n };\n\n if (_this.offline) input.offline = _this.offline;\n\n return syncher.subscribe(input);\n }).then(function (dataObjectObserver) {\n console.info('Data Object Observer: ', dataObjectObserver);\n\n var chat = new _Chat2.default(syncher, _this._domain, myIdentity, _this);\n resolve(chat);\n\n chat.dataObjectObserver = dataObjectObserver;\n\n _this._observersControllers[dataObjectObserver.url] = chat;\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'offline',\n set: function set(offline) {\n this._offline = offline;\n },\n get: function get() {\n return this._offline ? this._offline : false;\n }\n }, {\n key: 'backup',\n set: function set(backup) {\n this._backup = backup;\n },\n get: function get() {\n return this._backup ? this._backup : false;\n }\n }]);\n return SimpleSimpleChatManager;\n}();\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Service Framework\n//import IdentityManager from '../identityManager/IdentityManager';\n//import RegistrationStatus from '../discovery/RegistrationStatus';\n//import Discovery from '../discovery/Discovery';\n//import Syncher from '../syncher/Syncher';\n\n// Utils\n//import {divideURL} from '../utils/utils';\n//import Search from '../utils/Search';\n\n// Internals\n\n\nexports.default = SimpleSimpleChatManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jaGF0TWFuYWdlci9TaW1wbGVDaGF0TWFuYWdlci5qcz9iMmE5Il0sInNvdXJjZXNDb250ZW50IjpbIlxuLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGV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QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7O0FBck5BO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7O0FBckdBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXVCQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQTZRQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///505\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _Bus2 = __webpack_require__(214);\n\nvar _Bus3 = _interopRequireDefault(_Bus2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author micaelpedrosa@gmail.com\n* Message BUS Interface is an extension of the Bus\n* It is used mainly in the internal sandbox routing.\n*/\nvar MiniBus = function (_Bus) {\n (0, _inherits3.default)(MiniBus, _Bus);\n\n function MiniBus() {\n (0, _classCallCheck3.default)(this, MiniBus);\n return (0, _possibleConstructorReturn3.default)(this, (MiniBus.__proto__ || (0, _getPrototypeOf2.default)(MiniBus)).call(this));\n }\n\n /**\n * Post a message for routing. Message is routed directly to the external routing _onPostMessage.\n * @param {Message} inMsg JSON with mandatory Message structure {id, type, from, to}\n * @param {Callback} responseCallback Optional callback if a response is expected from the request. A response will be always sent, even if it is a \"Timeout\".\n * @return {number} the Message id\n */\n\n\n (0, _createClass3.default)(MiniBus, [{\n key: 'postMessage',\n value: function postMessage(inMsg, responseCallback, timeout) {\n var _this = this;\n\n _this._genId(inMsg);\n _this._responseCallback(inMsg, responseCallback, timeout);\n\n //always send to external (to core MessageBus)\n _this._onPostMessage(inMsg);\n\n return inMsg.id;\n }\n\n //internal method used when a message is received by an external routing system\n\n }, {\n key: '_onMessage',\n value: function _onMessage(msg) {\n var _this = this;\n\n if (!_this._onResponse(msg)) {\n var itemList = _this._subscriptions[msg.to];\n if (itemList) {\n _this._publishOn(itemList, msg);\n if (!msg.to.startsWith('hyperty')) {\n _this._publishOnDefault(msg);\n }\n } else {\n _this._publishOnDefault(msg);\n }\n }\n }\n }]);\n return MiniBus;\n}(_Bus3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = MiniBus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9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1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBNaW5pQnVzO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9idXMvTWluaUJ1cy5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFzQkE7QUFDQTs7Ozs7QUFDQTs7Ozs7QUFLQTs7O0FBRUE7QUFBQTtBQUFBO0FBRUE7QUFDQTtBQUNBOzs7Ozs7Ozs7O0FBTUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUF2Q0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJDQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///506\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the "License");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an "AS IS" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n/**\n* @author: Gil Dias (gil.dias@tecnico.ulisboa.pt)\n* Registry Data Model includes all Objects to be handled by the Registry functionality including\n*/\nvar RegistryDataModel = function () {\n function RegistryDataModel(id, url, descriptorURL, p2pRequester, startingTime, lastModified, status, stubs, stubsConfiguration) {\n (0, _classCallCheck3.default)(this, RegistryDataModel);\n\n var _this = this;\n\n _this._id = id;\n _this._url = url;\n _this._descriptorURL = descriptorURL;\n _this._startingTime = startingTime;\n _this._lastModified = lastModified;\n _this._status = status;\n _this._stubs = stubs;\n _this._stubsConfiguration = stubsConfiguration;\n _this._p2pRequester = p2pRequester;\n }\n\n (0, _createClass3.default)(RegistryDataModel, [{\n key: "id",\n get: function get() {\n var _this = this;\n return _this._id;\n }\n }, {\n key: "url",\n get: function get() {\n var _this = this;\n return _this._url;\n }\n }, {\n key: "descriptorURL",\n get: function get() {\n var _this = this;\n return _this._descriptorURL;\n }\n }, {\n key: "p2pRequester",\n get: function get() {\n var _this = this;\n return _this._p2pRequester;\n }\n }, {\n key: "lastModified",\n get: function get() {\n var _this = this;\n return _this._lastModified;\n }\n }]);\n return RegistryDataModel;\n}();\n\nexports.default = RegistryDataModel;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9SZWdpc3RyeURhdGFNb2RlbC5qcz83YTJmIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAx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,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _HypertyInstance = __webpack_require__(215);\n\nvar _HypertyInstance2 = _interopRequireDefault(_HypertyInstance);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Registry'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* Runtime DomainRegistration Interface\n*/\nvar DomainRegistration = function () {\n\n /**\n * To initialise the Runtime Registry with the RuntimeURL that will be the basis to derive the internal runtime addresses when allocating addresses to internal runtime component. In addition, the Registry domain back-end to be used to remotely register Runtime components, is also passed as input parameter.\n * @param {MessageBus} messageBus msgbus\n * @param {HypertyRuntimeURL} runtimeURL runtimeURL\n * @param {DomainURL} domain remoteRegistry\n */\n function DomainRegistration(runtimeURL, registryURL, domain, messageBus) {\n (0, _classCallCheck3.default)(this, DomainRegistration);\n\n\n if (!runtimeURL) throw new Error('runtimeURL is missing.');\n if (!registryURL) throw new Error('registryURL is missing.');\n if (!domain) throw new Error('domain is missing.');\n if (!messageBus) throw new Error('messageBus is missing.');\n\n var _this = this;\n\n _this.registryURL = registryURL;\n _this.runtimeURL = runtimeURL;\n _this._registrationRetries = 5; // number of attempts to register Hyperties and DataObjects when errors occurs\n\n // the expires in 3600, represents 1 hour\n //the expires is in seconds, unit of measure received by the domain registry\n _this.expiresTime = 3600;\n\n _this._domain = domain;\n _this._messageBus = messageBus;\n }\n\n /**\n * function to unregister an hypertyInstance in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n\n (0, _createClass3.default)(DomainRegistration, [{\n key: 'unregisterHyperty',\n value: function unregisterHyperty(hypertyInstance) {\n var _this = this;\n\n var message = { type: 'update', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: '/hyperty/' + hypertyInstance, value: 'disconnected', attribute: 'status' } };\n\n _this._messageBus.postMessage(message, function (reply) {\n log.log('[DomainRegistration] unregister hyperty Reply', reply);\n });\n }\n\n /**\n * function to unregister a Data Object in the Domain Registry\n * @param {String} hypertyInstance HypertyInsntance url\n *\n */\n\n }, {\n key: 'unregisterDataObject',\n value: function unregisterDataObject(url) {\n var _this = this;\n\n var message = { type: 'update', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: {\n resource: url,\n value: {\n status: 'disconnected'\n }\n } };\n\n _this._messageBus.postMessage(message, function (reply) {\n log.log('[DomainRegistration] unregister dataObject Reply', reply);\n });\n }\n\n /**\n * function to delete an dataObjectInstance in the Domain Registry\n * @param {String} name DataObjectName\n */\n\n }, {\n key: 'deleteDataObjectInstance',\n value: function deleteDataObjectInstance(name) {\n var _this = this;\n\n var message = { type: 'delete', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { value: { name: name } } };\n\n _this._messageBus.postMessage(message, function (reply) {\n log.log('[DomainRegistration] unregister dataObject Reply', reply);\n });\n }\n\n /**\n * Function to update an Hyperty\n */\n\n }, {\n key: 'updateHypertyInstance',\n value: function updateHypertyInstance(resource, value) {\n var _this = this;\n\n var message = { type: 'UPDATE', from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: resource, value: value } };\n\n _this._messageBus.post.postMessage(message, function (reply) {\n // log.log('[Registry] Updated hyperty reply', reply);\n });\n }\n\n /**\n * To register a new Data Object in the Domain Registry.\n * @param {JSON} registration registration data to be used\n * @param {boolean} resume if this is just to update the registration with the resume of a data object\n */\n\n }, {\n key: 'registerDataObject',\n value: function registerDataObject(registration, resume, p2pHandlerStub) {\n\n var _this = this;\n\n var p2pHandler = void 0;\n var p2pRequester = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n var dataScheme = [];\n var filteredDataScheme = registration.url.split(':');\n dataScheme.push(filteredDataScheme[0]);\n\n if ((0, _keys2.default)(p2pHandlerStub).length !== 0) {\n p2pHandler = p2pHandlerStub[_this.runtimeURL].url;\n p2pRequester = _runtimeUtils.runtimeUtils.runtimeDescriptor.p2pRequesterStub;\n }\n\n registration.startingTime = registration.created;\n\n delete registration.authorise;\n delete registration.created;\n delete registration.mutual;\n delete registration.resume;\n\n if (!registration.expires) registration.expires = _this.expiresTime;\n\n registration.dataSchemes = dataScheme;\n\n if (p2pHandler) {\n registration.p2pHandler = p2pHandler;\n registration.p2pRequester = p2pRequester;\n }\n\n registration.status = 'live';\n\n var message = void 0;\n\n if (!resume) {\n\n log.log('[Registry.registerDataObject] registering new data object URL', registration);\n\n message = { type: 'create', from: _this.registryURL, to: 'domain://registry.' + _this._domain, body: { value: registration, policy: 'policy' } };\n } else {\n\n log.log('[Registry.registerDataObject] registering previously registered data object URL', registration);\n\n message = {\n type: 'update',\n to: 'domain://registry.' + _this._domain,\n from: _this.registryURL,\n body: { resource: registration.url, value: { status: 'live' } }\n };\n }\n\n try {\n _this._messageBus.postMessageWithRetries(message, _this._registrationRetries, function (reply) {\n // log.log('[Registry.registerDataObject] ===> registerDataObject Reply: ', reply);\n if (reply.body.code === 200) {\n resolve(registration);\n } else {\n reject('error on register DataObject');\n }\n });\n } catch (e) {\n log.error(e);\n reject(e);\n }\n\n //timer to keep the registration alive\n // the time is defined by a little less than half of the expires time defined\n var keepAliveTimer = setInterval(function () {\n\n var message = {\n type: 'update',\n from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: registration.url, value: { status: 'live' }, method: 'refresh' }\n };\n\n _this._messageBus.postMessage(message, function (reply) {\n // log.log('[Registry.registerDataObject] KeepAlive Reply: ', reply);\n });\n }, registration.expires / 1.1 / 2 * 1000);\n });\n }\n\n /**\n * To register a new Hyperty in the Domain Registry.\n * @param {HypertyInstance} hyperty Hyperty to be registered\n * @param {boolean} resume if this is just to update the registration with the resume of a data object\n */\n\n }, {\n key: 'registerHyperty',\n value: function registerHyperty(hyperty, resume) {\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //assuming descriptor come in this format, the service-provider-domain url is retrieved by a split instruction\n //hyperty-catalogue:///\n /* let domainUrl = divideURL(hyperty.descriptorURL).domain;\n \n if (domainUrl.includes('catalogue')) {\n domainUrl = domainUrl.replace('catalogue.', '');\n }\n _this.registryDomain = domainUrl;*/\n\n var runtime = _this.runtimeURL;\n var status = 'live';\n\n //message to register the new hyperty, within the domain registry\n var message = void 0;\n var registrationExpires = _this.expiresTime;\n\n var messageValue = {\n user: hyperty.user.email,\n descriptor: hyperty.descriptorURL,\n url: hyperty.hypertyURL,\n expires: registrationExpires,\n resources: hyperty.resources,\n dataSchemes: hyperty.dataSchemes,\n runtime: runtime,\n status: status\n };\n\n // set a different expires if defined in the hyperty configuration\n\n if (hyperty.p2pHandler) {\n messageValue.p2pHandler = hyperty.p2pHandler;\n messageValue.p2pRequester = hyperty.p2pRequester;\n }\n\n // set a different expires value if configured in the Hyperty descriptor\n\n if (hyperty.descriptor.configuration && hyperty.descriptor.configuration.expires) registrationExpires = hyperty.descriptor.configuration.expires;\n\n if (!resume) {\n // log.log('[Registry registerHyperty] registering new Hyperty URL', addressURL.address[0]);\n\n\n // set a different expires if defined in the hyperty configuration\n\n\n // log.log('[Registry registerHyperty] registering new Hyperty at domain registry ', messageValue);\n\n message = { type: 'create', from: _this.registryURL, to: 'domain://registry.' + _this._domain, body: { value: messageValue, policy: 'policy' } };\n } else {\n // log.log('[Registry registerHyperty] registering previously registered Hyperty URL', addressURL.address[0]);\n\n message = {\n type: 'update',\n to: 'domain://registry.' + _this._domain,\n from: _this.registryURL,\n body: { resource: hyperty.hypertyURL, value: { status: 'live', user: hyperty.user.email } }\n };\n\n if (hyperty.p2pHandler) {\n message.body.value.p2pHandler = hyperty.p2pHandler;\n message.body.value.p2pRequester = hyperty.p2pRequester;\n }\n }\n\n // log.log('[Registry registerHyperty] Hyperty registration at domain registry - ', message);\n\n try {\n _this._messageBus.postMessageWithRetries(message, _this._registrationRetries, function (reply) {\n // log.log('[Registry registerHyperty] Hyperty registration response: ', reply);\n\n if (reply.body.code === 200) {\n var result = { url: hyperty.hypertyURL };\n if (hyperty.p2pHandler) {\n result.p2pHandler = hyperty.p2pHandler;\n result.p2pRequester = hyperty.p2pRequester;\n }\n\n resolve(result);\n } else if (reply.body.code === 404) {\n // log.log('[Registry registerHyperty] The update was not possible. Registering new Hyperty at domain registry');\n\n message = { type: 'create', from: _this.registryURL, to: 'domain://registry.' + _this._domain, body: { value: messageValue, policy: 'policy' } };\n\n try {\n _this._messageBus.postMessageWithRetries(message, _this._registrationRetries, function (reply) {\n // log.log('[Registry registerHyperty] Hyperty registration update response: ', reply);\n\n if (reply.body.code === 200) {\n var _result = { url: hyperty.hypertyURL };\n if (hyperty.p2pHandler) {\n _result.p2pHandler = hyperty.p2pHandler;\n _result.p2pRequester = hyperty.p2pRequester;\n }\n\n resolve(_result);\n } else {\n throw new Error('Failed to register an Hyperty: ' + reply);\n }\n });\n } catch (e) {\n log.error(e);\n reject(e);\n }\n } else {\n throw new Error('Failed to register an Hyperty to domain: ', reply);\n }\n });\n } catch (e) {\n log.error(e);\n reject(e);\n }\n\n //timer to keep the registration alive\n // the time is defined by a little less than half of the expires time defined\n var keepAliveTimer = setInterval(function () {\n\n var message = {\n type: 'update',\n from: _this.registryURL,\n to: 'domain://registry.' + _this._domain,\n body: { resource: hyperty.hypertyURL, value: { status: 'live' }, method: 'refresh' } };\n\n _this._messageBus.postMessage(message, function (reply) {\n // log.log('[Registry registerHyperty] KeepAlive Reply: ', reply);\n });\n }, registrationExpires / 1.1 / 2 * 1000);\n });\n }\n }]);\n return DomainRegistration;\n}();\n\nexports.default = DomainRegistration;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9Eb21haW5SZWdpc3RyYXRpb24uanM/MWE2ZiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4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c2U6ICcsIHJlcGx5KTtcblxuICAgICAgICAgICAgICAgIGlmIChyZXBseS5ib2R5LmNvZGUgPT09IDIwMCkge1xuICAgICAgICAgICAgICAgICAgbGV0IHJlc3VsdCA9IHsgdXJsOiBoeXBlcnR5Lmh5cGVydHlVUkx9O1xuICAgICAgICAgICAgICAgICAgaWYgKGh5cGVydHkucDJwSGFuZGxlcikge1xuICAgICAgICAgICAgICAgICAgICByZXN1bHQucDJwSGFuZGxlciA9IGh5cGVydHkucDJwSGFuZGxlcjtcbiAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnAycFJlcXVlc3RlciA9IGh5cGVydHkucDJwUmVxdWVzdGVyO1xuICAgICAgICAgICAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUocmVzdWx0KTtcblxuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoJ0ZhaWxlZCB0byByZWdpc3RlciBhbiBIeXBlcnR5OiAnICsgcmVwbHkpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgbG9nLmVycm9yKGUpO1xuICAgICAgICAgICAgICByZWplY3QoZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcignRmFpbGVkIHRvIHJlZ2lzdGVyIGFuIEh5cGVydHkgdG8gZG9tYWluOiAnLCByZXBseSk7XG4gICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuXG4gICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgIGxvZy5lcnJvcihlKTtcbiAgICAgICAgcmVqZWN0KGUpO1xuICAgICAgfVxuXG4gICAgICAvL3RpbWVyIHRvIGtlZXAgdGhlIHJlZ2lzdHJhdGlvbiBhbGl2ZVxuICAgICAgLy8gd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E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///508\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('P2PConnectionResolve');\n\n/**\n* To process address resolution for p2p connections\n*/\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n// Log System\n\nvar P2PConnectionResolve = function () {\n function P2PConnectionResolve(registry) {\n (0, _classCallCheck3.default)(this, P2PConnectionResolve);\n\n var _this = this;\n _this._registry = registry;\n _this._remoteP2PEntities = {}; // All remote entities and associated runtime url that are reachable with existing p2p connections\n }\n\n /**\n * Verifies if remote Entity can be reached with a P2P Connection.\n * @param {URL.URL} info object URL\n * @return {HypertyDataObjectInstance} addressURL return the Data Object instance registered URL, return undefined otherwise\n */\n\n (0, _createClass3.default)(P2PConnectionResolve, [{\n key: 'checkP2P',\n value: function checkP2P(msg) {\n\n if (!msg.hasOwnProperty('to')) {\n // throw Error('The p2p verification was failed');\n return _promise2.default.reject('The p2p verification was failed');\n }\n\n var scheme = msg.to.split('://')[0];\n\n var comp = msg.to.split('://')[1].split('/')[2];\n\n var url = void 0;\n\n if (comp) url = msg.to.substring(0, msg.to.indexOf('/' + comp));else url = msg.to;\n\n var p2p = {};\n\n if (msg.body && msg.body.p2p) p2p.p2p = msg.body.p2p;\n\n if (msg.body && msg.body.p2pHandler && msg.body.p2pRequester) {\n p2p.p2pHandler = msg.body.p2pHandler;\n p2p.p2pRequester = msg.body.p2pRequester;\n p2p.runtime = msg.body.p2pHandler.split('/p2phandler/')[0];\n }\n\n switch (scheme) {\n case 'runtime':\n return this.checkP2PRuntime(url, p2p);\n break;\n default:\n return this.checkP2PEntity(url, p2p);\n break;\n\n }\n }\n\n /**\n * Verifies if remote Entity (Hyperty or Data Object) can be reached with a P2P Connection.\n * @param {string} url Remote Entity URL to be checked\n * @param {object} p2p p2p information to be used including ´runtime´ with remote Runtime URL, 'p2pHandler' remote P2P Handler Stub URL and p2pRequester with Catalogue URL of P2P Requester to be used\n * @return {promise} registeredEntity if p2p connection is possible it returns p2p information to be used in the connection, otherwise the promise is rejected\n */\n\n }, {\n key: 'checkP2PEntity',\n value: function checkP2PEntity(url, p2p) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var remoteEntity = _this._remoteP2PEntities[url];\n\n if (remoteEntity) resolve(remoteEntity);else if (p2p.runtime) resolve(p2p); // use provided p2p if available in the message body\n else if (p2p.p2p) {\n // otherwise look on Domain Registry\n\n log.log('[Registry - checkP2PEntity] - search in Domain Registry: ', url);\n\n var message = {\n type: 'read',\n from: _this._registry.registryURL,\n to: 'domain://registry.' + _this._registry._domain,\n body: {\n resource: url\n }\n };\n\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('[Registry - checkP2PEntity] Domain Registry reply', reply);\n if ('value' in reply.body) {\n\n //todo: store retrieved entity\n var resolvedEntity = reply.body.value;\n\n if (resolvedEntity.hasOwnProperty('p2pHandler')) {\n resolve(resolvedEntity);\n } else {\n reject('[Registry checkP2PEntity] Hyperty found does not support P2P', reply.body.value);\n }\n } else {\n reject('[Registry checkP2PEntity] Hyperty with P2PHandler not found', reply.body.code);\n }\n });\n } else reject('[Registry checkP2PEntity] No P2P Connection available for ', url);\n });\n }\n\n /**\n * Verifies if remote Runtime can be reached with a P2P Connection.\n * @param {URL.URL} runtimeURL Runtime URL\n * @return {Object} p2pConnection return the P2PConnection instance registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkP2PRuntime',\n value: function checkP2PRuntime(runtimeURL, p2p) {\n var _this = this;\n\n var registeredRuntime = {};\n\n // look on locally stored p2p connections\n return new _promise2.default(function (resolve, reject) {\n if (_this._registry.p2pConnectionList[runtimeURL]) {\n resolve({ runtime: runtimeURL });\n } else if (p2p.runtime) {\n registeredRuntime = p2p;\n resolve(registeredRuntime);\n } else reject('[Registry.P2PConnectionResolve.checkP2PRuntime] No P2P Connection found to ', runtimeURL);\n });\n }\n\n /**\n * Verifies if remote Hyperty can be reached with a P2P Connection.\n * @param {JSON} info object or entity charateristics info\n * @return {addressURL} addressURL return the URL if there is any previousy registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkP2PHyperty',\n value: function checkP2PHyperty(hypertyURL, p2p) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var hyperty = void 0;\n\n // look on locally stored hyperties\n\n for (var i in _this._registry.remoteHypertyList) {\n hyperty = _this._registry.remoteHypertyList[i];\n\n log.log('[Registry - checkP2PHyperty] - for each Hyperty: ', hyperty);\n\n // todo: change to \"hyperty.url\" to be aligned with hyperty instance data model spec\n\n if (hyperty.hypertyID === hypertyURL) {\n\n if (hyperty.hasOwnProperty('p2pHandler')) {\n resolve(hyperty);\n } else {\n reject('[Registry checkP2PHyperty] Hyperty found does not support P2P', hyperty);\n }\n return;\n }\n }\n\n if (!hyperty && p2p.runtime) resolve(p2p); // use provided p2p if available in the message body\n else if (!hyperty && p2p.p2p) {\n // otherwise look on Domain Registry\n\n log.log('[Registry - checkP2PHyperty] - search in Domain Registry: ', hyperty);\n\n var message = {\n type: 'read',\n from: _this._registry.registryURL,\n to: 'domain://registry.' + _this._registry._domain,\n body: {\n resource: hypertyURL\n }\n };\n\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('[Registry - checkP2PHyperty] Domain Registry reply', reply);\n if ('value' in reply.body) {\n\n //todo: store retrieved hyperty\n var resolvedHyperty = reply.body.value;\n\n _this._registry.remoteHypertyList.push(resolvedHyperty);\n\n if (resolvedHyperty.hasOwnProperty('p2pHandler')) {\n resolve(resolvedHyperty);\n } else {\n reject('[Registry checkP2PHyperty] Hyperty found does not support P2P', reply.body.value);\n }\n } else {\n reject('[Registry checkP2PHyperty] Hyperty with P2PHandler not found', reply.body.code);\n }\n });\n } else reject('[Registry checkP2PHyperty] No P2P Connection available for ', hypertyURL);\n });\n }\n\n /**\n * Verifies if remote Data Object can be reached with a P2P Connection.\n * @param {URL.URL} DataObjectURL object URL\n * @return {HypertyDataObjectInstance} addressURL return the Data Object instance registered URL, return undefined otherwise\n */\n\n }, {\n key: 'checkP2PDataObject',\n value: function checkP2PDataObject(url, p2p) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n // look on locally stored Remote Data Objects\n\n var dataobject = _this._registry.remoteDataObjectList.filter(function (i) {\n return _this._registry.remoteDataObjectList[i].url === url;\n });\n\n if (dataobject.length !== 0 && dataobject[0].p2pRequester) {\n resolve(dataobject[0]);\n } else if (dataobject.length !== 0) {\n reject('[Registry checkP2PDataObject] Data Object found does not support P2P', dataobject[0]);\n } else if (dataobject.length === 0 && p2p.runtime) resolve(p2p); // use provided p2p info if available in the message body\n else if (dataobject.length && p2p.p2p) {\n // otherwise look on Domain Registry\n\n // look on Domain Registry\n\n var message = {\n type: 'read',\n from: _this._registry.registryURL,\n to: 'domain://registry.' + _this._registry._domain,\n body: {\n resource: url\n }\n };\n\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('discover data object per url reply', reply);\n if ('value' in reply.body) {\n\n //todo: store retrieved hyperty\n var resolvedDataObject = reply.body.value;\n\n _this._registry.remoteDataObjectList.push(resolvedDataObject);\n\n if (resolvedDataObject.p2pRequester) {\n resolve(resolvedDataObject);\n } else {\n reject('[Registry checkP2PDataObject] Data Object found does not support P2P', reply.body.value);\n }\n } else {\n reject('[Registry checkP2PDataObject] not found', reply.body.code);\n }\n });\n } else reject('[Registry checkP2PDataObject] no P2P Connection found');\n });\n }\n }, {\n key: 'addRemoteP2PEntity',\n value: function addRemoteP2PEntity(url, runtime) {\n this._remoteP2PEntities[url] = runtime;\n }\n }, {\n key: 'removeRemoteP2PEntity',\n value: function removeRemoteP2PEntity(url) {\n delete this._remoteP2PEntities[url];\n }\n }, {\n key: 'reconnectP2PRequester',\n value: function reconnectP2PRequester(p2pRequester) {\n var _this = this;\n\n log.log('[P2PConenctionResolve.reconnectP2PRequester] lets try to reconnect P2P Requester Stub: ', p2pRequester);\n\n return new _promise2.default(function (resolve, reject) {\n\n var remoteRuntime = p2pRequester.runtime;\n\n var message = {\n type: 'execute',\n from: _this._registry.registryURL,\n to: p2pRequester.url,\n body: {\n method: 'connect',\n params: [p2pRequester.p2pHandler]\n }\n };\n\n // lets prepare the p2pRequesterSTub reconnect by setting an observer to its status changes\n\n _this._registry.watchingYou.observe('p2pRequesterStub', function (change) {\n\n log.log('[P2PConenctionResolve.reconnectP2PRequester] p2pRequesterStubs changed ' + _this._registry.p2pRequesterStub);\n\n if (change.keypath.split('.')[0] === remoteRuntime && change.name === 'status') {\n switch (change.newValue) {\n case 'live':\n log.log('[P2PConenctionResolve.reconnectP2PRequester] p2pRequester is live ' + _this._registry.p2pRequesterStub[remoteRuntime]);\n resolve(_this._registry.p2pRequesterStub[remoteRuntime].url);\n break;\n case 'failed':\n log.log('[P2PConenctionResolve.reconnectP2PRequester] p2pRequester reconnect failed ' + _this._registry.p2pRequesterStub[remoteRuntime]);\n reject('P2P Requester reconnect failed');\n break;\n default:\n }\n }\n });\n\n // stub load\n _this._registry._messageBus.postMessage(message, function (reply) {\n log.log('[P2PConenctionResolve.reconnectP2PRequester] reconnect request reply', reply);\n });\n });\n }\n }]);\n return P2PConnectionResolve;\n}();\n\nexports.default = P2PConnectionResolve;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTA5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9yZWdpc3RyeS9QMlBDb25uZWN0aW9uUmVzb2x2ZS5qcz9iNTVkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ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7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBSkE7QUFDQTtBQVFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRkE7QUFKQTtBQUNBO0FBU0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVRBO0FBV0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///509\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\n__webpack_require__(149);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar WatchingYou = function () {\n function WatchingYou() {\n (0, _classCallCheck3.default)(this, WatchingYou);\n\n this._watching = {};\n this._observers = [];\n }\n\n (0, _createClass3.default)(WatchingYou, [{\n key: 'watch',\n value: function watch(key, object) {\n var _this = this;\n\n var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (deep) {\n this._watching[key] = Object.deepObserve(object, function (changes) {\n changes.every(function (change) {\n _this._fireEvent(key, change);\n });\n });\n } else {\n this._watching[key] = Object.observe(object, function (changes) {\n changes.every(function (change) {\n _this._fireEvent(key, change);\n });\n });\n }\n return this._watching[key];\n }\n }, {\n key: 'observe',\n value: function observe(key, callback) {\n this._observers.push({ key: key, callback: callback });\n }\n }, {\n key: '_fireEvent',\n value: function _fireEvent(key, change) {\n\n this._observers.filter(function (observe) {\n return observe.key === key;\n }).forEach(function (observe) {\n observe.callback(change);\n });\n }\n }]);\n return WatchingYou;\n}();\n\nexports.default = WatchingYou;\n\n/*let watchChanges = new WatchChanges();\nlet p2pRequesterStub = watchChanges.watch('p2p', {}, true);\nlet stub = watchChanges.watch('stub', {});\n\nwatchChanges.observe('p2p', (change) => {\n console.log('p2pRequesterStub: ' + change.name + ' - ' + JSON.stringify(change.newValue));\n});\n\nwatchChanges.observe('p2p', (change) => {\n console.log('p2pRequesterStub: ' + change.name + ' - ' + JSON.stringify(change.newValue));\n});\n\nwatchChanges.observe('stub', (change) => {\n console.log('stub ' + change.name);\n});\n\np2pRequesterStub.a = {};\nstub.b = {name: 'vitor'};\np2pRequesterStub.a.name = 'Hello';\nstub.b = {name: 'vitor'};\np2pRequesterStub.a.age = '32';\np2pRequesterStub.a.name = 'World';*/\n\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9XYXRjaGluZ1lvdS5qcz84ODYyIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAncHJveHktb2JzZXJ2ZSc7XG5cbmNsYXNzIFdhdGNoaW5nWW91IHtcblxuICBjb25zdHJ1Y3RvcigpIHtcbiAgICB0aGlzLl93YXRjaGluZyA9IHt9O1xuICAgIHRoaXMuX29ic2VydmVycyA9IFtdO1xuIC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UNBO0FBQ0E7OztBQUNBO0FBQUE7QUFDQTtBQURBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7QUFJQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///510\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _runtimeConfiguration = __webpack_require__(151);\n\nvar _Identities = __webpack_require__(217);\n\nvar _Identities2 = _interopRequireDefault(_Identities);\n\nvar _GuiFake = __webpack_require__(516);\n\nvar _GuiFake2 = _interopRequireDefault(_GuiFake);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('IdentityModule'); // Log System\n\n/**\n*\n* The Identity Module (Id Module) is the component responsible for handling the\n* user identity and the association of this identity with the Hyperty instances,\n* in order to make Hyperty instances identifiable. The identity in the reTHINK project\n* is not fixed to a unique Identity Service Provider, but obtained through several\n* different Identity sources. With this approach, the Id Module provides to the user the\n* option to choose the preferred method for authentication.\n* This module will thus able to support multiple Identity acquisition methods,\n* such as OpenID connect 1.0, Kerberos System, or authentication through smart cards.\n* For example, a user with a Google account can use the Google as an Identity Provider to provide Identity Tokens,\n* which can be used by the Identity Module to associate it with a Hyperty instance.\n*\n* The Identity Module uses a node package, the HelloJS, which is a client-side JavaScript API for authentication\n* that facilitates the requests for the OpenID connect protocol. This method allows for some abstraction\n* when making requests for different Identity Providers, such as OpenID connect used by Google, Facebook, Microsoft, for example.\n*\n* When a request for a user identity is made using the method loginWithRP(identifier, scope),\n* this method will analyse the Identity Provider chosen to obtain an identity and will use the HelloJS node package\n* with the selected Identity Provider and identity scope. After the HelloJS request for an Access Token\n* to the Identity Providers, the user will be prompted to authenticate towards the Identity Provider.\n* Upon receiving the Access Token, this token is validated with a RESTful web service request to an endpoint\n* on the Identity Provider Authorization Server, and after the validation is done,\n* an ID token is obtained with the information according to the scope required.\n* This ID token is then preserved in this module that can obtained through the getIdentities()\n* and is passed as return value of the loginWithRP function. The methods generateAssertion and validateAssertion have not yet been developed.\n*\n*/\nvar IdentityModule = function () {\n\n /**\n * This is the constructor to initialise the Identity Module it does not require any input.\n */\n function IdentityModule(runtimeURL, runtimeCapabilities, storageManager, dataObjectsStorage, cryptoManager, runtimeCatalogue) {\n (0, _classCallCheck3.default)(this, IdentityModule);\n\n var _this = this;\n\n if (!runtimeURL) throw new Error('runtimeURL is missing.');\n if (!storageManager) throw new Error('storageManager is missing');\n if (!cryptoManager) throw new Error('cryptoManager is missing');\n if (!runtimeCatalogue) throw new Error('runtimeCatalogue is missing');\n\n _this._runtimeURL = runtimeURL;\n\n _this._runtimeCatalogue = runtimeCatalogue;\n\n _this.dataObjectsStorage = dataObjectsStorage;\n _this._idmURL = _this._runtimeURL + '/idm';\n _this._guiURL = _this._runtimeURL + '/identity-gui';\n _this.runtimeCapabilities = runtimeCapabilities;\n\n _this._domain = (0, _utils.divideURL)(_this._runtimeURL).domain;\n\n //to store items with this format: {identity: identityURL, token: tokenID}\n _this._identities = new _Identities2.default('human', storageManager);\n\n // to be reviewed: watchingYou identitiesList or identities?\n // _this.identitiesList = _this.watchingYou.watch('identitiesList', {}, true);\n _this._crypto = cryptoManager;\n\n /* _this.emailsList = [];\n let newIdentity = new Identity('guid', 'HUMAN');\n _this.identity = newIdentity;\n _this.currentIdentity;\n _this.identities.defaultIdentity;*/\n\n //stores the association of the dataObject and the Hyperty registered within\n _this.dataObjectsIdentity = {}; // is this needed?\n\n _this._listOfIdps = [];\n\n // variable to know if the GUI is deployed to choose the identity. if the real GUI is not deployed, a fake gui is deployed instead.\n _this.guiDeployed = false;\n }\n\n //******************* GET AND SET METHODS *******************\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n\n (0, _createClass3.default)(IdentityModule, [{\n key: 'getIdentity',\n\n\n //******************* IDENTITY RELEATED METHODS *******************\n /**\n * gets all the information from a given userURL\n * @param {String} userURL user url\n * @return {JSON} identity identity bundle from the userURL\n */\n value: function getIdentity(userURL) {\n return this.identities.getIdentity(userURL);\n }\n\n /**\n * Function to set the current Identity with a given Identity\n * @param {Identity} identity identity\n */\n\n /* setCurrentIdentity(identity) {\n let _this = this;\n _this.currentIdentity = identity;\n }*/\n\n /**\n * Function to return all the identities registered within a session by a user.\n * These identities are returned in an array containing a JSON package for each user identity.\n * @return {Array} Identities\n */\n\n }, {\n key: 'getIdentitiesToChoose',\n value: function getIdentitiesToChoose() {\n var _this2 = this;\n\n // let identities = _this.identities.identifiers;\n\n // let idps = [\n // { domain: 'google.com', type: 'idToken'},\n // { domain: 'microsoft.com', type: 'idToken'},\n // { domain: 'orange.fr', type: 'idToken'},\n // { domain: 'slack.com', type: 'Legacy'}\n // ];\n\n // todo: retrieve available idps from runtime catalogue\n // todo: enable oauth idps\n // let idps = [\n // { domain: 'google.com', type: 'idToken' },\n // { domain: 'microsoft.com', type: 'idToken' },\n // { domain: 'facebook.com', type: 'idToken' },\n // { domain: 'slack.com', type: 'idToken' }\n // ];\n\n return new _promise2.default(function (resolve) {\n\n var url = _runtimeConfiguration.runtimeConfiguration.catalogueURLs.idpProxy.prefix + _this2._domain + _runtimeConfiguration.runtimeConfiguration.catalogueURLs.idpProxy.suffix;\n\n _promise2.default.all([_this2.runtimeCapabilities.isAvailable('browser'), _this2.runtimeCapabilities.isAvailable('node')]).then(function (result) {\n\n var isBrowser = result[0];\n var isNode = result[1];\n\n var constraints = { constraints: {} };\n constraints.constraints.node = isNode;\n constraints.constraints.browser = isBrowser;\n\n _this2._runtimeCatalogue.getTypeList(url, constraints).then(function (idps) {\n var listOfIdps = idps.map(function (key) {\n return { domain: key, type: 'idToken' };\n });\n log.info('[IdentityModule.getIdentityAssertion:getIdentitiesToChoose]', idps, listOfIdps);\n _this2._listOfIdps = listOfIdps;\n return resolve({ defaultIdentity: _this2.identities.defaultIdentity, identities: _this2.identities.identities, idps: listOfIdps });\n });\n });\n });\n }\n\n /**\n * Function to return the selected Identity within a session\n * @return {Identity} identity identity\n */\n /* getCurrentIdentity() {\n let _this = this;\n return _this.currentIdentity;\n }*/\n\n }, {\n key: 'init',\n value: function init() {\n var _this = this;\n return new _promise2.default(function (resolve) {\n _this._identities.loadIdentities().then(function () {\n\n _this._crypto.getMyPublicKey().then(function (key) {\n var hash = _this._crypto.crypto._sha256((0, _utils.stringify)(key)).then(function (hash) {\n\n var guid = 'user-guid://' + hash;\n _this.identities.guid = guid;\n _this._identities.loadAccessTokens().then(function () {\n\n resolve();\n });\n }).catch(function (error) {\n console.log('[IdentityModule] error', error);\n });\n });\n });\n });\n }\n\n /**\n * Function that fetch an identityAssertion from a user.\n *\n * @return {IdAssertion} IdAssertion\n */\n\n }, {\n key: 'getIdentityAssertion',\n value: function getIdentityAssertion(identityBundle) {\n log.log('[IdentityModule.getIdentityAssertion:identityBundle]', identityBundle);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //CHECK whether is browser environment or nodejs\n //if it is browser, then create a fake identity\n\n _this.runtimeCapabilities.isAvailable('browser').then(function (result) {\n log.log('runtime browser identity acquisition', result);\n\n if (!result) return;\n\n //todo: only idp should be mandatory when identityBundle exists\n\n if (identityBundle && identityBundle.hasOwnProperty('idp')) {\n\n var idp = identityBundle.idp;\n var origin = identityBundle.hasOwnProperty('origin') ? identityBundle.origin : 'origin';\n var idHint = identityBundle.hasOwnProperty('idHint') ? identityBundle.idHint : '';\n\n if (_this.identities.defaultIdentity) {\n var assertion = _this.identities.defaultIdentity;\n\n if (assertion.expires > (0, _utils.secondsSinceEpoch)()) {\n return resolve(assertion);\n } else if (assertion.hasOwnProperty('refresh')) {\n log.log('[Identity.IdentityModule.getIdentityAssertion] refreshing assertion: ', assertion);\n\n _this._refreshIdAssertion().then(function (newAssertion) {\n log.log('[IdentityModule.getIdentityAssertion] refreshed assertion.', newAssertion);\n return resolve(newAssertion);\n }, function (error) {\n log.error('[IdentityModule.getIdentityAssertion] error on refresIdAssertion: ', error, ' Asking for a new IdAssertion.');\n _this._getIdAssertionForDomain(origin, idp, idHint).then(function (assertion) {\n resolve(assertion);\n }, function (error) {\n reject(error);\n });\n });\n } else {\n _this._getIdAssertionForDomain(origin, idp, idHint).then(function (assertion) {\n resolve(assertion);\n }, function (error) {\n reject(error);\n });\n }\n } else {\n _this._getIdAssertionForDomain(origin, idp, idHint).then(function (assertion) {\n resolve(assertion);\n }, function (error) {\n reject(error);\n });\n }\n } else if (_this.identities.defaultIdentity) {\n var _assertion = _this.identities.defaultIdentity;\n\n if (_assertion.expires > (0, _utils.secondsSinceEpoch)()) {\n return resolve(_assertion);\n } else if (_assertion.hasOwnProperty('refresh')) {\n log.log('[Identity.IdentityModule.getValidToken] refreshing assertion: ', _assertion);\n\n _this._refreshIdAssertion(_assertion).then(function (newAssertion) {\n log.log('[IdentityModule.getIdentityAssertion] refreshed assertion.', newAssertion);\n return resolve(newAssertion);\n }, function (error) {\n log.error('[IdentityModule.getIdentityAssertion] error on refresIdAssertion: ', error, ' Asking for a new IdAssertion.');\n\n _this.selectIdentityFromGUI().then(function (assertion) {\n\n log.log('[IdentityModule] Identity selected from GUI.');\n\n _this.identities.defaultIdentity = assertion.userProfile.userURL;\n return resolve(assertion);\n }, function (err) {\n return reject(err);\n });\n });\n } else {\n _this.selectIdentityFromGUI().then(function (assertion) {\n\n log.log('[IdentityModule] Identity selected from GUI.');\n\n _this.identities.defaultIdentity = assertion.userProfile.userURL;\n return resolve(assertion);\n }, function (err) {\n return reject(err);\n });\n }\n } else {\n _this.selectIdentityFromGUI().then(function (assertion) {\n\n log.log('[IdentityModule] Identity selected from GUI.');\n\n _this.identities.defaultIdentity = assertion.userProfile.userURL;\n return resolve(assertion);\n }, function (err) {\n return reject(err);\n });\n }\n }).catch(function (error) {\n log.error('Error on identity acquisition ', error);\n return reject(error);\n });\n\n _this.runtimeCapabilities.isAvailable('node').then(function (result) {\n log.log('node identity acquisition', result);\n\n if (!result) return;\n\n if (_this.identities.currentIdentity) {\n //TODO verify whether the token is still valid or not.\n // should be needed to make further requests, to obtain a valid token\n return resolve(_this.identities.currentIdentity);\n } else {\n log.log('getIdentityAssertion for nodejs');\n\n var idp = { type: 'idp', value: 'nodejs-idp', code: 200, auth: false };\n _this.callNodeJsGenerateMethods(idp.value, 'origin').then(function (value) {\n resolve(value);\n }, function (err) {\n reject(err);\n });\n }\n }).catch(function (error) {\n log.error('Error on identity acquisition ', error);\n reject(error);\n });\n });\n }\n }, {\n key: '_getIdAssertionForDomain',\n value: function _getIdAssertionForDomain(origin, idp, idHint) {\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.selectIdentityForHyperty(origin, idp, idHint).then(function (assertion) {\n log.log('[IdentityModule._getIdAssertionForDomain] Identity selected by hyperty.');\n return resolve(assertion);\n }, function (err) {\n // if it got an error then just select identity from GUI\n // log.error('[IdentityModule] Could not select identity from hyperty.');\n\n _this.selectIdentityFromGUI().then(function (newAssertion) {\n log.log('[IdentityModule._getIdAssertionForDomain] Identity selected by hyperty.');\n return resolve(newAssertion);\n }, function (err) {\n return reject(err);\n });\n });\n });\n }\n }, {\n key: '_refreshIdAssertion',\n value: function _refreshIdAssertion(assertion) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.sendRefreshMessage(assertion).then(function (newAssertion) {\n log.log('[Identity.IdentityModule.getValidToken] refreshed assertion: ', newAssertion);\n _this.identities.updateAssertion(newAssertion).then(function () {\n resolve(newAssertion);\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error updating the assertion ', err);\n reject(err);\n });\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error refreshing the assertion ', err);\n reject(err);\n });\n });\n }\n\n /**\n * Function to return all the users URLs registered within a session\n * These users URLs are returned in an array of strings.\n * @return {Array} users\n */\n\n }, {\n key: 'getUsersIDs',\n value: function getUsersIDs() {\n /* log.log('[getUsersIDs:emailFormat]', emailFormat);\n log.log('getUsersIDs:emailFormat', emailFormat);\n let _this = this;\n let users = [];*/\n\n //if request comes with the emailFormat option, then convert url to email format\n /* let converter = (emailFormat) ? getUserEmailFromURL : (value) => { return value; };\n for (let index in _this.identities) {\n let identity = _this.identities[index];\n users.push(converter(identity.identity));\n }*/\n\n return this.identities.identifiers;\n }\n\n /**\n * Function to remove an identity\n * @param {String} userURL userURL\n * @return {Promise}\n */\n\n }, {\n key: 'deleteIdentity',\n value: function deleteIdentity(userURL) {\n\n return this.identities.removeIdentity(userURL);\n }\n\n /**\n * Function to unregister an identity from the emailsList array and not show in to the GUI\n * @param {String} email email\n */\n /* unregisterIdentity(email) {\n let _this = this;\n for (let e in _this.emailsList) {\n if (_this.emailsList[e] === email) {\n _this.emailsList.splice(e, 1);\n }\n }\n }*/\n\n /**\n * Function that sends a request to the GUI using messages. Sends all identities registered and\n * the Idps supported, and return the identity/idp received by the GUI\n * @param {Array} identities list of identitiies\n * @param {Array} idps list of idps to authenticate\n * @return {Promise} returns a chosen identity or idp\n */\n\n }, {\n key: 'requestIdentityToGUI',\n value: function requestIdentityToGUI(identities, idps) {\n log.log('[IdentityModule.requestIdentityToGUI:identities]', identities);\n log.log('[IdentityModule.requestIdentityToGUI:idps]', idps);\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n //condition to check if the real GUI is deployed. If not, deploys a fake gui\n if (_this.guiDeployed === false) {\n var guiFakeURL = _this._guiURL;\n var guiFake = new _GuiFake2.default(guiFakeURL, _this._messageBus);\n _this.guiFake = guiFake;\n _this.guiDeployed = true;\n }\n\n var message = {\n type: 'create', to: _this._guiURL, from: _this._idmURL,\n body: { value: { identities: identities, idps: idps } }\n };\n\n var callback = function callback(msg) {\n _this._messageBus.removeResponseListener(_this._idmURL, msg.id);\n\n // todo: to return the user URL and not the email or identifier\n\n if (msg.body.code === 200) {\n var selectedIdentity = msg.body;\n\n log.log('selectedIdentity: ', selectedIdentity.value);\n resolve(selectedIdentity);\n } else {\n reject('error on requesting an identity to the GUI');\n }\n };\n\n //postMessage with callback but without timeout\n try {\n _this._messageBus.postMessage(message, callback, false);\n } catch (err) {\n reject('In method callIdentityModuleFunc error: ' + err);\n }\n });\n }\n }, {\n key: 'callNodeJsGenerateMethods',\n value: function callNodeJsGenerateMethods(idp, origin) {\n log.log('[callNodeJsGenerateMethods:idp]', idp);\n log.log('[callNodeJsGenerateMethods:origin]', origin);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n //debugger;\n var publicKey = void 0;\n\n //let keyPair = nodeJSKeyPairPopulate;\n\n //generates the RSA key pair\n _this._crypto.getMyPublicKey().then(function (key) {\n\n log.log('[callNodeJsGenerateMethods:key]', key);\n\n publicKey = (0, _utils.stringify)(key);\n\n log.log('[callNodeJsGenerateMethods] NO_URL');\n\n return _this.generateAssertion(publicKey, origin, 'url', idp);\n }).then(function (value) {\n if (value) {\n resolve(value);\n } else {\n reject('Error on obtaining Identity');\n }\n }).catch(function (err) {\n log.log(err);\n reject(err);\n });\n });\n }\n }, {\n key: 'callGenerateMethods',\n value: function callGenerateMethods(idp, origin) {\n log.log('[callGenerateMethods:idp]', idp);\n log.log('[callGenerateMethods:origin]', origin);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var publicKey = void 0;\n\n //generates the RSA key pair\n _this._crypto.getMyPublicKey().then(function (key) {\n\n log.log('[callGenerateMethods:key]', key);\n\n publicKey = (0, _utils.stringify)(key);\n\n // userkeyPair = keyPair;\n log.log('generateAssertion:no_hint');\n return _this.generateAssertion(publicKey, origin, '', idp);\n }).then(function (url) {\n _this.myHint = url;\n log.log('generateAssertion:hint');\n return _this.generateAssertion(publicKey, origin, url, idp);\n }).then(function (value) {\n if (value) {\n resolve(value);\n } else {\n reject('Error on obtaining Identity');\n }\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n });\n }\n }, {\n key: 'loginSelectedIdentity',\n value: function loginSelectedIdentity(publicKey, origin, idp, loginUrl) {\n log.log('[loginSelectedIdentity:publicKey]', publicKey);\n log.log('[loginSelectedIdentity:origin]', origin);\n log.log('[loginSelectedIdentity:idp]', idp);\n\n // log.log('[loginSelectedIdentity:keyPair]', keyPair);\n log.log('[loginSelectedIdentity:loginUrl]', loginUrl);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n log.log('[IdentityModule] openPopup');\n _this.callIdentityModuleFunc('openPopup', { urlreceived: loginUrl }).then(function (idCode) {\n return idCode;\n }, function (err) {\n log.error('Error while logging in for the selected identity.');\n return reject(err);\n }).then(function (idCode) {\n _this.sendGenerateMessage(publicKey, origin, idCode, idp).then(function (newResponse) {\n if (newResponse.hasOwnProperty('assertion')) {\n _this.identities.addAssertion(newResponse).then(function (result) {\n resolve('Login was successfull');\n }).catch(function (err) {\n reject('Login has failed:' + err);\n });\n } else {\n log.error('Error while logging in for the selected identity.');\n return reject('Could not generate a valid assertion for selected identity.');\n }\n }).catch(function (err) {\n reject('On loginSelectedIdentity from method sendGenerateMessage error: ' + err);\n });\n });\n });\n }\n }, {\n key: 'selectIdentityForHyperty',\n value: function selectIdentityForHyperty(origin, idp, idHint) {\n log.log('[selectIdentityForHyperty:origin]', origin);\n log.log('[selectIdentityForHyperty:idp]', idp);\n log.log('[selectIdentityForHyperty:idHint]', idHint);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //generates the RSA key pair\n _this._crypto.getMyPublicKey().then(function (key) {\n var publicKey = (0, _utils.stringify)(key);\n\n _this.sendGenerateMessage(publicKey, origin, idHint, idp).then(function (response) {\n if (response.hasOwnProperty('assertion')) {\n // identity was logged in, just save it\n _this.identities.addAssertion(response).then(function (value) {\n return resolve(response);\n }, function (err) {\n return reject(err);\n });\n } else if (response.hasOwnProperty('loginUrl')) {\n // identity was not logged in\n _this.loginSelectedIdentity(publicKey, origin, idp, response.loginUrl).then(function (value) {\n return resolve(value);\n }, function (err) {\n return reject(err);\n });\n } else {\n // you should never get here, if you do then the IdP Proxy is not well implemented\n // log.error('GenerateAssertion returned invalid response.');\n log.log('Proceeding by logging in.');\n _this.callGenerateMethods(idp, origin).then(function (value) {\n return resolve(value);\n }, function (err) {\n return reject(err);\n });\n }\n }).catch(function (err) {\n reject('On selectIdentityForHyperty from method sendGenerateMessage error: ' + err);\n });\n }).catch(function (err) {\n reject('On selectIdentityForHyperty from method generateRSAKeyPair error: ' + err);\n });\n });\n }\n }, {\n key: 'selectIdentityFromGUI',\n value: function selectIdentityFromGUI(origin) {\n var _this3 = this;\n\n log.log('[IdentityModule.selectIdentityFromGUI:origin]', origin);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this3.getIdentitiesToChoose().then(function (identitiesInfo) {\n return _this.requestIdentityToGUI(identitiesInfo.identities, identitiesInfo.idps);\n }).then(function (value) {\n\n if (value.type === 'identity') {\n\n // let chosenID = getUserURLFromEmail(value.value);\n // hack while the user url is not returned from requestIdentityToGUI;\n\n /* let chosenID = 'user://' + _this.identities.currentIdentity.idp.domain + '/' + value.value;\n _this.identities.defaultIdentity = _this.identities.currentIdentity;*/\n\n // returns the identity info from the chosen id\n // if (_this.identities.currentIdentity) resolve(_this.identities.currentIdentity.assertion);\n if (_this.identities.identities[value.value]) resolve(_this.identities.identities[value.value]);else reject('[IdentityModule.selectIdentityFromGUI] identity not found: ', value.value);\n } else if (value.type === 'idp') {\n\n _this.callGenerateMethods(value.value, origin).then(function (value) {\n return resolve(value);\n }, function (err) {\n return reject(err);\n });\n } else {\n return reject('error on GUI received message.');\n }\n }).catch(function (err) {\n reject('On selectIdentityFromGUI from method requestIdentityToGUI error: ' + err);\n });\n });\n }\n }, {\n key: 'callIdentityModuleFunc',\n value: function callIdentityModuleFunc(methodName, parameters) {\n log.log('[callIdentityModuleFunc:methodName]', methodName);\n log.log('[callIdentityModuleFunc:parameters]', parameters);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var message = {\n type: 'execute', to: _this._guiURL, from: _this._idmURL,\n body: { resource: 'identity', method: methodName, params: parameters }\n };\n\n //post msg with callback but without timout\n var callback = function callback(msg) {\n _this._messageBus.removeResponseListener(_this._idmURL, msg.id);\n var result = msg.body.value;\n resolve(result);\n };\n try {\n\n _this._messageBus.postMessage(message, callback, false);\n } catch (err) {\n reject('In method callIdentityModuleFunc error: ' + err);\n }\n });\n }\n\n //******************* TOKEN METHODS *******************\n /**\n * get a Token to be added to a message\n * @param {String} fromURL origin of the message\n * @param {String} toURL target of the messageok\n * @return {JSON} token token to be added to the message\n */\n\n }, {\n key: 'getToken',\n value: function getToken(msg) {\n var _this = this;\n var fromURL = msg.from;\n var toUrl = msg.to;\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('source')) {\n fromURL = msg.body.source;\n }\n\n if (msg.type === 'forward') {\n fromURL = msg.body.from;\n }\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('subscriber')) {\n fromURL = msg.body.subscriber;\n }\n\n return new _promise2.default(function (resolve, reject) {\n log.log('[IdentityModule.getToken] for msg ', msg);\n\n //log.log('toUrl', toUrl);\n _this.registry.isLegacy(toUrl).then(function (result) {\n // log.log('[Identity.IdentityModule.getToken] isLEGACY: ', result);\n if (result) {\n\n _this._getAccessToken(msg).then(function (token) {\n log.log('[IdentityModule.getToken] access token ', token);\n resolve((0, _utils.deepClone)(token));\n }).catch(function (err) {\n reject('[IdentityModule.getToken] Access Token error ' + err);\n });\n } else {\n _this._getValidToken(fromURL).then(function (token) {\n resolve(token);\n }).catch(function (err) {\n reject('On getToken from method _getValidToken error: ' + err);\n });\n }\n }).catch(function (err) {\n reject('On getToken from method isLegacy error: ' + err);\n });\n });\n }\n\n /**\n * get an Id Token for a HypertyURL\n * @param {String} hypertyURL the Hyperty address\n * @return {JSON} token Id token to be added to the message\n */\n\n }, {\n key: 'getIdToken',\n value: function getIdToken(hypertyURL) {\n log.info('getIdToken:hypertyURL ', hypertyURL);\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n var splitURL = hypertyURL.split('://');\n var userURL = void 0;\n if (splitURL[0] !== 'hyperty') {\n // it is a Data Object URL\n\n _this._getHypertyFromDataObject(hypertyURL).then(function (returnedHypertyURL) {\n\n userURL = _this.registry.getHypertyOwner(returnedHypertyURL);\n\n if (userURL) {\n var _identity = _this.identities.getIdentity(userURL);\n if (_identity) return resolve(_identity);else return reject('[IdentityModule.getIdToken] Identity not found for: ', userURL);\n } else {\n return reject('[IdentityModule.getIdToken] User not found for hyperty: ', returnedHypertyURL);\n }\n }).catch(function (reason) {\n log.error('[IdentityModule.getIdToken] Error: ', reason);\n reject(reason);\n });\n } else {\n userURL = _this.registry.getHypertyOwner(hypertyURL);\n if (userURL) {\n\n var _identity2 = _this.identities.getIdentity(userURL);\n if (_identity2) return resolve(_identity2);else return reject('[IdentityModule.getIdToken] Identity not found for: ', userURL);\n } else {\n return reject('[IdentityModule.getIdToken] User not found for hyperty: ', userURL);\n }\n }\n });\n }\n\n /**\n * get an Access Token for an external API\n * @param {String} url the external url\n * @return {JSON} token Access token to be added to the message\n */\n\n }, {\n key: '_getAccessToken',\n value: function _getAccessToken(msg) {\n var url = msg.to;\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n if (!msg.hasOwnProperty('body')) {\n return reject('[IdentityModule._getAccessToken] missing mandatory msg body: ', msg);\n }\n if (!msg.body.hasOwnProperty('value')) {\n return reject('[IdentityModule._getAccessToken] missing mandatory msg body value: ', msg);\n }\n if (!msg.body.value.hasOwnProperty('resources')) {\n return reject('[IdentityModule._getAccessToken] missing mandatory msg body value resources: ', msg);\n }\n var domainToCheck = (0, _utils.divideURL)(url).domain;\n\n if (url.includes('protostub')) {\n domainToCheck = domainToCheck.replace(domainToCheck.split('.')[0] + '.', '');\n }\n\n var resources = msg.body.value.resources;\n\n _this._getAccessTokenForDomain(domainToCheck, resources).then(function (token) {\n resolve(token);\n });\n });\n }\n }, {\n key: '_getAccessTokenForDomain',\n value: function _getAccessTokenForDomain(domainToCheck, resources) {\n var _this = this;\n var token = void 0;\n\n return new _promise2.default(function (resolve, reject) {\n\n try {\n token = _this.identities.getAccessToken(domainToCheck, resources);\n } catch (e) {\n return reject('[IdentityModule._getAccessTokenForDomain] Access Token error ' + err);\n }\n\n if (!token) {\n _this._getNewAccessToken(domainToCheck, resources).then(function (token) {\n log.log('[Identity.IdentityModule._getAccessTokenForDomain] new Access Token ', token);\n return resolve(token);\n }).catch(function (err) {\n reject('[IdentityModule._getAccessTokenForDomain] on getNewAccessToken ' + err);\n });\n } else if (token.status === 'in-progress') {\n return resolve(_this._inProgressAccessToken(domainToCheck, resources));\n } else {\n var timeNow = (0, _utils.secondsSinceEpoch)();\n\n log.log('[Identity.IdentityModule._getAccessTokenForDomain] found Access Token ', token);\n\n if (timeNow >= token.expires) {\n // if (true) {\n if (token.hasOwnProperty(\"refresh\")) {\n _this._refreshAccessToken((0, _utils.deepClone)(token)).then(function (newToken) {\n return resolve(_this.identities.updateAccessToken(newToken));\n });\n } else return resolve(_this._getNewAccessToken(domainToCheck, resources));\n } else return resolve((0, _utils.deepClone)(token));\n }\n });\n }\n }, {\n key: '_inProgressAccessToken',\n value: function _inProgressAccessToken(domain, resources) {\n var _this4 = this;\n\n this.identities.watchingYou.observe('accessTokens', function (change) {\n\n log.log('[IdentityModule._inProgressAccessToken] accessTokens changed ' + _this4.identities.accessTokens);\n\n var keypath = change.keypath;\n\n if (keypath.includes('status')) {\n keypath = keypath.replace('.status', '');\n }\n\n if (keypath === domain && change.name === 'status' && change.newValue === 'created') {\n // log.log('[Identity.IdentityModule.getToken] token is created ' + _this.identitiesList[domain]);\n return _this4.identities.getAccessToken(domain, resources);\n }\n });\n }\n }, {\n key: '_getNewAccessToken',\n value: function _getNewAccessToken(domain, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.identities.setAccessTokenInProgress(domain);\n\n var message = {\n type: 'execute',\n to: _this._resolveDomain(domain),\n from: _this._idmURL,\n body: {\n method: 'getAccessTokenAuthorisationEndpoint',\n params: resources\n }\n };\n\n //let's first get the authorisation URL from the Idp Proxy\n _this._messageBus.postMessage(message, function (res) {\n if (res.body.code > 299) {\n return reject('[IdentityModule._getNewAccessToken] Error on getAccessTokenAuthorisationEndpoint from IdP Proxy: ', res.body.desc);\n }\n\n // let's ask the user for authorisation\n _this.callIdentityModuleFunc('openPopup', { urlreceived: res.body.value }).then(function (authorisation) {\n log.log('[IdentityModule:callIdentityModuleFunc:openPopup] auhtorisation result: ', authorisation);\n\n message.body.method = 'getAccessToken';\n message.body.params = {\n resources: resources,\n login: authorisation\n };\n\n //wihtout callback to avoid timeout errors?\n\n // let's ask Access Token from the Idp Proxy\n _this._messageBus.postMessage(message, function (res) {\n if (res.body.code > 299) return reject('[IdentityModule._getNewAccessToken] Error on getAccessToken from IdP Proxy: ', res.body.desc);\n\n _this.identities.addAccessToken(res.body.value).then(function (token) {\n log.info('[IdentityModule._getNewAccessToken] resolving token: ', token);\n return resolve(res.body.value);\n }, function (err) {\n reject(err);\n });\n });\n }, function (err) {\n reject(err);\n });\n });\n });\n }\n }, {\n key: '_refreshAccessToken',\n value: function _refreshAccessToken(outdatedToken) {\n var _this = this;\n\n // let domain = _this._resolveDomain(oldIdentity.idp);\n // let message;\n // let assertion = _this.getIdentity(oldIdentity.userProfile.userURL);\n\n log.log('IdentityModule._refreshAccessToken:outdatedToken', outdatedToken);\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(outdatedToken.domain);\n var message = void 0;\n\n message = { type: 'execute', to: domain, from: _this._idmURL, body: { method: 'refreshAccessToken', params: { token: outdatedToken } } };\n try {\n _this._messageBus.postMessage(message, function (res) {\n var result = res.body.value;\n resolve(result);\n });\n } catch (err) {\n reject('In IdentityModule._refreshAccessToken on postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'sendRefreshMessage',\n value: function sendRefreshMessage(oldIdentity) {\n var _this = this;\n\n // let domain = _this._resolveDomain(oldIdentity.idp);\n // let message;\n // let assertion = _this.getIdentity(oldIdentity.userProfile.userURL);\n\n log.log('sendRefreshMessage:oldIdentity', oldIdentity);\n\n return new _promise2.default(function (resolve, reject) {\n var domain = _this._resolveDomain(oldIdentity.idp.domain);\n var message = void 0;\n var assertion = _this.getIdentity(oldIdentity.userProfile.userURL);\n\n log.info('sendRefreshMessage:oldIdentity', oldIdentity);\n\n message = { type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'refreshAssertion', params: { identity: assertion } } };\n try {\n _this._messageBus.postMessage(message, function (res) {\n if (res.body.code < 300) {\n var result = res.body.value;\n resolve(result);\n } else resolve(res.body.value.body.params, identity);\n });\n } catch (err) {\n reject('In sendRefreshMessage on postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'getAccessToken',\n value: function getAccessToken(idpDomain, resources, login) {\n log.log('[getAccessToken:idpDomain]', idpDomain);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(idpDomain);\n var message = void 0;\n\n message = {\n type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'getAccessToken', params: { resources: resources, login: login } }\n };\n try {\n _this._messageBus.postMessage(message, function (res) {\n\n if (res.body.code < 299) {\n var result = res.body.value;\n resolve(result);\n } else resolve(res.body);\n });\n } catch (err) {\n reject('IdentityModule.In getAccessToken: ' + err);\n }\n });\n }\n }, {\n key: 'getAccessTokenAuthorisationEndpoint',\n value: function getAccessTokenAuthorisationEndpoint(scope, idpDomain) {\n log.log('[getAccessTokenAuthorisationEndpoint:idpDomain]', idpDomain);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(idpDomain);\n var message = void 0;\n\n message = {\n type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'getAccessTokenAuthorisationEndpoint', params: { resources: scope } }\n };\n try {\n _this._messageBus.postMessage(message, function (res) {\n var result = res.body.value;\n resolve(result);\n });\n } catch (err) {\n reject('In getAccessTokenAuthorisationEndpoint: ' + err);\n }\n });\n }\n }, {\n key: 'sendGenerateMessage',\n value: function sendGenerateMessage(contents, origin, usernameHint, idpDomain) {\n log.log('[sendGenerateMessage:contents]', contents);\n log.log('[sendGenerateMessage:origin]', origin);\n log.log('[sendGenerateMessage:usernameHint]', usernameHint);\n log.log('[sendGenerateMessage:idpDomain]', idpDomain);\n log.log('sendGenerateMessage_hint');\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = _this._resolveDomain(idpDomain);\n var message = void 0;\n\n message = {\n type: 'execute', to: domain, from: _this._idmURL, body: { resource: 'identity', method: 'generateAssertion', params: { contents: contents, origin: origin, usernameHint: usernameHint } }\n };\n try {\n _this._messageBus.postMessage(message, function (res) {\n\n if (res.body.code < 300) resolve(res.body.value);else reject(res.body);\n });\n } catch (err) {\n reject('In sendGenerateMessage: ' + err);\n }\n });\n }\n\n /**\n * Requests the IdpProxy from a given Domain for an identityAssertion\n *\n * @param {DOMString} contents contents\n * @param {DOMString} origin origin\n * @param {DOMString} usernameHint usernameHint\n * @param {JSON} keyPair user keyPair\n * @return {IdAssertion} IdAssertion\n */\n\n }, {\n key: 'generateAssertion',\n value: function generateAssertion(contents, origin, usernameHint, idpDomain) {\n log.log('[generateAssertion:contents]', contents);\n log.log('[generateAssertion:origin]', origin);\n log.log('[generateAssertion:usernameHint]', usernameHint);\n\n // log.log('[generateAssertion:keyPair]', keyPair);\n log.log('[generateAssertion:idpDomain]', idpDomain);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n log.log('[IdentityModule:sendGenerateMessage:sendGenerateMessage]', usernameHint);\n _this.sendGenerateMessage(contents, origin, usernameHint, idpDomain).then(function (result) {\n\n if (result) {\n\n _this.identities.addAssertion(result).then(function (value) {\n resolve(result);\n }, function (err) {\n reject(err);\n });\n } else {\n reject('error on obtaining identity information');\n }\n }, function (error) {\n if (error.hasOwnProperty('description') && error.description.hasOwnProperty('loginUrl')) {\n _this.callIdentityModuleFunc('openPopup', { urlreceived: error.description.loginUrl }).then(function (value) {\n log.log('[IdentityModule:callIdentityModuleFunc:openPopup]', usernameHint);\n\n resolve(value);\n }, function (err) {\n reject(err);\n });\n } else {\n log.error('[IdentityModule:sendGenerateMessage] generate assertion with hint error ', error);\n reject(error);\n }\n }).catch(function (err) {\n reject('On generateAssertion from method sendGenerateMessage error: ' + err);\n });\n });\n }\n\n /**\n * Requests the IdpProxy from a given Domain to validate an IdentityAssertion\n * Returns a promise with the result from the validation.\n * @param {DOMString} assertion\n * @param {DOMString} origin origin\n * @return {Promise} Promise promise with the result from the validation\n */\n\n }, {\n key: 'validateAssertion',\n value: function validateAssertion(assertion, origin, idpDomain) {\n log.log('[validateAssertion:assertion]', assertion);\n log.log('[validateAssertion:origin]', origin);\n log.log('[validateAssertion:idpDomain]', idpDomain);\n var _this = this;\n\n var domain = _this._resolveDomain(idpDomain);\n\n var message = {\n type: 'execute', to: domain, from: _this._idmURL, body: {\n resource: 'identity', method: 'validateAssertion',\n params: { assertion: assertion, origin: origin }\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n try {\n _this._messageBus.postMessage(message, function (result) {\n if (result.body.code === 200) {\n resolve(result.body.value);\n } else {\n reject('error', result.body.code);\n }\n });\n } catch (err) {\n reject('On validateAssertion from method postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'addGUIListeners',\n value: function addGUIListeners() {\n var _this = this;\n\n _this._messageBus.addListener(_this._idmURL, function (msg) {\n var funcName = msg.body.method;\n\n log.log('[IdentityModule:addGUIListeners]', msg, msg.body, funcName);\n\n var returnedValue = void 0;\n\n if (funcName === 'deployGUI') {\n returnedValue = _this.deployGUI();\n } else if (funcName === 'getIdentitiesToChoose') {\n _this.getIdentitiesToChoose().then(function (result) {\n // if the function requested is not a promise\n var value = { type: 'execute', value: result, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'unregisterIdentity') {\n var email = msg.body.params.email;\n returnedValue = _this.unregisterIdentity(email);\n } else if (funcName === 'getMyPublicKey') {\n // because generateRSAKeyPair is a promise\n // we have to send the message only after getting the key pair\n _this._crypto.getMyPublicKey().then(function (pubKey) {\n pubKey = (0, _utils.stringify)(pubKey);\n var value = { type: 'execute', value: pubKey, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if generateRSAKeyPair method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'sendGenerateMessage') {\n var contents = msg.body.params.contents;\n var origin = msg.body.params.origin;\n var usernameHint = msg.body.params.usernameHint;\n var idpDomain = msg.body.params.idpDomain;\n var _replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to };\n _this.sendGenerateMessage(contents, origin, usernameHint, idpDomain).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n _replyMsg.body = value;\n try {\n _this._messageBus.postMessage(_replyMsg);\n } catch (err) {\n log.error('IdentityModule.addGUIListeners sendGenerateMessage error: ' + err);\n }\n }, function (err) {\n log.info('IDPProxy generateAssertion reply error ' + err);\n _replyMsg.body = err;\n _this._messageBus.postMessage(_replyMsg);\n });\n return;\n } else if (funcName === 'getAccessTokenAuthorisationEndpoint') {\n var scope = msg.body.params.scope;\n var _idpDomain = msg.body.params.idpDomain;\n _this.getAccessTokenAuthorisationEndpoint(scope, _idpDomain).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if sendGenerateMessage method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'addAccessToken') {\n var accessToken = msg.body.params;\n\n _this.identities.addAccessToken(accessToken).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'getAccessToken') {\n\n var domain = msg.body.params.idpDomain;\n var resources = msg.body.params.resources;\n var login = msg.body.params.login;\n var _replyMsg2 = { id: msg.id, type: 'response', to: msg.from, from: msg.to };\n\n _this.getAccessToken(domain, resources, login).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n _replyMsg2.body = value;\n try {\n _this._messageBus.postMessage(_replyMsg2);\n } catch (err) {\n log.error('On addGUIListeners from if sendGenerateMessage method postMessage error: ' + err);\n }\n }, function (error) {\n try {\n _replyMsg2.body = error;\n _this._messageBus.postMessage(_replyMsg2);\n } catch (err) {\n log.error('On addGUIListeners from if sendGenerateMessage method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'addAssertion') {\n var result = msg.body.params;\n\n // let keyPair = msg.body.params.keyPair;\n _this.identities.addAssertion(result).then(function (returnedValue) {\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n return;\n } else if (funcName === 'refreshAccessToken') {\n var _domain = msg.body.params.domain;\n var _resources = msg.body.params.resources;\n\n _this._getAccessTokenForDomain(_domain, _resources).then(function (token) {\n var replyMsg = {\n id: msg.id,\n type: 'response',\n to: msg.from,\n from: msg.to,\n body: {\n value: token.accessToken,\n code: 200\n }\n };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners for refreshAccessToken request: ' + err);\n }\n });\n return;\n } /*else if (funcName === 'selectIdentityForHyperty') {\n let origin = msg.body.params.origin;\n let idp = msg.body.params.idp;\n let idHint = msg.body.params.idHint;\n _this.selectIdentityForHyperty(origin, idp, idHint);\n return;\n }*/\n\n // if the function requested is not a promise\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n try {\n _this._messageBus.postMessage(replyMsg);\n } catch (err) {\n log.error('On addGUIListeners from if storeIdentity method postMessage error: ' + err);\n }\n });\n }\n }, {\n key: 'deployGUI',\n value: function deployGUI() {\n var _this = this;\n _this.guiDeployed = true;\n }\n\n //******************* PRIVATE METHODS *******************\n /**\n * GetValidToken is for non legacy hyperties and verifies if the Token is still valid\n * if the token is invalid it requests a new token\n * @param {String} hypertyURL hypertyURL\n * @return {Promise}\n */\n\n }, {\n key: '_getValidToken',\n value: function _getValidToken(hypertyURL) {\n log.log('[IdentityModule._getValidToken]:hypertyURL', hypertyURL);\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this.getIdToken(hypertyURL).then(function (assertion) {\n log.log('[IdentityModule._getValidToken] retrieved IdAssertion', assertion);\n var timeNow = (0, _utils.secondsSinceEpoch)();\n\n if (!assertion.hasOwnProperty('expires')) return resolve(assertion);\n\n var expirationDate = assertion.expires;\n\n /* if (completeId.hasOwnProperty('info')) {\n if (completeId.info.hasOwnProperty('expires')) {\n expirationDate = completeId.info.expires;\n } else if (completeId.info.hasOwnProperty('tokenIDJSON')) {\n expirationDate = completeId.info.tokenIDJSON.exp;\n } else {\n // throw 'The ID Token does not have an expiration time';\n log.info('The ID Token does not have an expiration time');\n resolve(assertion);\n }\n } else if (completeId.hasOwnProperty('infoToken') && completeId.infoToken.hasOwnProperty('exp')) {\n expirationDate = completeId.infoToken.exp;\n } else {\n // throw 'The ID Token does not have an expiration time';\n log.info('The ID Token does not have an expiration time');\n resolve(assertion);\n }*/\n\n log.log('[Identity.IdentityModule.getValidToken] Token expires in', expirationDate);\n log.log('[Identity.IdentityModule.getValidToken] time now:', timeNow);\n\n if (timeNow >= expirationDate) {\n // if (timeNow >= 0) {\n if (assertion.hasOwnProperty('refresh')) {\n log.log('[Identity.IdentityModule.getValidToken] refreshing assertion: ', assertion);\n\n _this.sendRefreshMessage(assertion).then(function (newAssertion) {\n log.log('[Identity.IdentityModule.getValidToken] refreshed assertion: ', newAssertion);\n _this.identities.updateAssertion(newAssertion).then(function () {\n resolve(newAssertion);\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error updating the assertion ', err);\n reject(err);\n });\n }, function (err) {\n log.error('[IdentityModule.getValidToken] error refreshing the assertion ', err);\n reject(err);\n });\n } else {\n // no refresh token available, user has to authenticate again to get a new assertion\n // generate new idToken\n _this.callGenerateMethods(assertion.idp.domain).then(function (value) {\n resolve(value);\n }).catch(function (err) {\n reject('[IdentityModule.getValidToken] error when generating a new assertion ' + err);\n });\n }\n } else {\n resolve(assertion);\n }\n }).catch(function (error) {\n log.error('[IdentityModule.getValidToken] error on getIdToken', error);\n reject(error);\n });\n });\n }\n\n /**\n * returns the reporter associated to the dataObject URL\n * @param {String} dataObjectURL dataObject url\n * @return {String} reporter dataObject url reporter\n */\n\n }, {\n key: '_getHypertyFromDataObject',\n value: function _getHypertyFromDataObject(dataObjectURL) {\n log.info('_getHypertyFromDataObject:dataObjectURL', dataObjectURL);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var splitedURL = (0, _utils.divideURL)(dataObjectURL);\n var domain = splitedURL.domain;\n var finalURL = (0, _utils.parseMessageURL)(dataObjectURL);\n\n // check if is the creator of the hyperty\n var reporterURL = _this.registry.getReporterURLSynchonous(finalURL);\n log.info('_getHypertyFromDataObject:reporterURL', reporterURL);\n\n if (reporterURL) {\n resolve(reporterURL);\n } else {\n // check if there is already an association from an hypertyURL to the dataObject\n var storedReporterURL = _this.dataObjectsIdentity[finalURL];\n log.info('_getHypertyFromDataObject:storedReporterURL', storedReporterURL);\n\n if (storedReporterURL) {\n resolve(storedReporterURL);\n } else {\n // check if there is any hyperty that subscribed the dataObjectURL\n var subscriberHyperty = _this.registry.getDataObjectSubscriberHyperty(dataObjectURL);\n log.info('_getHypertyFromDataObject:subscriberHyperty', subscriberHyperty);\n\n if (subscriberHyperty) {\n resolve(subscriberHyperty);\n } else {\n // search in domain registry for the hyperty associated to the dataObject\n // search in case is a subscriber who wants to know the reporter\n // To be reviewed in order to avoid the discovery transaction\n _this._coreDiscovery.discoverDataObjectPerURL(finalURL, domain).then(function (dataObject) {\n log.info('_getHypertyFromDataObject:dataObject', dataObject);\n _this.dataObjectsIdentity[finalURL] = dataObject.reporter;\n log.info('_getHypertyFromDataObject:dataObject.reporter', dataObject.reporter);\n resolve(dataObject.reporter);\n }, function (err) {\n reject(err);\n });\n }\n }\n }\n });\n }\n\n /**\n * Function that resolve and create the domainURL in case it is provided one. If not, resolve the default domainURL\n * @param {String} idpDomain idpDomain (Optional)\n */\n\n }, {\n key: '_resolveDomain',\n value: function _resolveDomain(idpDomain) {\n if (!idpDomain) {\n return 'domain-idp://google.com';\n } else {\n return 'domain-idp://' + idpDomain;\n }\n }\n\n /*\n _secondsSinceEpoch() {\n return Math.floor(Date.now() / 1000);\n }*/\n\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n _this.addGUIListeners();\n }\n\n /**\n * return the coreDiscovery component\n * do we need this??\n */\n\n }, {\n key: 'coreDiscovery',\n get: function get() {\n var _this = this;\n return _this._coreDiscovery;\n }\n\n /**\n * Set the coreDiscovery component\n * @param {coreDiscovery} coreDiscovery\n */\n ,\n set: function set(coreDiscovery) {\n var _this = this;\n _this._coreDiscovery = coreDiscovery;\n }\n\n /**\n * return the registry in this idModule\n * @param {registry} registry\n */\n\n }, {\n key: 'registry',\n get: function get() {\n var _this = this;\n return _this._registry;\n }\n\n /**\n * Set the registry in this idModule\n * @param {registry} reg\n */\n ,\n set: function set(registry) {\n var _this = this;\n _this._registry = registry;\n }\n }, {\n key: 'identities',\n get: function get() {\n var _this = this;\n return _this._identities;\n },\n set: function set(identities) {\n var _this = this;\n _this._identities = identities;\n }\n }, {\n key: 'idps',\n get: function get() {\n return this._listOfIdps;\n }\n }]);\n return IdentityModule;\n}();\n\nexports.default = IdentityModule;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTExLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0eU1vZHVsZS5qcz81MTE1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignSWRlbnRpdHlNb2R1bGUnKTtcblxuaW1wb3J0IHsgc2Vjb25kc1NpbmNlRXBvY2gsIGRpdmlkZVVSTCwgcGFyc2V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AgICAgICAgICAgIHJldHVybiByZXNvbHZlKG5ld0Fzc2VydGlvbik7XG4gICAgICAgICAgICAgIH0sIChlcnJvcik9PiB7XG4gICAgICAgICAgICAgICAgbG9nLmVycm9yKCdbSWRlbnRpdHlNb2R1bGUuZ2V0SWRlbnRpdHlBc3NlcnRpb25dIGVycm9yIG9uIHJlZnJlc0lkQXNzZXJ0aW9uOiAnLCBlcnJvciwgJyBBc2tpbmcgZm9yIGEgbmV3IElkQXNzZXJ0aW9uLicpXG4gICAgICAgICAgICAgICAgX3RoaXMuX2dldElkQXNzZXJ0aW9uRm9yRG9tYWluKG9yaWdpbiwgaWRwLCBpZEhpbnQpLnRoZW4oKGFzc2VydGlvbik9PiB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKGFzc2VydGlvbik7XG4gICAgICAgICAgICAgICAgfSwgKGVycm9yKT0+e1xuICAgICAgICAgICAgICAgICAgcmVqZWN0KGVycm9yKTtcbiAgICAgICAgICAgICAgICB9KTsgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIF90aGlzLl9nZXRJZEFzc2VydGlvbkZvckRvbWFpbihvcmlnaW4sIGlkcCwgaWRIaW50KS50aGVuKChhc3NlcnRpb24pPT4ge1xuICAgICAgICAgICAgICByZXNvbHZlKGFzc2VydGlvbik7XG4gICAgICAgICAgICB9LCAoZXJyb3IpPT57XG4gICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IFxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIF90aGlzLl9nZXRJZEFzc2VydGlvbkZvckRvbWFpbihvcmlnaW4sIGlkcCwgaWRIaW50KS50aGVuKChhc3NlcnRpb24pPT4ge1xuICAgICAgICAgICAgcmVzb2x2ZShhc3NlcnRpb24pO1xuICAgICAgICAgIH0sIChlcnJvcik9PntcbiAgICAgICAgICAgIHJlamVjdCh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aXR5RnJvbUdVSSgpLnRoZW4oKGFzc2VydGlvbikgPT4ge1xuXG4gICAgICAgICAgICAgICAgbG9nLmxvZygnW0lkZW50aXR5TW9kdWxlXSBJZGVudGl0eSBzZWxlY3RlZCBmcm9tIEdVSS4nKTtcbiAgXG4gICAgICAgICAgICAgICAgX3RoaXMuaWRlbnRpdGllcy5kZWZhdWx0SWRlbnRpdHkgPSBhc3NlcnRpb24udXNlclByb2ZpbGUudXNlclVSTDtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVzb2x2ZShhc3NlcnRpb24pO1xuICBcbiAgICAgICAgICAgICAgfSwgKGVycikgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKTtcbiAgICAgICAgICAgICAgfSk7XG4gIFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgfSBlbHNlICB7XG4gICAgICAgICAgICBfdGhpcy5zZWxlY3RJZGVudGl0eUZyb21HVUkoKS50aGVuKChhc3NlcnRpb24pID0+IHtcblxuICAgICAgICAgICAgICBsb2cubG9nKCdbSWRlbnRpdHlNb2R1bGVdIElkZW50aXR5IHNlbGVjdGVkIGZyb20gR1VJLicpO1xuXG4gICAgICAgICAgICAgIF90aGlzLmlkZW50aXRpZXMuZGVmYXVsdElkZW50aXR5ID0gYXNzZXJ0aW9uLnVzZXJQcm9maWxlLnVzZXJVUkw7XG4gICAgICAgICAgICAgIHJldHVybiByZXNvbHZlKGFzc2VydGlvbik7XG5cbiAgICAgICAgICAgIH0sIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIF90aGlzLnNlbGVjdElkZW50aXR5RnJvbUdVSSgpLnRoZW4oKGFzc2VydGlvbikgPT4ge1xuXG4gICAgICAgICAgICBsb2cubG9nKCdbSWRlbnRpdHlNb2R1bGVdIElkZW50aXR5IHNlbGVjdGVkIGZyb20gR1VJLicpO1xuXG4gICAgICAgICAgICBfdGhpcy5pZGVudGl0aWVzLmRlZmF1bHRJZGVudGl0eSA9IGFzc2VydGlvbi51c2VyUHJvZmlsZS51c2VyVVJMO1xuICAgICAgICAgICAgcmV0dXJuIHJlc29sdmUoYXNzZXJ0aW9uKTtcblxuICAgICAgICAgIH0sIChlcnIpID0+IHtcbiAgICAgICAgICAgIHJldHVybiByZWplY3QoZXJyKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICB9XG4gICAgICB9KS5jYXRjaChlcnJvciA9PiB7XG4gICAgICAgIGxvZy5lcnJvcignRXJyb3Igb24gaWRlbnRpdHkgYWNxdWlzaXRpb24gJywgZXJyb3IpO1xuICAgICAgICByZXR1cm4gcmVqZWN0KGVycm9yKTtcbiAgICAgIH0pO1xuXG4gICAgICBfdGhpcy5ydW50aW1lQ2FwYWJpbGl0aWVzLmlzQXZhaWxhYmxlKCdub2RlJykudGhlbigocmVzdWx0KSA9PiB7XG4gICAgICAgIGxvZy5sb2coJ25vZGUgaWRlbnRpdHkgYWNxdWlzaXRpb24nLCByZXN1bHQpO1xuXG4gICAgICAgIGlmICghcmVzdWx0KSByZXR1cm47XG5cbiAgICAgICAgaWYgKF90aGlzLmlkZW50aXRpZXMuY3VycmVudElkZW50aXR5KSB7XG4gICAgICAgICAgLy9UT0RPIHZlcmlmeSB3aGV0aGVyIHRoZSB0b2tlbiBpcyBzdGlsbCB2YWxpZCBvciBub3QuXG4gICAgICAgICAgLy8gc2hvdWxkIGJlIG5lZWRlZCB0byBtYWtlIGZ1cnRoZXIgcmVxdWVzdHMsIHRvIG9idGFpbiBhIHZhbGlkIHRva2VuXG4gICAgICAgICAgcmV0dXJuIHJlc29sdmUoX3RoaXMuaWRlbnRpdGllcy5jdXJyZW50SWRlbnRpdHkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGxvZy5sb2coJ2dldElkZW50aXR5QXNzZXJ0aW9uIGZvciBub2Rlan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1xuXG4gICAgICAgIF90aGlzLl9nZXRBY2Nlc3NUb2tlbkZvckRvbWFpbihkb21haW4sIHJlc291cmNlcykudGhlbigodG9rZW4pPT4ge1xuICAgICAgICAgIGxldCByZXBseU1zZyA9IHsgXG4gICAgICAgICAgICBpZDogbXNnLmlkLCBcbiAgICAgICAgICAgIHR5cGU6ICdyZXNwb25zZScsIFxuICAgICAgICAgICAgdG86IG1zZy5mcm9tLCBcbiAgICAgICAgICAgIGZyb206IG1zZy50bywgXG4gICAgICAgICAgICBib2R5OiB7XG4gICAgICAgICAgICAgIHZhbHVlOiB0b2tlbi5hY2Nlc3NUb2tlbixcbiAgICAgICAgICAgICAgY29kZTogMjAwXG4gICAgICAgICAgICB9IFxuICAgICAgICAgIH07XG4gICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgIF90aGlzLl9tZXNzYWdlQnVzLnBvc3RNZXNzYWdlKHJlcGx5TXNnKTtcbiAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgIGxvZy5lcnJvcignT24gYWRkR1VJTGlzdGVuZXJzIGZvciByZWZyZXNoQWNjZXNzVG9rZW4gcmVxdWVzdDogJyArIGVycik7XG4gICAgICAgICAgfVxuXG4gICAgICAgIH0pO1xuICAgICAgICByZXR1cm47XG4gICAgICB9LyplbHNlIGlmIChmdW5jTmFtZSA9PT0gJ3NlbGVjdElkZW50aXR5Rm9ySHlwZXJ0eScpIHtcbiAgICAgICAgbGV0IG9yaWdpbiA9IG1zZy5ib2R5LnBhcmFtcy5vcmlnaW47XG4gICAgICAgIGxldCBpZHAgPSBtc2cuYm9keS5wYXJhbXMuaWRwO1xuICAgICAgICBsZXQgaWRIaW50ID0gbXNnLmJvZHkucGFyYW1zLmlkSGludDtcbiAgICAgICAgX3RoaXMuc2VsZWN0SWRlbnRpdHlGb3JIeXBlcnR5KG9yaWdpbiwgaWRwLCBpZEhpbnQpO1xuICAgICAgICByZXR1cm47XG4gICAgICB9Ki9cblxuICAgICAgL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R5LklkZW50aXR5TW9kdWxlLmdldFZhbGlkVG9rZW5dIHJlZnJlc2hpbmcgYXNzZXJ0aW9uOiAnLCBhc3NlcnRpb24pO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBfdGhpcy5zZW5kUmVmcmVzaE1lc3NhZ2UoYXNzZXJ0aW9uKS50aGVuKChuZXdBc3NlcnRpb24pID0+IHtcbiAgICAgICAgICAgICAgICBsb2cubG9nKCdbSWRlbnRpdHkuSWRlbnRpdHlNb2R1bGUuZ2V0VmFsaWRUb2tlbl0gcmVmcmVzaGVkIGFzc2VydGlvbjogJywgbmV3QXNzZXJ0aW9uKTtcbiAgICAgICAgICAgICAgX3RoaXMuaWRlbnRpdGllcy51cGRhdGVBc3NlcnRpb24obmV3QXNzZXJ0aW9uKS50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICByZXNvbHZlKG5ld0Fzc2VydGlvbik7XG4gICAgICAgICAgICAgIH0sIChlcnIpID0+IHtcbiAgICAgICAgICAgICAgICBsb2cuZXJyb3IoJ1tJZGVudGl0eU1vZHVsZS5nZXRWYWxpZFRva2VuXSBlcnJvciB1cGRhdGluZyB0aGUgYXNzZXJ0aW9uICcsIGVycik7XG4gICAgICAgICAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSwgKGVycikgPT4ge1xuICAgICAgICAgICAgICBsb2cuZXJyb3IoJ1tJZGVudGl0eU1vZHVsZS5nZXRWYWxpZFRva2VuXSBlcnJvciByZWZyZXNoaW5nIHRoZSBhc3NlcnRpb24gJywgZXJyKTtcbiAgICAgICAgICAgICAgcmVqZWN0KGVycik7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9IGVsc2UgeyAvLyBubyByZWZyZXNoIHRva2VuIGF2YWlsYWJsZSwgdXNlciBoYXMgdG8gYXV0aGVudGljYXRlIGFnYWluIHRvIGdldCBhIG5ldyBhc3NlcnRpb25cbiAgICAgICAgICAgIC8vIGdlbm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QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQW43Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTs7O0FBNEJBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7Ozs7QUFpMkNBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///511\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(513), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9udW1iZXIvaXMtaW50ZWdlci5qcz80NTFhIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9udW1iZXIvaXMtaW50ZWdlclwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9udW1iZXIvaXMtaW50ZWdlci5qc1xuLy8gbW9kdWxlIGlkID0gNTEyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///512\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(514);\nmodule.exports = __webpack_require__(11).Number.isInteger;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTEzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9udW1iZXIvaXMtaW50ZWdlci5qcz83MzhlIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uLy4uL21vZHVsZXMvZXM2Lm51bWJlci5pcy1pbnRlZ2VyJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5OdW1iZXIuaXNJbnRlZ2VyO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL251bWJlci9pcy1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSA1MTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///513\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar $export = __webpack_require__(26);\n\n$export($export.S, 'Number', { isInteger: __webpack_require__(515) });\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5udW1iZXIuaXMtaW50ZWdlci5qcz9kNWE5Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIDIwLjEuMi4zIE51bWJlci5pc0ludGVnZXIobnVtYmVyKVxudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcblxuJGV4cG9ydCgkZXhwb3J0LlMsICdOdW1iZXInLCB7IGlzSW50ZWdlcjogcmVxdWlyZSgnLi9faXMtaW50ZWdlcicpIH0pO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvZXM2Lm51bWJlci5pcy1pbnRlZ2VyLmpzXG4vLyBtb2R1bGUgaWQgPSA1MTRcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///514\n")},function(module,exports,__webpack_require__){eval("// 20.1.2.3 Number.isInteger(number)\nvar isObject = __webpack_require__(46);\nvar floor = Math.floor;\nmodule.exports = function isInteger(it) {\n return !isObject(it) && isFinite(it) && floor(it) === it;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19pcy1pbnRlZ2VyLmpzPzAwYTgiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gMjAuMS4yLjMgTnVtYmVyLmlzSW50ZWdlcihudW1iZXIpXG52YXIgaXNPYmplY3QgPSByZXF1aXJlKCcuL19pcy1vYmplY3QnKTtcbnZhciBmbG9vciA9IE1hdGguZmxvb3I7XG5tb2R1bGUuZXhwb3J0cyA9IGZ1bmN0aW9uIGlzSW50ZWdlcihpdCkge1xuICByZXR1cm4gIWlzT2JqZWN0KGl0KSAmJiBpc0Zpbml0ZShpdCkgJiYgZmxvb3IoaXQpID09PSBpdDtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9faXMtaW50ZWdlci5qc1xuLy8gbW9kdWxlIGlkID0gNTE1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///515\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('IdentityModule');\n\n/**\n* fake class for the gui to select the identity,\n* TODO replace with the proper identity GUI\n*\n*/\n// Log System\n\nvar GuiFake = function GuiFake(url, messageBus) {\n (0, _classCallCheck3.default)(this, GuiFake);\n\n log.log('FakeGUI_deployed');\n var _this = this;\n\n _this._url = url;\n _this._waitTime = 10000;\n _this._messageBus = messageBus;\n\n _this._messageBus.addListener(_this._url, function (msg) {\n\n if (msg.hasOwnProperty('type') && msg.type === 'create' && msg.body.hasOwnProperty('value') && msg.body.value.hasOwnProperty('identities') && msg.body.value.hasOwnProperty('idps')) {\n\n var identities = msg.body.value.identities;\n var idps = msg.body.value.idps;\n\n var value = void 0;\n\n if (identities[0] !== undefined) {\n value = { type: 'identity', value: identities[0], code: 200 };\n } else {\n value = { type: 'idp', value: idps[2].domain, code: 200 };\n }\n\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n\n // to test on the identity side the listener without the timeout\n // can represent the time the user takes to choose and identity\n if (msg.body.value === 'wait') {\n\n setTimeout(function () {\n _this._messageBus.postMessage(replyMsg);\n }, _this._waitTime);\n } else {\n _this._messageBus.postMessage(replyMsg);\n }\n } else {\n log.log('Ignoring messages not intended to FakeGUI.', msg);\n }\n });\n};\n\nexports.default = GuiFake;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9HdWlGYWtlLmpzP2Q4YTciXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdJZGVudGl0eU1vZHVsZScpO1xuXG4vKipcbiogZmFrZSBjbGFzcyBmb3IgdGhlIGd1aSB0byBzZWxlY3QgdGhlIGlkZW50aXR5LFxuKiBUT0RPIHJlcGxhY2Ugd2l0aCB0aGUgcHJvcGVyIGlkZW50aXR5IEdVSVxuKlxuKi9cbmNsYXNzIEd1aUZha2Uge1xuXG4gIGNvbnN0cnVjdG9yKHVybCwgbWVzc2FnZUJ1cykge1xuICAgIGxvZy5sb2coJ0Zha2VHVUlfZGVwbG95ZWQnKTtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgX3RoaXMuX3VybCA9IHVyb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TtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///516\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _Identities = __webpack_require__(217);\n\nvar _Identities2 = _interopRequireDefault(_Identities);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Provides an API to manage identities from msg bus pipeline\n* TODO: rename to something like IdentityPipelineHandler in order not to conflict with framework related IdentityHandler\n*/\n\nvar log = logger.getLogger('IdentityHandler');\n\nvar IdentityHandler = function () {\n function IdentityHandler(idm) {\n (0, _classCallCheck3.default)(this, IdentityHandler);\n\n var _this = this;\n\n _this._idm = idm;\n }\n\n (0, _createClass3.default)(IdentityHandler, [{\n key: 'reset',\n value: function reset() {\n console.log('IM reset');\n\n // this._idm.identities.reset();\n this._idm.identities = new _Identities2.default(this._idm.identities._type, this._idm.identities._storageManager);\n console.log(this._idm.identities);\n }\n }, {\n key: '_isToSetID',\n value: function _isToSetID(message) {\n var schemasToIgnore = ['domain-idp', 'runtime', 'domain'];\n\n var _from = message.from;\n\n if (message.body && message.body.hasOwnProperty('source')) {\n _from = message.body.source;\n }\n\n if (message.body && message.body.hasOwnProperty('subscriber')) {\n _from = message.body.subscriber;\n }\n\n if (message.type === 'forward') {\n return false;\n }\n\n // Signalling Messages between P2P Stubs don't have Identities. FFS\n if (_from.includes('/p2prequester/') || _from.includes('/p2phandler/')) {\n return false;\n }\n\n var splitFrom = _from.split('://');\n var fromSchema = splitFrom[0];\n var isToIgnore = schemasToIgnore.indexOf(fromSchema) === -1;\n\n return isToIgnore;\n }\n }, {\n key: 'processMessage',\n value: function processMessage(message) {\n var _this2 = this;\n\n log.log('[IdentityHandler.processMessage] ', message);\n\n return new _promise2.default(function (resolve, reject) {\n\n // skip messages that don't need identity tokens in the body\n\n if (!_this2._isToSetID(message)) return resolve(message);\n\n /* let from = message.from;\n let sourceURL = undefined;\n if ( message.hasOwnProperty('body') && message.body.hasOwnProperty('source')) {\n from = message.body.source;\n }\n if (message.type === 'forward') {\n from = message.body.from;\n }\n if (message.hasOwnProperty('body') && message.body.hasOwnProperty('subscriber')) {\n from = message.body.subscriber;\n }*/\n\n _this2._idm.getToken(message).then(function (identity) {\n\n if (!message.hasOwnProperty('body')) message.body = {};\n\n message.body.identity = identity;\n resolve(message);\n }).catch(function (reason) {\n log.error(reason);\n reject(reason);\n });\n });\n }\n }]);\n return IdentityHandler;\n}();\n\nexports.default = IdentityHandler;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9pZGVudGl0eS9JZGVudGl0eUhhbmRsZXIuanM/ZTcwYiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogUHJvdmlkZXMgYW4gQVBJIHRvIG1hbmFnZSBpZGVudGl0aWVzIGZyb20gbXNnIGJ1cyBwaXBlbGluZVxuKiBUT0RPOiByZW5hbWUgdG8gc29tZXRoaW5nIGxpa2UgSWRlbnR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R5L0lkZW50aXR5SGFuZGxlci5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBS0E7QUFDQTtBQURBO0FBQ0E7QUFBQTtBQUNBOzs7Ozs7O0FBUEE7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBRUE7QUFBQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7OztBQWNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFHQTs7Ozs7QUFLQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///517\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _ActionsService = __webpack_require__(519);\n\nvar _ActionsService2 = _interopRequireDefault(_ActionsService);\n\nvar _PDP = __webpack_require__(520);\n\nvar _PDP2 = _interopRequireDefault(_PDP);\n\nvar _Policy = __webpack_require__(521);\n\nvar _Policy2 = _interopRequireDefault(_Policy);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('PEP'); // Log System\n\nvar PEP = function () {\n\n /**\n * Creates a Policy Enforcement Point (PEP) instance\n * @param {Object} context\n */\n function PEP(context) {\n (0, _classCallCheck3.default)(this, PEP);\n\n var _this = this;\n\n _this.pdp = new _PDP2.default(context);\n _this.actionsService = new _ActionsService2.default(context);\n _this.context = context;\n context.pep = _this;\n\n //TODO should be added a trigger to verify when the loadConfigurations is successfully completed\n context.loadConfigurations();\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n\n (0, _createClass3.default)(PEP, [{\n key: 'addGUIListeners',\n value: function addGUIListeners() {\n var _this = this;\n\n _this.context.messageBus.addListener(_this.context.pepURL, function (msg) {\n var funcName = msg.body.method;\n\n var returnedValue = void 0;\n if (funcName === 'addToGroup') {\n var groupName = msg.body.params.groupName;\n var userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.addToGroup(groupName, userEmail);\n } else if (funcName === 'createGroup') {\n var _groupName = msg.body.params.groupName;\n returnedValue = _this.context.createGroup(_groupName);\n } else if (funcName === 'addPolicy') {\n var source = msg.body.params.source;\n var key = msg.body.params.key;\n var policy = msg.body.params.policy;\n var combiningAlgorithm = msg.body.params.combiningAlgorithm;\n returnedValue = _this.addPolicy(source, key, policy, combiningAlgorithm);\n } else if (funcName === 'deleteGroup') {\n var _groupName2 = msg.body.params.groupName;\n returnedValue = _this.context.deleteGroup(_groupName2);\n } else if (funcName === 'removePolicy') {\n var _source = msg.body.params.source;\n var _key = msg.body.params.key;\n returnedValue = _this.removePolicy(_source, _key);\n } else if (funcName === 'savePolicies') {\n var _source2 = msg.body.params.source;\n returnedValue = _this.context.savePolicies(_source2);\n } else if (funcName === 'userPolicies') {\n returnedValue = _this.context.userPolicies;\n } else if (funcName === 'activeUserPolicy') {\n var userPolicy = msg.body.params.userPolicy;\n if (userPolicy) {\n _this.context.activeUserPolicy = userPolicy;\n }\n returnedValue = _this.context.activeUserPolicy;\n } else if (funcName === 'userPolicy') {\n var _key2 = msg.body.params.key;\n returnedValue = _this.context.userPolicies[_key2];\n } else if (funcName === 'saveActivePolicy') {\n returnedValue = _this.context.saveActivePolicy();\n } else if (funcName === 'getMyEmails') {\n returnedValue = _this.context.getMyEmails();\n } else if (funcName === 'getMyHyperties') {\n returnedValue = _this.context.getMyHyperties();\n } else if (funcName === 'groups') {\n returnedValue = _this.context.groups;\n } else if (funcName === 'getGroupsNames') {\n returnedValue = _this.context.getGroupsNames();\n }if (funcName === 'removeFromGroup') {\n var _groupName3 = msg.body.params.groupName;\n var _userEmail = msg.body.params.userEmail;\n returnedValue = _this.context.removeFromGroup(_groupName3, _userEmail);\n }\n\n var value = { type: 'execute', value: returnedValue, code: 200 };\n var replyMsg = { id: msg.id, type: 'response', to: msg.from, from: msg.to, body: value };\n _this.context.messageBus.postMessage(replyMsg);\n });\n }\n\n /**\n * Adds a policy to the Policy Enforcement Point (PEP). The policy can be created by the service\n * provider or by the user.\n * @param {String} source\n * @param {String} key\n * @param {Object} policy\n */\n\n }, {\n key: 'addPolicy',\n value: function addPolicy(source, key, policy, combiningAlgorithm) {\n if (!source) throw new Error('source is not defined');\n if (!key) throw new Error('key is not defined');\n\n if (policy === undefined) {\n policy = new _Policy2.default(key, [], [], combiningAlgorithm);\n } else {\n if (!(policy instanceof _Policy2.default)) {\n policy = new _Policy2.default(policy.key, policy.rules, policy.actions, policy.combiningAlgorithm);\n }\n }\n\n switch (source) {\n case 'SERVICE_PROVIDER':\n this.context.savePolicies(source, policy, key);\n break;\n case 'USER':\n this.context.userPolicies[key] = policy;\n this.context.savePolicies(source);\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'authorise',\n value: function authorise(message, isIncoming) {\n var _this2 = this;\n\n // log.log('[Policy.PEP Authorise] ', message);\n // log.log(message);\n if (!message) throw new Error('message is not defined');\n if (!message.from) throw new Error('message.from is not defined');\n if (!message.to) throw new Error('message.to is not defined');\n if (!message.type) throw new Error('message.type is not defined');\n message.body = message.body || {};\n\n return new _promise2.default(function (resolve, reject) {\n\n message.body = message.body || {};\n var _this = _this2;\n\n var result = _this.pdp.evaluatePolicies(message, isIncoming);\n if (result === 'Not Applicable') {\n result = _this.context.defaultBehaviour;\n message.body.auth = false;\n }\n _this.actionsService.enforcePolicies(message, isIncoming).then(function (messages) {\n for (var i in messages) {\n message = messages[i];\n if (result) {\n message.body.auth = message.body.auth === undefined ? true : message.body.auth;\n resolve(message);\n } else {\n var errorMessage = { body: { code: 403, description: 'Blocked by policy' }, from: message.to, to: message.from, type: 'response' };\n reject(errorMessage);\n }\n }\n }, function (error) {\n reject(error);\n });\n });\n }\n }, {\n key: 'authoriseSync',\n value: function authoriseSync(message) {\n var result = void 0;\n message.body = message.body || {};\n result = this.pdp.evaluatePolicies(message, true);\n if (result === 'Not Applicable') {\n result = this.context.defaultBehaviour;\n }\n return result;\n }\n }, {\n key: 'removePolicy',\n value: function removePolicy(source, key) {\n if (!source) throw new Error('source is not defined');\n if (source !== '*' && !key) throw new Error('key is not defined');\n\n switch (source) {\n case '*':\n this.context.serviceProviderPolicy = {};\n this.context.userPolicies = {};\n this.context.activeUserPolicy = undefined;\n this.context.savePolicies('USER');\n this.context.savePolicies('SERVICE_PROVIDER');\n this.context.saveActivePolicy();\n break;\n case 'SERVICE_PROVIDER':\n delete this.context.serviceProviderPolicy[key];\n this.context.savePolicies();\n break;\n case 'USER':\n delete this.context.userPolicies[key];\n if (key === this.context.activeUserPolicy) {\n this.context.activeUserPolicy = undefined;\n this.context.saveActivePolicy();\n }\n this.context.savePolicies('USER');\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this.context.messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this.context.messageBus = messageBus;\n _this.addGUIListeners();\n }\n }]);\n return PEP;\n}();\n\nexports.default = PEP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUEVQLmpzPzQ3ZjIiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdQRVAnKTtcblxuaW1wb3J0IEFjdGlvbnNTZXJ2aWNlIGZyb20gJy4vQWN0aW9uc1NlcnZpY2UnO1xuaW1wb3J0IFBEUCBmcm9tICcuL1BEUCc7XG5pbXBvcnQgUG9saWN5IGZyb20gJy4vUG9saWN5JztcbmltcG9ydCB7aXNIeXBlcnR5VVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNsYXNzIFBFUCB7XG5cbiAgLyoqXG4gICogQ3JlYXRlcyBhIFBvbGljeSBFbmZvcmNlbWVudCBQb2ludCAoUEVQKSBpbnN0YW5jZVxuICAqIEBwYXJhbSAgICB7T2JqZWN0fSAgICBjb250ZXh0XG4gICovXG4gIGNvbnN0cnVjdG9yKGNvbnRleHQpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgX3RoaXMucGRwID0gbmV3IFBEUChjb250ZX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FBRUE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUF0QkE7QUF3QkE7OztBQXZMQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUE4S0E7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///518\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ActionsService = function () {\n function ActionsService(context) {\n (0, _classCallCheck3.default)(this, ActionsService);\n\n this.context = context;\n }\n\n (0, _createClass3.default)(ActionsService, [{\n key: 'enforcePolicies',\n value: function enforcePolicies(message, isIncomingMessage) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n\n var policies = _this.context.getPolicies(message, isIncomingMessage);\n\n if (policies !== undefined) {\n if (policies.serviceProviderPolicy !== undefined) {\n policies.serviceProviderPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n if (policies.userPolicy !== undefined) {\n policies.userPolicy.enforceActions(_this.context, message).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n }\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'forwardToID',\n value: function forwardToID(message, email) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve, reject) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n _this.context.runtimeRegistry.discoverHypertyPerUser(email).then(function (result) {\n message.to = result.hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'forwardToHyperty',\n value: function forwardToHyperty(message, hypertyURL) {\n var _this = this;\n if (!_this.context.runtimeRegistry) throw new Error('forward message to given ID is unsupported in this environment');\n\n return new _promise2.default(function (resolve) {\n if (_this.context.runtimeRegistry.hypertiesList[0].hypertyURL === message.to) {\n var splitTo = message.to.split('://');\n if (splitTo[0] !== 'runtime') {\n message.to = hypertyURL;\n message.body.via = undefined;\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(message);\n } else {\n resolve(message);\n }\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'sendAutomaticMessage',\n value: function sendAutomaticMessage(message, text) {\n var _this = this;\n return new _promise2.default(function (resolve) {\n var automaticMessage = {\n from: message.to,\n to: message.from,\n body: {\n value: text\n },\n type: message.type\n };\n resolve(message);\n _this.context.runtimeRegistry._messageBus.postMessage(automaticMessage);\n });\n }\n }]);\n return ActionsService;\n}();\n\nexports.default = ActionsService;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTE5LmpzIiwic291cmNlcyI6WyJ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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQURBO0FBR0E7QUFOQTtBQVFBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///519\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Operators = __webpack_require__(152);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* The Policy Decision Point (PDP) decides if a message is to be authorised by checking a set of\n* policies. The resource to be verified is specified in the first word of the 'condition' field of\n* a Policy object. The implementation that verifies if the message is compliant with a policy is\n* specified in a hashtable to allow dynamic definition of the implementation, providing\n* extensibility to the Policy Engine functionalities.\n*/\nvar PDP = function () {\n function PDP(context) {\n (0, _classCallCheck3.default)(this, PDP);\n\n this.context = context;\n this.operators = new _Operators2.default();\n }\n\n (0, _createClass3.default)(PDP, [{\n key: 'evaluatePolicies',\n value: function evaluatePolicies(message, isIncomingMessage) {\n var policies = this.context.getPolicies(message, isIncomingMessage);\n var result = 'Not Applicable';\n if (policies !== undefined) {\n result = this.evaluatePolicy(message, policies.serviceProviderPolicy, isIncomingMessage);\n if (result || result === 'Not Applicable') {\n var userResult = this.evaluatePolicy(message, policies.userPolicy, isIncomingMessage);\n if (userResult !== 'Not Applicable') {\n result = userResult;\n }\n }\n }\n\n return result;\n }\n }, {\n key: 'evaluatePolicy',\n value: function evaluatePolicy(message, policy, isIncoming) {\n var result = 'Not Applicable';\n if (policy) {\n result = policy.evaluateRules(this.context, message, isIncoming);\n }\n\n return result;\n }\n }]);\n return PDP;\n}();\n\nexports.default = PDP;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUERQLmpzP2U5YmEiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuL09wZXJhdG9ycyc7XG5cbi8qKlxuKiBUaGUgUG9saWN5IERlY2lzaW9uIFBvaW50IChQRFApIGRlY2lkZXMgaWYgYSBtZXNzYWdlIGlzIHRvIGJlIGF1dGhvcmlzZWQgYnkgY2hlY2tpbmcgYSBzZXQgb2ZcbiogcG9saWNpZXMuIFRoZSByZXNvdXJjZSB0byBiZSB2ZXJpZmllZCBpcyBzcGVjaWZpZWQgaW4gdGhlIGZpcnN0IHdvcmQgb2YgdGhlICdjb25kaXRpb24nIGZpZWxkIG9mXG4qIGEgUG9saWN5IG9iamVjdC4gVGhlIGltcGxlbWVudGF0aW9uIHRoYXQgdmVyaWZpZXMga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N1bHQ7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG5cbiAgZXZhbHVhdGVQb2xpY3kobWVzc2FnZSwgcG9saWN5LCBpc0luY29taW5nKSB7XG4gICAgbGV0IHJlc3VsdCA9ICdOb3QgQXBwbGljYWJsZSc7XG4gICAgaWYgKHBvbGljeSkge1xuICAgICAgcmVzdWx0ID0gcG9saWN5LmV2YWx1YXRlUnVsZXModGhpcy5jb250ZXh0LCBtZXNzYWdlLCBpc0luY29taW5nKTtcbiAgICB9XG5cbiAgICByZXR1cm4gcmVzdWx0O1xuICB9XG5cbn1cblxuZXhwb3J0IGRlZmF1bHQgUERQO1xuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9wb2xpY3kvUERQLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUFBO0FBQ0E7Ozs7O0FBQ0E7Ozs7Ozs7QUFPQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///520\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AllowOverrides = __webpack_require__(218);\n\nvar _AllowOverrides2 = _interopRequireDefault(_AllowOverrides);\n\nvar _BlockOverrides = __webpack_require__(219);\n\nvar _BlockOverrides2 = _interopRequireDefault(_BlockOverrides);\n\nvar _FirstApplicable = __webpack_require__(220);\n\nvar _FirstApplicable2 = _interopRequireDefault(_FirstApplicable);\n\nvar _Rule = __webpack_require__(522);\n\nvar _Rule2 = _interopRequireDefault(_Rule);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Policy = function () {\n function Policy(key, rules, actions, combiningAlgorithm) {\n (0, _classCallCheck3.default)(this, Policy);\n\n if (!key) throw new Error('key is not defined');\n if (!actions) throw new Error('actions are not defined');\n\n this.actions = actions;\n this.key = key;\n this._setRules(rules);\n this._setCombiningAlgorithm(combiningAlgorithm);\n }\n\n (0, _createClass3.default)(Policy, [{\n key: 'addAction',\n value: function addAction(method, param) {\n this.actions.push({ method: method, param: param });\n }\n }, {\n key: 'createRule',\n value: function createRule(decision, condition, scope, target, priority) {\n if (priority === undefined) {\n priority = this.getLastPriority() + 1;\n }\n var rule = new _Rule2.default(decision, condition, scope, target, priority);\n this.rules.push(rule);\n }\n }, {\n key: 'deleteRule',\n value: function deleteRule(rule) {\n var indexToRemove = this.rules.indexOf(rule);\n this.rules.splice(indexToRemove, 1);\n }\n }, {\n key: 'enforceActions',\n value: function enforceActions(context, message) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var results = [];\n if (_this.actions.length !== 0) {\n for (var i in _this.actions) {\n var result = context.pep.actionsService[_this.actions[i].method](message, _this.actions[i].param);\n results.push(result);\n }\n _promise2.default.all(results).then(function (messages) {\n resolve(messages);\n }, function (error) {\n reject(error);\n });\n } else {\n resolve([message]);\n }\n });\n }\n }, {\n key: 'evaluateRules',\n value: function evaluateRules(context, message, isIncoming) {\n var results = [];\n for (var i in this.rules) {\n results.push(this.rules[i].evaluate(context, message, isIncoming));\n }\n\n return this.combiningAlgorithm.combine(results);\n }\n }, {\n key: 'getLastPriority',\n value: function getLastPriority() {\n var priorities = [];\n\n if (this.rules.length !== 0) {\n for (var i in this.rules) {\n priorities.push(this.rules[i].priority);\n }\n return Math.max.apply(Math, priorities);\n } else {\n return -1;\n }\n }\n }, {\n key: 'getRuleByPriority',\n value: function getRuleByPriority(priority) {\n for (var i in this.rules) {\n if (String(this.rules[i].priority) === String(priority)) {\n return this.rules[i];\n }\n }\n throw Error('Rule with priority ' + priority + ' does not exist!');\n }\n }, {\n key: '_setCombiningAlgorithm',\n value: function _setCombiningAlgorithm(combiningAlgorithm) {\n if (!combiningAlgorithm) {\n combiningAlgorithm = 'blockOverrides';\n }\n switch (combiningAlgorithm) {\n case 'blockOverrides':\n this.combiningAlgorithm = new _BlockOverrides2.default();\n break;\n case 'allowOverrides':\n this.combiningAlgorithm = new _AllowOverrides2.default();\n break;\n case 'firstApplicable':\n this.combiningAlgorithm = new _FirstApplicable2.default();\n break;\n default:\n throw Error('Unknown algorithm: ' + combiningAlgorithm);\n }\n }\n }, {\n key: '_setRules',\n value: function _setRules(rules) {\n this.rules = [];\n\n for (var i in rules) {\n var rule = rules[i];\n if (rule.priority === undefined) {\n rule.priority = this.getLastPriority() + 1;\n }\n if (!(rule instanceof _Rule2.default)) {\n rule = new _Rule2.default(rule.decision, rule.condition, rule.scope, rule.target, rule.priority);\n }\n this.rules.push(rule);\n }\n }\n }, {\n key: 'sortRules',\n value: function sortRules() {\n return this.rules.sort(function (a, b) {\n var x = a.priority;var y = b.priority;\n return x < y ? -1 : x > y ? 1 : 0;\n });\n }\n }]);\n return Policy;\n}();\n\nexports.default = Policy;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUG9saWN5LmpzPzk4NDMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J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FQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQVhBO0FBYUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///521\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _AdvancedCondition = __webpack_require__(523);\n\nvar _AdvancedCondition2 = _interopRequireDefault(_AdvancedCondition);\n\nvar _Condition = __webpack_require__(153);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Rule = function () {\n function Rule(decision, condition, scope, target, priority) {\n (0, _classCallCheck3.default)(this, Rule);\n\n this.decision = decision;\n this.setCondition(condition);\n this.priority = priority;\n this.scope = scope;\n this.target = target;\n }\n\n (0, _createClass3.default)(Rule, [{\n key: 'setCondition',\n value: function setCondition(condition) {\n if (!(condition instanceof _Condition2.default || condition instanceof _AdvancedCondition2.default || condition instanceof _AdvancedCondition2.default)) {\n var attribute = condition.attribute;\n switch (attribute) {\n case 'subscription':\n this.condition = new _AdvancedCondition2.default(condition.attribute, condition.operator, condition.params);\n break;\n case undefined:\n this.condition = new _AdvancedCondition2.default(condition);\n break;\n default:\n this.condition = new _Condition2.default(condition.attribute, condition.operator, condition.params);\n }\n } else {\n this.condition = condition;\n }\n }\n }, {\n key: 'evaluate',\n value: function evaluate(context, message, isIncoming) {\n var field = isIncoming ? message.to : message.from;\n var hypertyName = void 0;\n switch (this.scope) {\n case 'global':\n break;\n\n case 'hyperty':\n if ((0, _utils.isDataObjectURL)(field)) {\n var reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n if (reporter !== undefined) {\n hypertyName = context.runtimeRegistry.getHypertyName(reporter);\n }\n } else {\n if (field.split('://')[0] === 'hyperty') {\n hypertyName = context.runtimeRegistry.getHypertyName((0, _utils.removePathFromURL)(field));\n }\n }\n if (hypertyName === this.target) {\n break;\n }\n\n return 'Not Applicable';\n\n case 'identity':\n var owner = void 0;\n\n if ((0, _utils.isDataObjectURL)(field)) {\n var _reporter = context.runtimeRegistry.getReporterURLSynchonous((0, _utils.removePathFromURL)(field));\n owner = context.runtimeRegistry.getHypertyOwner(_reporter);\n } else {\n if (field.split('://')[0] === 'hyperty') {\n owner = context.runtimeRegistry.getHypertyOwner((0, _utils.removePathFromURL)(field));\n }\n }\n if (owner !== undefined) {\n owner = (0, _utils.getUserEmailFromURL)(owner);\n }\n if (owner === this.target) {\n break;\n }\n\n return 'Not Applicable';\n }\n\n if (this.condition.isApplicable(context, message, this.scope, this.target)) {\n return this.decision;\n } else {\n return 'Not Applicable';\n }\n }\n }]);\n return Rule;\n}();\n\nexports.default = Rule;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUnVsZS5qcz9jOWU4Il0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBBZHZhbmNlZENvbmRpdGlvbiBmcm9tICcuL2NvbmRpdGlvbnMvQWR2YW5jZWRDb25kaXRpb24nO1xuaW1wb3J0IENvbmR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bGl0KCc6Ly8nKVswXSA9PT0gJ2h5cGVydHknKSB7XG4gICAgICAgICAgICBoeXBlcnR5TmFtZSA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldEh5cGVydHlOYW1lKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChoeXBlcnR5TmFtZSA9PT0gdGhpcy50YXJnZXQpIHtcbiAgICAgICAgICBicmVhaztcbiAgICAgICAgfVxuXG4gICAgICAgIHJldHVybiAnTm90IEFwcGxpY2FibGUnO1xuXG4gICAgICBjYXNlICdpZGVudGl0eSc6XG4gICAgICAgIGxldCBvd25lcjtcblxuICAgICAgICBpZiAoaXNEYXRhT2JqZWN0VVJMKGZpZWxkKSkge1xuICAgICAgICAgIGxldCByZXBvcnRlciA9IGNvbnRleHQucnVudGltZVJlZ2lzdHJ5LmdldFJlcG9ydGVyVVJMU3luY2hvbm91cyhyZW1vdmVQYXRoRnJvbVVSTChmaWVsZCkpO1xuICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlcG9ydGVyKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBpZiAoZmllbGQuc3BsaXQoJzovLycpWzBdID09PSAnaHlwZXJ0eScpIHtcbiAgICAgICAgICAgIG93bmVyID0gY29udGV4dC5ydW50aW1lUmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKHJlbW92ZVBhdGhGcm9tVVJMKGZpZWxkKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIGlmIChvd25lciAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICAgICAgb3duZXIgPSBnZXRVc2VyRW1haWxGcm9tVVJMKG93bmVyKTtcbiAgICAgICAgfVxuICAgICAgICBpZiAob3duZXIgPT09IHRoaXMudGFyZ2V0KSB7XG4gICAgICAgICAgYnJlYWs7X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7Ozs7QUFHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///522\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _Condition = __webpack_require__(153);\n\nvar _Condition2 = _interopRequireDefault(_Condition);\n\nvar _Operators = __webpack_require__(152);\n\nvar _Operators2 = _interopRequireDefault(_Operators);\n\nvar _SubscriptionCondition = __webpack_require__(524);\n\nvar _SubscriptionCondition2 = _interopRequireDefault(_SubscriptionCondition);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar AdvancedCondition = function () {\n function AdvancedCondition(condition) {\n (0, _classCallCheck3.default)(this, AdvancedCondition);\n\n this.operators = new _Operators2.default();\n if (condition.operators !== undefined) {\n condition = condition.condition;\n }\n condition = this.buildCondition(condition);\n this.condition = condition;\n }\n\n (0, _createClass3.default)(AdvancedCondition, [{\n key: 'buildCondition',\n value: function buildCondition(condition) {\n if (Array.isArray(condition[1])) {\n condition[1] = this.buildCondition(condition[1]);\n } else {\n if (condition[1].attribute === 'subscription') {\n condition[1] = new _SubscriptionCondition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n } else {\n condition[1] = new _Condition2.default(condition[1].attribute, condition[1].operator, condition[1].params);\n }\n }\n\n if (condition[2] !== undefined) {\n if (Array.isArray(condition[2])) {\n condition[2] = this.buildCondition(condition[2]);\n } else {\n if (condition[2].attribute === 'subscription') {\n condition[2] = new _SubscriptionCondition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n } else {\n condition[2] = new _Condition2.default(condition[2].attribute, condition[2].operator, condition[2].params);\n }\n }\n }\n return condition;\n }\n }, {\n key: 'isApplicable',\n value: function isApplicable(context, message, scope, target, operator, left, right) {\n if (!operator) {\n operator = this.condition[0];\n left = this.condition[1];\n right = this.condition[2];\n }\n\n while (!(left instanceof _Condition2.default) & !(left instanceof _SubscriptionCondition2.default) & typeof left !== 'boolean') {\n left = this.isApplicable(context, message, scope, target, left[0], left[1], left[2]);\n }\n if (right !== undefined) {\n while (!(right instanceof _Condition2.default) & !(right instanceof _SubscriptionCondition2.default) & typeof right !== 'boolean') {\n right = this.isApplicable(context, message, scope, target, right[0], right[1], right[2]);\n }\n }\n\n var resultLeft = typeof left === 'boolean' ? left : left.isApplicable(context, message, scope, target);\n var resultRight = void 0;\n if (right !== undefined) {\n resultRight = typeof right === 'boolean' ? right : right.isApplicable(context, message, scope, target);\n }\n return this.operators[operator]([resultLeft, resultRight]);\n }\n }]);\n return AdvancedCondition;\n}();\n\nexports.default = AdvancedCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTIzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29uZGl0aW9ucy9BZHZhbmNlZENvbmRpdGlvbi5qcz9iZDBmIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb25kaXRpb24gZnJvbSAnLi9Db25kaXRpb24nO1xuaW1wb3J0IE9wZXJhdG9ycyBmcm9tICcuLi9PcGVyYXRvcnMnO1xuaW1wb3J0IFN1YnNjcmlwdGlvbkNvbmRpdGlvbiBmcm9tICcuL1N1YnNjcmlwdGlvbkNvbmRpdGlvbic7XG5cbmNsYXNzIEFkdmFuY2VkQ29uZGl0aW9uIHtcblxuICBjb25zdHJ1Y3Rvcihjb25kaXRpb24pIHtcbiAgICB0aGlzLm9wZXJhdG9ycyA9IG5ldyBPcGVyYXRvcnMoKTtcbiAgICBpZiAoY29uZGl0aW9uLm9wZXJhdG9ycyAhPT0gdW5kZWZpbmVkKSB7XG4gICAgICBjb25kaXRpb24g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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///523\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _get2 = __webpack_require__(103);\n\nvar _get3 = _interopRequireDefault(_get2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _Condition2 = __webpack_require__(153);\n\nvar _Condition3 = _interopRequireDefault(_Condition2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* @author Ana Caldeira \n* @classdesc Class to represent a subscription condition and evaluate its applicability.\n*/\nvar SubscriptionCondition = function (_Condition) {\n (0, _inherits3.default)(SubscriptionCondition, _Condition);\n\n /**\n * Creates a new SubscriptionCondition.\n * @class\n * @param {string} attribute\n * @param {string} operator\n * @param {*} params\n */\n function SubscriptionCondition(attribute, operator, params) {\n (0, _classCallCheck3.default)(this, SubscriptionCondition);\n return (0, _possibleConstructorReturn3.default)(this, (SubscriptionCondition.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition)).call(this, attribute, operator, params));\n }\n\n /**\n * Verifies if the subscription condition is applicable to the message. First, verifies if the message is of the subscription type; second, verifies if the message is from a remote runtime to guarantee that the subscription is being validated in the destination runtime; third, verifies if the subscription preference is met.\n * @param {Object} context environment where the Policy Engine is being used\n * @param {Object} message\n */\n\n\n (0, _createClass3.default)(SubscriptionCondition, [{\n key: 'isApplicable',\n value: function isApplicable(context, message) {\n var isSubscription = message.type === 'subscribe';\n var isFromRemoteSM = context.isFromRemoteSM(message.from);\n if (isSubscription & isFromRemoteSM) {\n return (0, _get3.default)(SubscriptionCondition.prototype.__proto__ || (0, _getPrototypeOf2.default)(SubscriptionCondition.prototype), 'isApplicable', this).call(this, context, message);\n } else {\n return false;\n }\n }\n }]);\n return SubscriptionCondition;\n}(_Condition3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = SubscriptionCondition;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJ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yaXB0aW9uQ29uZGl0aW9uLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7QUFDQTs7Ozs7QUFDQTs7OztBQUlBOzs7QUFFQTs7Ozs7OztBQU9BO0FBQUE7QUFBQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQkE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBOEJBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///524\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _Bus2 = __webpack_require__(214);\n\nvar _Bus3 = _interopRequireDefault(_Bus2);\n\nvar _Pipeline = __webpack_require__(526);\n\nvar _Pipeline2 = _interopRequireDefault(_Pipeline);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('MessageBus'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log system\n\n/**\n* @author micaelpedrosa@gmail.com\n* Message BUS Interface is an extension of the Bus\n* It doesn't support the default '*' listener, instead it uses the registry.resolve(..)\n*/\nvar MessageBus = function (_Bus) {\n (0, _inherits3.default)(MessageBus, _Bus);\n\n /* private\n _registry: Registry\n _forwards: { : { fl: MsgListener, sandboxToUrls: Map(Sandbox, [to-url]), urlToSandbox: { to-url: Sandbox } } }\n _pipeline: Pipeline\n */\n\n //TODO: future optimization\n //1. message batch processing with setInterval\n //2. resolve default gateway/protostub with register.resolve\n\n function MessageBus(registry) {\n (0, _classCallCheck3.default)(this, MessageBus);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (MessageBus.__proto__ || (0, _getPrototypeOf2.default)(MessageBus)).call(this));\n\n _this2._registry = registry;\n _this2._forwards = {};\n\n _this2._pipelineIn = new _Pipeline2.default(function (error) {\n log.error('PIPELINE-ERROR: ', (0, _stringify2.default)(error));\n });\n\n _this2._pipelineOut = new _Pipeline2.default(function (error) {\n log.error('PIPELINE-ERROR: ', (0, _stringify2.default)(error));\n });\n return _this2;\n }\n\n (0, _createClass3.default)(MessageBus, [{\n key: 'postMessage',\n\n\n /**\n * Post a message for routing. It will first search for a listener, if there is no one, it sends to a external routing using the _onPostMessage.\n * External routing use the registry.resolve(..) method to decide the destination sandbox.\n * @param {Message} inMsg JSON with mandatory Message structure {id, type, from, to}\n * @param {Callback} responseCallback Optional callback if a response is expected from the request. A response will be always sent, even if it is a \"Timeout\".\n * @return {number} the Message id\n */\n value: function postMessage(inMsg, responseCallback, timeout) {\n log.info('onPOSTMessage: ', inMsg);\n var _this = this;\n\n var deliver = function deliver(msg) {\n\n _this._responseCallback(inMsg, responseCallback, timeout);\n\n if (!_this._onResponse(msg)) {\n var itemList = _this._subscriptions[msg.to];\n if (itemList) {\n //do not publish on default address, because of loopback cycle\n _this._publishOn(itemList, msg);\n } else {\n //if there is no listener, send to external interface\n _this._onPostMessage(msg);\n }\n }\n };\n\n _this._genId(inMsg);\n\n if (_this._isToProcess(inMsg)) {\n var isIncoming = _this._isIncomingMessage(inMsg);\n\n if (isIncoming) _this._pipelineIn.process(inMsg, deliver);else _this._pipelineOut.process(inMsg, deliver);\n } else deliver(inMsg);\n\n return inMsg.id;\n }\n }, {\n key: '_isToProcess',\n value: function _isToProcess(message) {\n var schemasToIgnore = ['domain', 'domain-idp', 'global', 'hyperty-runtime', 'runtime'];\n var splitFrom = message.from.split('://');\n var fromSchema = splitFrom[0];\n var splitTo = message.to.split('://');\n var toSchema = splitTo[0];\n var from = message.from;\n var to = message.to;\n\n // Signalling messages between P2P Stubs don't have to be verified. FFS\n\n if (message.body && message.body.source) {\n from = message.body.source;\n }\n\n if (message.body && message.body.subscriber) {\n from = message.body.subscriber;\n }\n\n if (from.indexOf('/p2phandler/') !== -1 || from.indexOf('/p2prequester/') !== -1 || to.indexOf('/p2phandler/') !== -1 || to.indexOf('/p2prequester/') !== -1) {\n return false;\n }\n\n if (this._registry.isLocal(from) && this._registry.isLocal(message.to)) return false;\n\n if (message.from === fromSchema || message.to === toSchema || message.type === 'read' || message.type === 'response' || message.from.includes('hyperty://') && message.type === 'delete') {\n return false;\n } else {\n return schemasToIgnore.indexOf(fromSchema) === -1 || schemasToIgnore.indexOf(toSchema) === -1;\n }\n }\n }, {\n key: '_isIncomingMessage',\n value: function _isIncomingMessage(message) {\n var from = void 0;\n\n if (message.type === 'forward') {\n log.info('[MessageBus - isIncomingMessage] - message.type: ', message.type);\n from = message.body.from;\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('source') && message.body.source) {\n log.info('[MessageBus - isIncomingMessage] - message.body.source: ', message.body.source);\n from = message.body.source;\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('subscriber') && message.body.subscriber) {\n //TODO: this subscriber validation should not exist, because is outdated\n //TODO: the syncher and syncher manager not following the correct spec;\n log.info('[MessageBus - isIncomingMessage] - message.body.subscriber: ', message.body.subscriber);\n from = message.body.subscriber;\n } else if (message.hasOwnProperty('body') && message.body.hasOwnProperty('reporter') && message.body.reporter) {\n //TODO: this subscriber validation should not exist, because is outdated\n //TODO: the syncher and syncher manager not following the correct spec;\n log.info('[MessageBus - isIncomingMessage] - message.body.reporter: ', message.body.reporter);\n from = message.body.reporter;\n } else {\n log.info('[MessageBus - isIncomingMessage] - message.from ', message.from);\n from = message.from;\n }\n\n log.info('[MessageBus - isIncomingMessage] - check if isLocal: ', from);\n return !this._registry.isLocal(from);\n }\n\n /**\n * Adds an external publish address listener. Every message for the address will be forwarded to the external routing by _onPostMessage.\n * This means, even if there is a listener for the address, it will also send the message to the external routing.\n * @param {URL} from Publish address.\n */\n\n }, {\n key: 'addPublish',\n value: function addPublish(from) {\n var _this3 = this;\n\n var _this = this;\n\n //verify if forward exist\n var refCount = _this._forwards[from];\n if (!refCount) {\n var forwardListener = _this.addListener(from, function (msg) {\n log.info('MB-PUBLISH: ( ' + from + ' )');\n _this._onPostMessage(msg);\n });\n\n refCount = {\n counter: 0,\n fl: forwardListener,\n remove: function remove() {\n _this3.counter--;\n if (_this3.counter === 0) {\n _this3.fl.remove();\n delete _this._forwards[from];\n }\n }\n };\n\n _this._forwards[from] = refCount;\n }\n\n refCount.counter++;\n return refCount;\n }\n\n /**\n * Adds a forward listener for a message destination. Every message reaching an address will be also sent to the forward address.\n * @param {URL} from Message destination, it's actually the field \"to\" of the message.\n * @param {URL} to Forward address.\n */\n\n }, {\n key: 'addForward',\n value: function addForward(from, to) {\n var _this = this;\n\n return _this.addListener(from, function (msg) {\n log.info('MB-FORWARD: ( ' + from + ' to ' + to + ' )');\n _this.forward(to, msg);\n });\n }\n\n /**\n * Just forward's a message to the forward address. Listeners should be available for the forward address.\n * @param {URL} url Forward address.\n * @param {Message} msg Message to forward\n */\n\n }, {\n key: 'forward',\n value: function forward(url, msg) {\n var _this = this;\n\n var itemList = _this._subscriptions[url];\n if (itemList) {\n _this._publishOn(itemList, msg);\n }\n }\n\n //default route, if there are no listeners available for a message destination.\n\n }, {\n key: '_onPostMessage',\n value: function _onPostMessage(msg) {\n var _this = this;\n\n //resolve external protostub...\n _this._registry.resolve(msg).then(function (route, msg2route) {\n if (msg2route) _this.forward(route, msg2route);else _this.forward(route, msg);\n }).catch(function (e) {\n log.error('RESOLVE-ERROR: ', e);\n });\n }\n }, {\n key: 'pipelineIn',\n get: function get() {\n return this._pipelineIn;\n }\n }, {\n key: 'pipelineOut',\n get: function get() {\n return this._pipelineOut;\n }\n }]);\n return MessageBus;\n}(_Bus3.default);\n\nexports.default = MessageBus;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9idXMvTWVzc2FnZUJ1cy5qcz8zYTNhIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVC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7QUFUQTtBQUNBO0FBV0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7O0FBckxBO0FBQUE7QUFBQTs7O0FBRUE7QUFBQTtBQUFBOzs7QUE1QkE7QUFDQTtBQWlOQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///525\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Pipeline');\n\n/**\n* @author micaelpedrosa@gmail.com\n* Sequencial processor of methods. Similar to how Sequential Promise's work, but better fit for message processing.\n* Normal use for this, is to intercept all messages with configured handlers, and act accordingly.\n*/\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\nvar Pipeline = function () {\n /* public\n handlers: ((PipeContext) => void)[]\n onFail: (error) => void\n */\n\n function Pipeline(_onFail) {\n (0, _classCallCheck3.default)(this, Pipeline);\n\n var _this = this;\n\n _this.handlers = [];\n _this.onFail = _onFail;\n }\n\n /**\n * Insert a message in the pipeline queue. All messages are wrapped with a PipeContext.\n * @param {Message} msg Message for the queue\n * @param {Callback} onDeliver When message is finished processing from all handlers, it will be delivered in this callback.\n */\n\n\n (0, _createClass3.default)(Pipeline, [{\n key: 'process',\n value: function process(msg, onDeliver) {\n var _this = this;\n\n if (_this.handlers.length > 0) {\n var iter = new Iterator(_this.handlers);\n iter.next(new PipeContext(_this, iter, msg, onDeliver));\n } else {\n onDeliver(msg);\n }\n }\n }]);\n return Pipeline;\n}();\n\n/**\n* @author micaelpedrosa@gmail.com\n* Wrapper around a message that adds actions that can be fired by any interceptor handler.\n* The Pipeline is asynchronous, so an handler should always call an action, the default one is \"next()\"\n*/\n\n\nvar PipeContext = function () {\n /* private\n _inStop: boolean\n _pipeline: Pipeline\n _iter: Iterator\n _msg: Message\n */\n\n function PipeContext(pipeline, iter, msg, onDeliver) {\n (0, _classCallCheck3.default)(this, PipeContext);\n\n var _this = this;\n\n _this._inStop = false;\n\n _this._pipeline = pipeline;\n _this._iter = iter;\n _this._msg = msg;\n _this._onDeliver = onDeliver;\n }\n\n (0, _createClass3.default)(PipeContext, [{\n key: 'next',\n\n\n /**\n * Proceed to the next interceptor handler, unless there was an error. If it's the last one, proceed to onDeliver handler.\n */\n value: function next() {\n var _this = this;\n\n if (!_this._inStop) {\n if (_this._iter.hasNext) {\n _this._iter.next(_this);\n } else {\n _this._onDeliver(_this._msg);\n }\n }\n }\n\n /**\n * Proceed directly to the onDeliver handler, unless there was an error.\n */\n\n }, {\n key: 'deliver',\n value: function deliver() {\n var _this = this;\n if (!_this._inStop) {\n _this._inStop = true;\n _this._onDeliver(_this._msg);\n }\n }\n\n /**\n * Mark the context with an error and proceed to the onFail handler.\n * @param {[type]} error [description]\n */\n\n }, {\n key: 'fail',\n value: function fail(error) {\n var _this = this;\n\n if (!_this._inStop) {\n _this._inStop = true;\n if (_this._pipeline.onFail) {\n _this._pipeline.onFail(error);\n }\n }\n }\n }, {\n key: 'pipeline',\n get: function get() {\n return this._pipeline;\n }\n }, {\n key: 'msg',\n get: function get() {\n return this._msg;\n },\n set: function set(inMsg) {\n this._msg = inMsg;\n }\n }]);\n return PipeContext;\n}();\n\nvar Iterator = function () {\n /* private\n _index: number\n _array: []\n */\n\n function Iterator(array) {\n (0, _classCallCheck3.default)(this, Iterator);\n\n this._index = -1;\n this._array = array;\n }\n\n (0, _createClass3.default)(Iterator, [{\n key: 'hasNext',\n get: function get() {\n return this._index < this._array.length - 1;\n }\n }, {\n key: 'next',\n get: function get() {\n this._index++;\n return this._array[this._index];\n }\n }]);\n return Iterator;\n}();\n\nexports.default = Pipeline;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9idXMvUGlwZWxpbmUuanM/YTAzZSJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiog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:///526\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utf = __webpack_require__(528);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('CryptoManager');\n\n/**\n* Class with the cryptographic functions for the authentication protocol\n*\n*/\n\nvar Crypto = function () {\n\n /**\n * Runtimefactory is passed in the costructor, because the nodeJS has a different crypto module\n * from the browser. RuntimeFactory provides a wrapper for the fuctions of nodeJS, so they can be\n * invoked browser like.\n */\n function Crypto(runtimeFactory) {\n (0, _classCallCheck3.default)(this, Crypto);\n\n var _this = this;\n typeof runtimeFactory.createWebcrypto === 'function' ? _this._crypto = runtimeFactory.createWebcrypto() : _this._crypto = crypto;\n }\n\n /**\n * Performs a RSA encryption\n * @param {ArrayBuffer} value the public key\n * @param {BufferSource} value data to be encryped\n * @return {Uint8Array} encrypted data\n */\n\n\n (0, _createClass3.default)(Crypto, [{\n key: 'encryptRSA',\n value: function encryptRSA(pubKey, data) {\n log.log('encryptRSA:pubKey', pubKey);\n log.log('encryptRSA:data', data);\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAencryptKey(new Uint8Array(pubKey)).then(function (publicKey) {\n\n _this._crypto.subtle.encrypt({\n name: 'RSA-OAEP'\n }, publicKey, //from generateKey or importKey above\n data //ArrayBuffer of data you want to encrypt\n ).then(function (encrypted) {\n //returns an ArrayBuffer containing the encrypted data\n // log.log('crypto-encryptRSA', new Uint8Array(encrypted));\n resolve(new Uint8Array(encrypted));\n }).catch(function (err) {\n // log.log('crypto-encryptRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA decryption\n * @param {ArrayBuffer} value the private key\n * @param {BufferSource} value data to be decrypted\n * @return {Uint8Array} decrypted data\n */\n\n }, {\n key: 'decryptRSA',\n value: function decryptRSA(privKey, data) {\n log.log('decryptRSA:privKey', privKey);\n log.log('decryptRSA:data', data);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAdecryptKey(privKey).then(function (privateKey) {\n\n _this._crypto.subtle.decrypt({\n name: 'RSA-OAEP'\n }, privateKey, //from generateKey or importKey above\n data //ArrayBuffer of the data\n ).then(function (decrypted) {\n\n var decryptedData = new Uint8Array(decrypted);\n\n // log.log('crypto-decryptRSA', decryptedData);\n resolve(decryptedData);\n }).catch(function (err) {\n // log.log('crypto-decryptRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA sign\n * @param {ArrayBuffer} value the private key\n * @param {BufferSource} value data to be signed\n * @return {Uint8Array} data signature\n */\n\n }, {\n key: 'signRSA',\n value: function signRSA(privKey, data) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAsignKey(privKey).then(function (privateKey) {\n\n _this._crypto.subtle.sign({\n name: 'RSASSA-PKCS1-v1_5'\n }, privateKey, //from generateKey or importKey above\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of data you want to sign\n ).then(function (signature) {\n //returns an ArrayBuffer containing the signature\n // log.log('crypto-signRSA', new Uint8Array(signature));\n resolve(new Uint8Array(signature));\n }).catch(function (err) {\n // log.log('crypto-signRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA signature verification\n * @param {ArrayBuffer} value the public key\n * @param {BufferSource} value data to be verified\n * @return {Boolean} result of the signature verification\n */\n\n }, {\n key: 'verifyRSA',\n value: function verifyRSA(pubKey, data, signature) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importRSAverifyKey(pubKey).then(function (publicKey) {\n\n _this._crypto.subtle.verify({\n name: 'RSASSA-PKCS1-v1_5'\n }, publicKey, //from generateKey or importKey above\n signature, //ArrayBuffer of the signature\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of the data\n ).then(function (isvalid) {\n //returns a boolean on whether the signature is true or not\n // log.log('crypto-verifyRSA', isvalid);\n resolve(isvalid);\n }).catch(function (err) {\n // log.log('crypto-verifyRSA', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * Performs a RSA signature verification\n * @param {ArrayBuffer} value the public key\n * @param {BufferSource} value data to be verified\n * @return {Boolean} result of the signature verification\n */\n\n }, {\n key: 'encryptAES',\n value: function encryptAES(key, data, iv) {\n log.log('encryptAES:key', key);\n log.log('encryptAES:data', data);\n log.log('encryptAES:iv', iv);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importAESkey(key).then(function (aesKey) {\n\n _this._crypto.subtle.encrypt({\n name: 'AES-CBC',\n\n //Don't re-use initialization vectors!\n //Always generate a new iv every time your encrypt!\n iv: iv\n }, aesKey, //from generateKey or importKey above\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of data you want to encrypt\n ).then(function (encrypted) {\n //returns an ArrayBuffer containing the encrypted data\n // log.log('crypto-encryptAES', new Uint8Array(encrypted));\n resolve(new Uint8Array(encrypted));\n }).catch(function (err) {\n // log.log('crypto-encryptAES', err);\n reject(err);\n });\n });\n });\n }\n }, {\n key: 'decryptAES',\n value: function decryptAES(key, data, iv) {\n log.log('decryptAES:key', key);\n log.log('decryptAES:data', data);\n log.log('decryptAES:iv', iv);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._importAESkey(key).then(function (aesKey) {\n\n _this._crypto.subtle.decrypt({\n name: 'AES-CBC',\n iv: iv\n }, aesKey, //from generateKey or importKey above\n data //ArrayBuffer of the data\n ).then(function (decrypted) {\n\n var decodedData = (0, _utf.decodeUTF8)(new Uint8Array(decrypted));\n log.log('crypto-decryptAES', decodedData);\n resolve(decodedData);\n }).catch(function (err) {\n // log.log('crypto-decryptAES', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * creates a hash using the HMAC algorithm\n * @param {byteArray} key key to be used in the hmac\n * @param {string} data information to be hashed\n * @return {byteArray} signature resulting hash\n */\n\n }, {\n key: 'hashHMAC',\n value: function hashHMAC(key, data) {\n log.log('hashHMAC:key', key);\n log.log('hashHMAC:data', data);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (typeof data != 'string') {\n data = (0, _stringify2.default)(data);\n log.log('Converting hashHMAC inpured DATA');\n log.log('HHashHMAC:', data);\n }\n\n _this._importHMACkey(key).then(function (hmacKey) {\n\n _this._crypto.subtle.sign({\n name: 'HMAC'\n }, hmacKey, //from generateKey or importKey above\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of data you want to sign\n ).then(function (signature) {\n log.log('HashHMAC signature:', new Uint8Array(signature));\n\n // log.log('crypto-hashHMAC', signature);\n //returns an ArrayBuffer containing the signature\n resolve(new Uint8Array(signature));\n }).catch(function (err) {\n // log.log('crypto-hashHMAC', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * verifies an hash using the HMAC algorithm\n * @param {byteArray} key key to be used in the hmac\n * @param {string} data information to be hashed to compare\n * @param {byteArray} signature hash to compare with the received data\n * @return {boolean} isvalid boolean saying if the data corresponds to the hash received\n */\n\n }, {\n key: 'verifyHMAC',\n value: function verifyHMAC(key, data, signature) {\n log.log('verifyHMAC:key', key);\n log.log('verifyHMAC:data', data);\n log.log('verifyHMAC:signature', signature);\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._importHMACkey(key).then(function (hmacKey) {\n\n if (typeof data != 'string') {\n data = (0, _stringify2.default)(data);\n log.log('Converting verifyHMAC inputed DATA:', data);\n }\n\n _this._crypto.subtle.verify({\n name: 'HMAC'\n }, hmacKey, //from generateKey or importKey above\n signature, //ArrayBuffer of the signature\n (0, _utf.encodeUTF8)(data) //ArrayBuffer of the data\n ).then(function (isvalid) {\n //returns a boolean on whether the signature is true or not\n // log.log('crypto-verifyHMAC', isvalid);\n log.log('verifyHMAC result', isvalid);\n isvalid ? resolve(isvalid) : reject(isvalid);\n }).catch(function (err) {\n log.error('crypto-verifyHMAC', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * generates a RSA public/private key pair with a modulus length of 2048 bits\n * @return {JSON} keyPair json containing the public and private keys\n */\n\n }, {\n key: 'generateRSAKeyPair',\n value: function generateRSAKeyPair() {\n var _this = this;\n var keyPair = {};\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.generateKey({\n name: 'RSA-PSS',\n modulusLength: 2048, //can be 1024, 2048, or 4096\n publicExponent: new Uint8Array([0x01, 0x00, 0x01]),\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['sign', 'verify'] //can be any combination of 'sign' and 'verify'\n\n ).then(function (key) {\n //returns a keypair object\n // log.log(key);\n\n _this._crypto.subtle.exportKey('spki', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n key.publicKey //can be a publicKey or privateKey, as long as extractable was true\n ).then(function (publicKey) {\n //returns the exported key data\n keyPair.public = new Uint8Array(publicKey);\n return _this._crypto.subtle.exportKey('pkcs8', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n key.privateKey //can be a publicKey or privateKey, as long as extractable was true\n );\n }).then(function (privateKey) {\n keyPair.private = new Uint8Array(privateKey);\n\n // log.log('crypto-generateRSAKeyPair', keyPair);\n resolve(keyPair);\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n });\n }\n\n /**\n * Generates a 128 bit random value.\n * @return {byteArray} array random value\n */\n\n }, {\n key: 'generateIV',\n value: function generateIV() {\n var _this = this;\n\n var array = new Uint8Array(16);\n _this._crypto.getRandomValues(array);\n\n return array;\n }\n\n /**\n * Generates a 256 bit random value. 32 bits are extrated from the machine time,\n * the remaining are generated randomly\n * @return {byteArray} array random value\n */\n\n }, {\n key: 'generateRandom',\n value: function generateRandom() {\n var _this = this;\n\n var array = new Uint8Array(32);\n _this._crypto.getRandomValues(array);\n\n var date = Date.now();\n\n var dateEncoded = (0, _utf.encodeUTF8)(date.toString());\n\n //extract the least significant 4 bytes in the date\n var finalDate = dateEncoded.slice(dateEncoded.length - 4, dateEncoded.length);\n\n // add in the first 4 bytes of the array the bytes extracted previously;\n for (var i = 0; i < 4; i++) {\n array[i] = finalDate[i];\n }\n return array;\n }\n\n /**\n * generates a premaster secret (PMS) of 48 bytes (384 bits) randomly\n * @return {byteArray} array premaster secret key\n */\n\n }, {\n key: 'generatePMS',\n value: function generatePMS() {\n var _this = this;\n\n var array = new Uint8Array(48);\n _this._crypto.getRandomValues(array);\n return array;\n }\n\n /**\n * generates a masterKey secret (PMS) of 48 bytes (384 bits) using the premaster secret and\n * two randoms\n * @return {byteArray} array master secret key with 48 bytes\n */\n\n }, {\n key: 'generateMasterSecret',\n value: function generateMasterSecret(hmacKey, data) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n var key = new Uint8Array(48);\n var seed = data;\n\n _this._digest(hmacKey).then(function (digestedKey) {\n\n _this.hashHMAC(digestedKey, seed).then(function (keypart0) {\n\n //copy the first 32 bytes into the key\n for (var i = 0; i < 32; i++) {\n key[i] = keypart0[i];\n }\n return _this.hashHMAC(digestedKey, seed + keypart0);\n }).then(function (keypart1) {\n\n //copy the first 16 bytes to the key remaining 16 bytes\n for (var i = 0; i < 16; i++) {\n key[i + 32] = keypart1[i];\n }\n\n // log.log('crypto-generateMasterSecret', key);\n resolve(key);\n }).catch(function (err) {\n // log.log('crypto-generateMasterSecret', err);\n reject(err);\n });\n });\n });\n }\n\n /**\n * generates both users MAC and encryption keys. generate as output an array\n * with 4 byteArray each with 32 bytes\n * @param {byteArray} secret secret to be used in the HMAC function\n * @param {String} data information to be used as seed\n * @return {Array} key array with the information to generate keys\n */\n\n }, {\n key: 'generateKeys',\n value: function generateKeys(hmacKey, data) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var key = [];\n var seed = data;\n\n // iterate 4 times to obtain a 1024 key size\n _this.hashHMAC(hmacKey, seed).then(function (keypart0) {\n key.push(keypart0);\n return _this.hashHMAC(hmacKey, seed + keypart0);\n }).then(function (keypart1) {\n key.push(keypart1);\n return _this.hashHMAC(hmacKey, seed + keypart1);\n }).then(function (keypart2) {\n key.push(keypart2);\n return _this.hashHMAC(hmacKey, seed + keypart2);\n }).then(function (keypart3) {\n key.push(keypart3);\n\n // log.log('crypto-generateKeys', key);\n resolve(key);\n }).catch(function (err) {\n // log.log('crypto-generateKeys', err);\n reject(err);\n });\n\n // log.log(hmacKey, data);\n });\n }\n }, {\n key: '_importRSAsignKey',\n value: function _importRSAsignKey(privKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('pkcs8', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n privKey, { //these are the algorithm options\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['sign'] //'verify' for public key import, 'sign' for private key imports\n ).then(function (privateKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAsignKey', privateKey);\n resolve(privateKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAsignKey', err);\n reject(err);\n });\n });\n }\n }, {\n key: '_importRSAverifyKey',\n value: function _importRSAverifyKey(pubKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('spki', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n pubKey, { //these are the algorithm options\n name: 'RSASSA-PKCS1-v1_5',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['verify'] //'verify' for public key import, 'sign' for private key imports\n ).then(function (publicKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAverifyKey', publicKey);\n resolve(publicKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAverifyKey', err);\n reject(err);\n });\n });\n }\n }, {\n key: '_importRSAencryptKey',\n value: function _importRSAencryptKey(pubKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('spki', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n pubKey, { //these are the algorithm options\n name: 'RSA-OAEP',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['encrypt'] //'encrypt' or 'wrapKey' for public key import or\n //'decrypt' or 'unwrapKey' for private key imports\n ).then(function (publicKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAencryptKey', publicKey);\n resolve(publicKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAencryptKey', err.name);\n reject(err);\n });\n });\n }\n }, {\n key: '_importRSAdecryptKey',\n value: function _importRSAdecryptKey(privKey) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('pkcs8', //can be 'jwk' (public or private), 'spki' (public only), or 'pkcs8' (private only)\n privKey, { //these are the algorithm options\n name: 'RSA-OAEP',\n hash: { name: 'SHA-256' //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n } }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['decrypt'] //'encrypt' or 'wrapKey' for public key import or\n //'decrypt' or 'unwrapKey' for private key imports\n ).then(function (privateKey) {\n //returns a publicKey (or privateKey if you are importing a private key)\n // log.log('crypto-_importRSAdecryptKey', privateKey);\n resolve(privateKey);\n }).catch(function (err) {\n log.error('crypto-_importRSAdecryptKey', err);\n reject(err);\n });\n });\n }\n }, {\n key: 'concatPMSwithRandoms',\n value: function concatPMSwithRandoms(pms, toRandom, fromRandom) {\n\n var finalKey = new Uint8Array(pms.length + toRandom.length + fromRandom.length);\n\n // add PremasterKey\n for (var i = 0; i < pms.length; i++) {\n finalKey[i] = pms[i];\n }\n\n //add to random\n for (var _i = 0; _i < toRandom.length; _i++) {\n finalKey[_i + pms.length] = pms[_i];\n }\n\n //add from random\n for (var _i2 = 0; _i2 < fromRandom.length; _i2++) {\n finalKey[_i2 + pms.length + toRandom.length] = pms[_i2];\n }\n\n return finalKey;\n }\n }, {\n key: '_generate256bitKey',\n value: function _generate256bitKey() {\n var _this = this;\n var array = new Uint8Array(32);\n _this._crypto.getRandomValues(array);\n\n return array;\n }\n\n /**\n * imports the secret to the HMAC function\n * @param {byteArray} arrayBuffer bytes to import as key\n * @return {JSON} key key ready to be used in the HMAC cryptographic function\n */\n\n }, {\n key: '_importHMACkey',\n value: function _importHMACkey(arrayBuffer) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this._digest(arrayBuffer).then(function (key) {\n\n _this._crypto.subtle.importKey('raw', //can be 'jwk' or 'raw'\n key, { //this is the algorithm options\n name: 'HMAC',\n hash: { name: 'SHA-256' }, //can be 'SHA-1', 'SHA-256', 'SHA-384', or 'SHA-512'\n length: 256 //optional, if you want your key length to differ from the hash function's block length\n }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['sign', 'verify'] //can be any combination of 'sign' and 'verify'\n ).then(function (key) {\n //returns the symmetric key\n // log.log('crypto-_importHMACkey', key);\n resolve(key);\n }).catch(function (err) {\n reject(err);\n });\n });\n });\n }\n }, {\n key: '_digest',\n value: function _digest(value) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.digest({\n name: 'SHA-256'\n }, value //The data you want to hash as an ArrayBuffer\n ).then(function (hash) {\n //returns the hash as an ArrayBuffer\n // log.log('crypto-digest', new Uint8Array(hash));\n resolve(new Uint8Array(hash));\n }).catch(function (err) {\n log.error(err);\n reject(err);\n });\n });\n }\n }, {\n key: '_importAESkey',\n value: function _importAESkey(arrayBuffer) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n _this._crypto.subtle.importKey('raw', //can be 'jwk' or 'raw'\n arrayBuffer, { //this is the algorithm options\n name: 'AES-CBC'\n }, true, //whether the key is extractable (i.e. can be used in exportKey)\n ['encrypt', 'decrypt'] //can be 'encrypt', 'decrypt', 'wrapKey', or 'unwrapKey'\n ).then(function (key) {\n //returns the symmetric key\n // log.log('crypto-importAESkey', key);\n resolve(key);\n }).catch(function (err) {\n log.error('crypto-importAESkey', err);\n reject(err);\n });\n });\n }\n }, {\n key: '_sha256',\n value: function _sha256(str) {\n var _this = this;\n var buffer = new TextEncoder('utf-8').encode(str);\n return _this._crypto.subtle.digest('SHA-256', buffer).then(function (hash) {\n return _this._hex(hash);\n });\n }\n }, {\n key: '_hex',\n value: function _hex(buffer) {\n var hexCodes = [];\n var view = new DataView(buffer);\n for (var i = 0; i < view.byteLength; i += 4) {\n // Using getUint32 reduces the number of iterations needed (we process 4 bytes each time)\n var value = view.getUint32(i);\n\n var stringValue = value.toString(16);\n\n var padding = '00000000';\n var paddedValue = (padding + stringValue).slice(-padding.length);\n hexCodes.push(paddedValue);\n }\n\n // Join all the hex strings into one\n return hexCodes.join('');\n }\n }]);\n return Crypto;\n}();\n\nexports.default = Crypto;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI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kgb3IgaW1wb3J0S2V5IGFib3ZlXG4gICAgICAgICAgZGF0YSAvL0FycmF5QnVmZmVyIG9mIHRoZSBkYXRhXG4gICAgICAgIClcbiAgICAgICAgICAudGhlbihmdW5jdGlvbihkZWNyeXB0ZWQpIHtcblxuICAgICAgICAgICAgbGV0IGRlY29kZWREYXRhID0gZGVjb2RlVVRGOChuZXcgVWludDhBcnJheShkZWNyeXB0ZWQpKTtcbiAgICAgICAgICAgIGxvZy5sb2coJ2NyeXB0by1kZWNyeXB0QUVTJywgZGVjb2RlZERhdGEpO1xuICAgICAgICAgICAgcmVzb2x2ZShkZWNvZGVkRGF0YSk7XG5cbiAgICAgICAgICB9KS5jYXRjaChmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAvLyBsb2cubG9nKCdjcnlwdG8tZGVjcnlwdEFFUycsIGVycik7XG4gICAgICAgICAgICByZWplY3QoZXJyKTtcbiAgICAgICAgICB9KTtcblxuICAgICAgfSk7XG5cbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAqIGNyZWF0ZXMgYSBoYXNoIHVzaW5nIHRoZSBITUFDIGFsZ29yaXRobVxuICAqIEBwYXJhbSAge2J5dGVBcnJheX0gICAga2V5ICAgICAgIGtleSB0byBiZSB1c2VkIGluIHRoZSBobWFjXG4gICogQHBhcmFtICB7c3RyaW5nfSAgICAgIGRhdGEgICAgICAgaW5mb3JtYXRpb24gdG8gYmUgaGFzaGVkXG4gICogQHJldHVybiAge2J5dGVBcnJheX0gICBzaWduYXR1cmUgIHJlc3VsdGluZyBoYXNoXG4gICovXG4gIGhhc2hITUFDKGtleSwgZGF0YSkge1xuICAgIGxvZy5sb2coJ2hhc2hITUFDOmtleScsIGtleSk7XG4gICAgbG9nLmxvZygnaGFzaEhNQUM6ZGF0YScsIGRhdGEpO1xuICAgIGxldCBfdGhpcyA9IHRoaXM7XG5cbiAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KS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DQTtBQUNBOzs7Ozs7OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUhBO0FBTUE7QUFUQTtBQVdBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBREE7QUFEQTtBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBREE7QUFJQTtBQVBBO0FBVUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7QUFLQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///527\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n\tvalue: true\n});\nexports.encodeUTF8 = encodeUTF8;\nexports.decodeUTF8 = decodeUTF8;\n// Marshals a string to Uint8Array.\nfunction encodeUTF8(s) {\n\tvar i = 0;\n\tvar bytes = new Uint8Array(s.length * 4);\n\tfor (var ci = 0; ci != s.length; ci++) {\n\t\ttry {\n\t\t\tvar xxx = s.charCodeAt(ci);\n\t\t} catch (err) {\n\t\t\tconsole.log(err.message);\n\t\t\treturn;\n\t\t}\n\t\tvar c = s.charCodeAt(ci);\n\t\tif (c < 128) {\n\t\t\tbytes[i++] = c;\n\t\t\tcontinue;\n\t\t}\n\t\tif (c < 2048) {\n\t\t\tbytes[i++] = c >> 6 | 192;\n\t\t} else {\n\t\t\tif (c > 0xd7ff && c < 0xdc00) {\n\t\t\t\tif (++ci == s.length) throw 'UTF-8 encode: incomplete surrogate pair';\n\t\t\t\tvar c2 = s.charCodeAt(ci);\n\t\t\t\tif (c2 < 0xdc00 || c2 > 0xdfff) throw 'UTF-8 encode: second char code 0x' + c2.toString(16) + ' at index ' + ci + ' in surrogate pair out of range';\n\t\t\t\tc = 0x10000 + ((c & 0x03ff) << 10) + (c2 & 0x03ff);\n\t\t\t\tbytes[i++] = c >> 18 | 240;\n\t\t\t\tbytes[i++] = c >> 12 & 63 | 128;\n\t\t\t} else {\n\t\t\t\t// c <= 0xffff\n\t\t\t\tbytes[i++] = c >> 12 | 224;\n\t\t\t}\n\t\t\tbytes[i++] = c >> 6 & 63 | 128;\n\t\t}\n\t\tbytes[i++] = c & 63 | 128;\n\t}\n\treturn bytes.subarray(0, i);\n}\n\n// Unmarshals an Uint8Array to string.\nfunction decodeUTF8(bytes) {\n\tvar s = '';\n\tvar i = 0;\n\twhile (i < bytes.length) {\n\t\tvar c = bytes[i++];\n\t\tif (c > 127) {\n\t\t\tif (c > 191 && c < 224) {\n\t\t\t\tif (i >= bytes.length) throw 'UTF-8 decode: incomplete 2-byte sequence';\n\t\t\t\tc = (c & 31) << 6 | bytes[i] & 63;\n\t\t\t} else if (c > 223 && c < 240) {\n\t\t\t\tif (i + 1 >= bytes.length) throw 'UTF-8 decode: incomplete 3-byte sequence';\n\t\t\t\tc = (c & 15) << 12 | (bytes[i] & 63) << 6 | bytes[++i] & 63;\n\t\t\t} else if (c > 239 && c < 248) {\n\t\t\t\tif (i + 2 >= bytes.length) throw 'UTF-8 decode: incomplete 4-byte sequence';\n\t\t\t\tc = (c & 7) << 18 | (bytes[i] & 63) << 12 | (bytes[++i] & 63) << 6 | bytes[++i] & 63;\n\t\t\t} else throw 'UTF-8 decode: unknown multibyte start 0x' + c.toString(16) + ' at index ' + (i - 1);\n\t\t\t++i;\n\t\t}\n\n\t\tif (c <= 0xffff) s += String.fromCharCode(c);else if (c <= 0x10ffff) {\n\t\t\tc -= 0x10000;\n\t\t\ts += String.fromCharCode(c >> 10 | 0xd800);\n\t\t\ts += String.fromCharCode(c & 0x3FF | 0xdc00);\n\t\t} else throw 'UTF-8 decode: code point 0x' + c.toString(16) + ' exceeds UTF-16 reach';\n\t}\n\treturn s;\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9jcnlwdG9NYW5hZ2VyL3V0ZjguanM/M2IxOSJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBNYXJzaGFscyBhIHN0cmluZyB0byBVaW50OEFycmF5LlxuZXhwb3J0IGZ1bmN0aW9uIGVuY29kZVVURjgocykge1xuXHR2YXIgaSA9IDA7XG5cdHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KHMubGVuZ3RoICogNCk7XG5cdGZvciAodmFyIGNpID0gMDsgY2kgIT0gcy5sZW5ndGg7IGNpKyspIHtcbiAgICB0cnl7XG4gICAgICB2YXIgeHh4ID0gcy5jaGFyQ29kZUF0KGNpKTtcbiAgICB9IGNhdGNoIChlcnIpe1xuICAgICAgY29uc29sZS5sb2coZXJyLm1lc3NhZ2UpO1xuICAgICAgcmV0dXJuO1xuXG4gICAgfVxuXHRcdHZhciBjID0gcy5jaGFyQ29kZUF0KGNpKTtcblx0XHRpZiAoYyA8IDEyOCkge1xuXHRcdFx0Ynl0ZXNbaSsrXSA9IGM7XG5cdFx0XHRjb250aW51ZTtcblx0XHR9XG5cdFx0aWYgKGMgPCAyMDQ4KSB7XG5cdFx0XHRieXRlc1tpKytdID0gYyA+PiA2IHwgMTkyO1xuXHRcdH0gZWxzZSB7XG5cdFx0XHRpZiAoYyA+IDB4ZDdmZiAmJiBjIDwgMHhkYzAwKSB7X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gU3RyaW5nLmZyb21DaGFyQ29kZShjID4+IDEwIHwgMHhkODAwKVxuXHRcdFx0cyArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKGMgJiAweDNGRiB8IDB4ZGMwMClcblx0XHR9IGVsc2UgdGhyb3cgJ1VURi04IGRlY29kZTogY29kZSBwb2ludCAweCcgKyBjLnRvU3RyaW5nKDE2KSArICcgZXhjZWVkcyBVVEYtMTYgcmVhY2gnO1xuXHR9XG5cdHJldHVybiBzO1xufVxuXG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9jcnlwdG9NYW5hZ2VyL3V0ZjguanMiXSwibWFwcGluZ3MiOiI7Ozs7O0FBQ0E7QUFxQ0E7QUF0Q0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///528\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Loader'); // Log System\n\nvar Loader = function () {\n function Loader(runtimeURL, runtimeConfiguration, runtimeDescriptorsInstance) {\n (0, _classCallCheck3.default)(this, Loader);\n\n if (!runtimeConfiguration) throw Error('[Runtime.Loader] The descriptor need to know the runtime configuration');\n if (!runtimeDescriptorsInstance) throw Error('[Runtime.Loader] The descriptor need to know the runtime Descriptor instance');\n\n this.log = log;\n\n this.runtimeConfiguration = runtimeConfiguration;\n this.descriptors = runtimeDescriptorsInstance;\n }\n\n /**\n * Set runtime url\n * @param {string} value runtimeURL\n */\n\n\n (0, _createClass3.default)(Loader, [{\n key: 'loadHyperty',\n\n\n /**\n * Deploy Hyperty from Catalogue URL\n *\n * @see https://github.com/reTHINK-project/specs/tree/master/datamodel/core/address\n *\n * @param {URL.HypertyCatalogueURL} hypertyCatalogueURL - The Catalogue URL used to identify descriptors in the Catalogue.\n * @param {boolean|URL.HypertyURL} [reuseURL=false] reuseURL - reuseURL is used to reuse the hypertyURL previously registred, by default the reuse is disabled;\n * @param {URL} appURL - the app url origin address;\n * @param {object} IdpConstraint - constraints to be used when selecting the identity to be associated with the Hyperty including origin, idp, and idHint.\n * @returns {Promise} this is Promise and returns true if all components are loaded with success or an error if someone fails.\n *\n * @memberOf Loader\n */\n value: function loadHyperty(hypertyCatalogueURL) {\n var reuseURL = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var _this = this;\n\n var IdpConstraint = arguments[2];\n var appURL = arguments[3];\n\n\n if (!this._readyToUse()) return false;\n if (!hypertyCatalogueURL) throw new Error('[Runtime.Loader] Hyperty descriptor url parameter is needed');\n\n return new _promise2.default(function (resolve, reject) {\n\n var _hypertyURL = void 0;\n var _hypertySandbox = void 0;\n var _hypertyDescriptor = void 0;\n var _hypertySourcePackage = void 0;\n var haveError = false;\n\n var errorReason = function errorReason(reason) {\n log.info('[Runtime.Loader] Something failed on the deploy hyperty: ', reason);\n reject(reason);\n };\n\n var handleError = function handleError(reason) {\n haveError = true;\n reject(reason);\n };\n\n // Get Hyperty descriptor\n // TODO: the request Module should be changed,\n // because at this moment it is incompatible with nodejs;\n // Probably we need to pass a factory like we do for sandboxes;\n log.info('[Runtime.Loader] ------------------ Hyperty ------------------------');\n log.info('[Runtime.Loader] Get hyperty descriptor for :', hypertyCatalogueURL);\n return _this.descriptors.getHypertyDescriptor(hypertyCatalogueURL).then(function (hypertyDescriptor) {\n // at this point, we have completed \"step 2 and 3\" as shown in https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md\n log.info('[Runtime.Loader] 1: return hyperty descriptor');\n\n // hyperty contains the full path of the catalogue URL, e.g.\n // catalogue.rethink.eu/.well-known/..........\n _hypertyDescriptor = hypertyDescriptor;\n\n var sourcePackageURL = hypertyDescriptor.sourcePackageURL;\n\n if (sourcePackageURL === '/sourcePackage') {\n return hypertyDescriptor.sourcePackage;\n }\n\n // Get the hyperty source code\n return _this.runtimeCatalogue.getSourcePackageFromURL(sourcePackageURL);\n }, handleError).then(function (sourcePackage) {\n if (haveError) return false;\n\n log.info('[Runtime.Loader] 2: return hyperty source code');\n\n // at this point, we have completed \"step 4 and 5\" as shown in https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md\n\n _hypertySourcePackage = sourcePackage;\n\n //\n // steps 6 -- 9 are skipped.\n // TODO: on release of core 0.2;\n // TODO: Promise to check the policy engine\n\n // mock-up code;\n // temporary code, only\n var policy = true;\n\n return policy;\n }, handleError).then(function (policyResult) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 3: return policy engine result' + policyResult);\n\n // we have completed step 6 to 9 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n //\n // Steps 6 -- 9\n // As a result of the sipped steps, we know at this point if we execute\n // inSameSandbox or not.\n //\n\n // For testing, just assume we execute in same Sandbox.\n var inSameSandbox = true;\n var sandbox = void 0;\n\n if (inSameSandbox) {\n\n // this don't need be a Promise;\n sandbox = _this.registry.getAppSandbox();\n\n // we have completed step 11 here.\n } else {\n\n var domain = (0, _utils.divideURL)(hypertyCatalogueURL).domain;\n\n // getSandbox, this will return a promise;\n sandbox = _this.registry.getSandbox(domain);\n }\n\n // this will return the sandbox or one promise to getSandbox;\n return sandbox;\n }, handleError).then(function (sandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 4: return the sandbox', sandbox);\n\n // Return the sandbox indepentely if it running in the same sandbox or not\n // we have completed step 14 here.\n return sandbox;\n }, function (reason) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 4.1: Try to register a new sandbox');\n\n // check if the sandbox is registed for this hyperty descriptor url;\n // Make Steps xxx --- xxx\n // Instantiate the Sandbox\n\n var hypertyCapabilities = {};\n if (_hypertyDescriptor && _hypertyDescriptor.hasOwnProperty('capabilities')) {\n hypertyCapabilities = _hypertyDescriptor.stubCapabilities;\n }\n\n return _this._runtimeFactory.createSandbox(hypertyCapabilities).then(function (sandbox) {\n\n sandbox.addListener('*', function (msg) {\n _this.messageBus.postMessage(msg);\n });\n\n return sandbox;\n });\n }, handleError).then(function (sandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 5: return sandbox and register');\n\n _hypertySandbox = sandbox;\n\n var numberOfAddresses = 1;\n //debugger;\n return _this._addressAllocation.create(_this._registry._domain, numberOfAddresses, _hypertyDescriptor, 'hyperty', reuseURL);\n }, handleError).then(function (addresses) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 6: return the addresses for the hyperty', addresses);\n\n // Register hyperty\n return _this.registry.registerHyperty(_hypertySandbox, hypertyCatalogueURL, _hypertyDescriptor, addresses, IdpConstraint);\n }, handleError).then(function (registrationResult) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 7: registration result', registrationResult);\n\n // we have completed step 16 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n _hypertyURL = registrationResult.url;\n\n // Extend original hyperty configuration;\n var configuration = {};\n if (!(0, _utils.emptyObject)(_hypertyDescriptor.configuration)) {\n try {\n configuration = (0, _assign2.default)({}, JSON.parse(_hypertyDescriptor.configuration));\n } catch (e) {\n configuration = _hypertyDescriptor.configuration;\n }\n }\n configuration.runtimeURL = _this._runtimeURL;\n\n if (registrationResult.p2pHandler) {\n configuration.p2pHandler = registrationResult.p2pHandler;\n configuration.p2pRequester = registrationResult.p2pRequester;\n }\n\n // We will deploy the component - step 17 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n\n try {\n return _hypertySandbox.deployComponent(_hypertySourcePackage.sourceCode, _hypertyURL, configuration);\n } catch (e) {\n log.info('[Runtime.Loader] Error on deploy component:', e);\n reject(e);\n }\n }, handleError).then(function (deployComponentStatus) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 8: Deploy component status for hyperty: ', deployComponentStatus);\n\n // we have completed step 19 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n\n // Add the message bus listener to the appSandbox or hypertSandbox;\n _this.messageBus.addListener(_hypertyURL, function (msg) {\n _hypertySandbox.postMessage(msg);\n });\n\n // Add the message bus listener to the appSandbox or hypertSandbox;\n _this.messageBus.addListener(_this.runtimeURL + '/status', function (msg) {\n _hypertySandbox.postMessage(msg);\n });\n\n // we have completed step 20 of https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n var hyperty = {\n runtimeHypertyURL: _hypertyURL,\n status: deployComponentStatus\n };\n\n log.info('[Runtime.Loader] Hyperty: ', hyperty);\n resolve(hyperty);\n\n // we have completed step 21 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-hyperty.md right now.\n log.info('[Runtime.Loader] ------------------ END ------------------------');\n }, handleError).catch(errorReason);\n });\n }\n\n /**\n * Deploy Stub from Catalogue URL or domain url\n * @param {URL.URL} protostubURL Catalogue URL for the ProtoStub to be loaded or the domain to be target by the protostub\n * @param {Object} p2pConfig configuration of p2p\n */\n\n }, {\n key: 'loadStub',\n value: function loadStub(protostubURL, p2pConfig) {\n var _this2 = this;\n\n if (!this._readyToUse()) return false;\n if (!protostubURL) throw new Error('[Runtime.Loader.loadStub]ProtoStub descriptor url parameter is needed');\n\n return new _promise2.default(function (resolve, reject) {\n\n // to analyse if domain for p2pHandlers should be something else and not the default domain itself\n\n var domain = (0, _utils.divideURL)(protostubURL).domain;\n\n if (!domain) {\n domain = protostubURL;\n }\n\n var _stubSandbox = void 0;\n var _stubDescriptor = void 0;\n var _runtimeProtoStubURL = void 0;\n var _stubSourcePackage = void 0;\n var haveError = false;\n var stubId = void 0;\n\n var errorReason = function errorReason(reason) {\n log.info('[Runtime.Loader.loadStub]Something failed on the deploy of protocolstub: ', reason);\n reject(reason);\n };\n\n var handleError = function handleError(reason) {\n haveError = true;\n reject(reason);\n };\n\n // Discover Protocol Stub\n var discoverStub = void 0;\n var isP2PHandler = false;\n var isP2PRequester = false;\n var stubCapabilities = {};\n\n log.info('[Runtime.Loader.loadStub] starting loading for ', protostubURL, ' with p2pconfig ', p2pConfig);\n log.info('[Runtime.Loader.loadStub]Discover or Create a new ProtoStub for domain: ', domain);\n\n // step 2 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n try {\n if (p2pConfig) {\n\n if (p2pConfig.hasOwnProperty('isHandlerStub') && p2pConfig.isHandlerStub) {\n // step 6 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n isP2PHandler = true;\n stubId = _this2.runtimeURL;\n discoverStub = _this2.registry.discoverP2PStub();\n } else {\n isP2PRequester = true;\n var p2pHandlerRuntimeURL = p2pConfig.remoteRuntimeURL;\n stubId = p2pHandlerRuntimeURL;\n\n // step 4 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // step 5 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n discoverStub = _this2.registry.discoverP2PStub(p2pHandlerRuntimeURL);\n }\n } else {\n // step 3 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n stubId = domain;\n discoverStub = _this2.registry.discoverProtostub(domain);\n }\n\n // Is registed?\n log.info('[Runtime.Loader.loadStub]1. Proto Stub Discovered for ', protostubURL, ': ', discoverStub);\n\n // step 23 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n resolve(discoverStub);\n log.info(' [Runtime.Loader]------------------- END ---------------------------\\n');\n } catch (reason) {\n\n // is not registed?\n log.info('[Runtime.Loader.loadStub]1. Proto Stub not found ' + reason);\n\n // step 8 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _this2.descriptors.getStubDescriptor(protostubURL).then(function (stubDescriptor) {\n\n if (haveError) return false;\n log.info('[Runtime.Loader.loadStub]2. return the ProtoStub descriptor');\n\n // step 9 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _stubDescriptor = stubDescriptor;\n\n var sourcePackageURL = stubDescriptor.sourcePackageURL;\n\n if (sourcePackageURL === '/sourcePackage') {\n return stubDescriptor.sourcePackage;\n }\n\n // step 10 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2.runtimeCatalogue.getSourcePackageFromURL(sourcePackageURL);\n }, handleError).catch(errorReason).then(function (stubSourcePackage) {\n if (haveError) return false;\n\n // According to debug, it seems RuntimeCatalogue does not support yet constraints. It appears empty!!!!\n\n if (_stubDescriptor && _stubDescriptor.constraints) {\n stubCapabilities = _stubDescriptor.constraints;\n }\n\n // step 11 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]3. return the ProtoStub Source Code');\n _stubSourcePackage = stubSourcePackage;\n\n // this will return the sandbox or one promise to getSandbox;\n // step 12 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2.registry.getSandbox(domain, stubCapabilities);\n }).then(function (stubSandbox) {\n if (haveError) return false;\n\n // step 15 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]4. if the sandbox is registered then return the sandbox ', stubSandbox);\n\n _stubSandbox = stubSandbox;\n return stubSandbox;\n }).catch(function (reason) {\n if (haveError) return false;\n\n // step 13 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]5. Sandbox was not found, creating a new one ', reason);\n\n // check if the sandbox is registed for this stub descriptor url;\n\n\n // step 14 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2._runtimeFactory.createSandbox(stubCapabilities).then(function (sandbox) {\n sandbox.addListener('*', function (msg) {\n _this2.messageBus.postMessage(msg);\n });\n\n return sandbox;\n });\n }).then(function (sandbox) {\n if (haveError) return false;\n\n // step 16 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub]6. return the sandbox instance and register', sandbox, 'to domain ', domain);\n\n _stubSandbox = sandbox;\n\n // we need register stub on registry - step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this2.registry.registerStub(_stubSandbox, stubId, p2pConfig, protostubURL, _stubDescriptor);\n }, handleError).then(function (runtimeProtoStub) {\n if (haveError) return false;\n\n // step 23 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub] 7. return the runtime protostub url: ', runtimeProtoStub);\n\n _runtimeProtoStubURL = runtimeProtoStub.url;\n\n // Extend original hyperty configuration;\n var configuration = {};\n if (!(0, _utils.emptyObject)(_stubDescriptor.configuration)) {\n try {\n configuration = (0, _assign2.default)({}, JSON.parse(_stubDescriptor.configuration));\n } catch (e) {\n configuration = _stubDescriptor.configuration;\n }\n }\n\n if (p2pConfig) {\n try {\n configuration = (0, _assign2.default)(configuration, JSON.parse(p2pConfig));\n } catch (e) {\n configuration = (0, _assign2.default)(configuration, p2pConfig);\n }\n }\n\n // required for protostub session\n\n configuration.runtimeURL = _this2._runtimeURL;\n\n // step 24 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n try {\n // step 26 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n log.info('[Runtime.Loader.loadStub] 8: adding sandbox listener to protostubURL : ', _runtimeProtoStubURL);\n\n // step 27 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n // Add the message bus listener\n _this2.messageBus.addListener(_runtimeProtoStubURL, function (msg) {\n _stubSandbox.postMessage(msg);\n });\n\n return _stubSandbox.deployComponent(_stubSourcePackage.sourceCode, _runtimeProtoStubURL, configuration);\n } catch (e) {\n log.error('[Runtime.Loader.loadStub] Error on deploy component:', e);\n reject(e);\n }\n }, handleError).then(function () {\n if (haveError) return false;\n\n // step 28 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n var stub = void 0;\n if (p2pConfig) {\n log.log('[Runtime.Loader.loadStub] p2pConfig: ', p2pConfig);\n\n if (p2pConfig.hasOwnProperty('isHandlerStub')) stub = _this2.registry.p2pHandlerStub[_this2._runtimeURL];\n if (p2pConfig.hasOwnProperty('p2pRequesterStub')) stub = _this2.registry.p2pRequesterStub[p2pConfig.remoteRuntimeURL];\n } else {\n stub = _this2.registry.protostubsList[domain];\n }\n\n log.log('[Runtime.Loader.loadStub] Stub: ', stub);\n resolve(stub);\n log.info('[Runtime.Loader.loadStub]------------------- END ---------------------------\\n');\n }, handleError).catch(errorReason);\n }\n });\n }\n\n /**\n * Deploy idpProxy from Catalogue URL or domain url\n * @param {URL.URL} domain domain\n */\n\n }, {\n key: 'loadIdpProxy',\n value: function loadIdpProxy(idpProxyURL) {\n var _this3 = this;\n\n if (!this._readyToUse()) return false;\n if (!idpProxyURL) throw new Error('[Runtime.Loader] IdpProxy descriptor url parameter is needed');\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = (0, _utils.divideURL)(idpProxyURL).domain;\n\n if (!domain) {\n domain = idpProxyURL;\n }\n\n var _proxySandbox = void 0;\n var _proxyDescriptor = void 0;\n var _runtimeIdpProxyURL = void 0;\n var _proxySourcePackage = void 0;\n var haveError = false;\n\n var errorReason = function errorReason(reason) {\n log.info('[Runtime.Loader] Something failed on the deploy of IdpProxy: ', reason);\n reject(reason);\n };\n\n var handleError = function handleError(reason) {\n haveError = true;\n reject(reason);\n };\n\n // Discover IDPProxy\n log.info('[Runtime.Loader] ------------------- IDP Proxy Deploy ---------------------------\\n');\n log.info('[Runtime.Loader] Discover or Create a new IdpProxy for domain/URL: ', domain);\n\n try {\n var runtimeIdpProxyURL = _this3.registry.discoverIdpProxy(domain);\n\n // Is registed?\n log.info('[Runtime.Loader] 1. IDPProxy Discovered: ', runtimeIdpProxyURL);\n\n // we have completed step 2 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n var idpProxy = _this3.registry.idpProxyList[domain];\n log.log('Deployed: ', idpProxy);\n\n resolve(idpProxy);\n log.info('[Runtime.Loader] ------------------- END ---------------------------\\n');\n } catch (reason) {\n\n // is not registed?\n log.info('[Runtime.Loader] 1. IdpProxy not found:', reason);\n\n // we have completed step 3 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // we need to get ProtoStub descriptor step 4 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _this3.descriptors.getIdpProxyDescriptor(idpProxyURL).then(function (proxyDescriptor) {\n\n log.info('[Runtime.Loader] 2. Return the IDPProxy descriptor');\n\n // we have completed step 5 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n _proxyDescriptor = proxyDescriptor;\n\n var sourcePackageURL = proxyDescriptor.sourcePackageURL;\n\n if (sourcePackageURL === '/sourcePackage') {\n return proxyDescriptor.sourcePackage;\n }\n\n // we need to get ProtoStub Source code from descriptor - step 6 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this3.runtimeCatalogue.getSourcePackageFromURL(sourcePackageURL);\n }, handleError).then(function (sourcePackage) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 3. return the IDPProxy source package');\n\n // we have completed step 7 https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n _proxySourcePackage = sourcePackage;\n\n // TODO: Check on PEP (policy Engine) if we need the sandbox and check if the Sandbox Factory have the context sandbox;\n var policy = true;\n return policy;\n }, handleError).then(function (policy) {\n if (haveError) return false;\n\n // this will return the sandbox or one promise to getSandbox;\n return _this3.registry.getSandbox(domain);\n }).then(function (proxySandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 4. if the sandbox is registered then return the sandbox', proxySandbox);\n\n _proxySandbox = proxySandbox;\n return proxySandbox;\n }).catch(function (reason) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 5. Sandbox was not found, creating a new one', reason);\n\n var proxyCapabilities = {};\n if (_proxyDescriptor && _proxyDescriptor.hasOwnProperty('capabilities')) {\n _proxyDescriptor = _proxyDescriptor.stubCapabilities;\n }\n\n return _this3._runtimeFactory.createSandbox(proxyCapabilities).then(function (sandbox) {\n\n sandbox.addListener('*', function (msg) {\n _this3.messageBus.postMessage(msg);\n });\n\n return sandbox;\n });\n }).then(function (sandbox) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 6. return the sandbox instance and register', sandbox, 'to domain ', domain);\n\n _proxySandbox = sandbox;\n\n // we need register stub on registry - step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n return _this3.registry.registerIdpProxy(sandbox, domain);\n }, handleError).then(function (runtimeIdpProxyURL) {\n if (haveError) return false;\n log.info('[Runtime.Loader] 7. Return the runtime Idp Proxy URL: ', runtimeIdpProxyURL);\n\n // we have completed step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n _runtimeIdpProxyURL = runtimeIdpProxyURL;\n\n // Extend original hyperty configuration;\n var configuration = {};\n if (!(0, _utils.emptyObject)(_proxyDescriptor.configuration)) {\n try {\n configuration = (0, _assign2.default)({}, JSON.parse(_proxyDescriptor.configuration));\n } catch (e) {\n configuration = _proxyDescriptor.configuration;\n }\n }\n configuration.runtimeURL = _this3._runtimeURL;\n\n // Deploy Component step xxx\n try {\n // we have completed step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // Add the message bus listener\n _this3.messageBus.addListener(_runtimeIdpProxyURL, function (msg) {\n _proxySandbox.postMessage(msg);\n });\n\n return _proxySandbox.deployComponent(_proxySourcePackage.sourceCode, runtimeIdpProxyURL, configuration);\n } catch (e) {\n log.info('[Runtime.Loader] Error on deploy component:', e);\n reject(e);\n }\n }, handleError).then(function () {\n if (haveError) return false;\n\n // we have completed step xxx https://github.com/reTHINK-project/core-framework/blob/master/docs/specs/runtime/dynamic-view/basics/deploy-protostub.md\n\n // Load Stub function resolved with success;\n // let idpProxy = {\n // runtimeIdpProxyURL: _runtimeIdpProxyURL,\n // status: deployComponentStatus\n // };\n\n //this.registry.idpProxyList[domain].status = 'deployed';\n var idpProxy = _this3.registry.idpProxyList[domain];\n\n log.log('[Runtime.Loader.loadIdpProxy] 8: loaded: ', idpProxy);\n\n resolve(idpProxy);\n log.info('[Runtime.Loader.loadIdpProxy] ------------------- END ---------------------------\\n');\n }, handleError).catch(errorReason);\n }\n });\n }\n\n // Check if the loader is ready to load all components\n\n }, {\n key: '_readyToUse',\n value: function _readyToUse() {\n\n var status = false;\n\n if (!this._runtimeURL) throw new Error('[Runtime.Loader] The loader need the runtime url address');\n if (!this._messagesBus) throw new Error('[Runtime.Loader] The loader need the messageBus component');\n if (!this._registry) throw new Error('[Runtime.Loader] The loader need the registry component');\n if (!this._runtimeFactory) throw new Error('[Runtime.Loader] The loader need the runtime factory component');\n\n status = true;\n return status;\n }\n }, {\n key: 'runtimeURL',\n set: function set(value) {\n this._runtimeURL = value;\n }\n\n /**\n * Get runtime url\n * @return {string} value runtimeURL\n */\n ,\n get: function get() {\n return this._runtimeURL;\n }\n\n /**\n * Set Registry component\n * @param {Registry} value Registry Component\n */\n\n }, {\n key: 'registry',\n set: function set(value) {\n this._registry = value;\n\n // Install AddressAllocation\n var addressAllocation = _AddressAllocation2.default.instance;\n this._addressAllocation = addressAllocation;\n\n log.log('[Loader - AddressAllocation] - ', addressAllocation);\n }\n\n /**\n * Get Registry component\n * @return {Registry} Registry component\n */\n ,\n get: function get() {\n return this._registry;\n }\n\n /**\n * Set Message Bus component\n * @param {MessageBus} value Message bus component\n */\n\n }, {\n key: 'messageBus',\n set: function set(value) {\n this._messagesBus = value;\n }\n\n /**\n * Get Message Bus component\n * @return {MessageBus} Message Bus component\n */\n ,\n get: function get() {\n return this._messagesBus;\n }\n\n /**\n * Set Runtime Factory component\n * @param {runtimeFactory} value Factory includes the specific implementations for each environment\n */\n\n }, {\n key: 'runtimeFactory',\n set: function set(value) {\n this._runtimeFactory = value;\n }\n\n /**\n * Get Runtime Factory component\n * @return {runtimeFactory} Runtime Factory component\n */\n ,\n get: function get() {\n return this._runtimeFactory;\n }\n }]);\n return Loader;\n}();\n\nexports.default = Loader;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTI5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL0xvYWRlci5qcz9jYzkzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignTG9hZGVyJyk7XG5cbmltcG9ydCB7ZGl2aWRlVVJMLCBlbXB0eU9iamVjdH0gZnJvbSAnLi4vdXRpbHMvdXRpbHMnO1xuaW1wb3J0IEFkZHJlc3NBbGxvY2F0aW9uIGZyb20gJy4uL2FsbG9jYXRpb24vQWRkcmVzc0FsbG9jYXRpb24nO1xuXG5jbGFzcyBMb2FkZXIge1xuXG4gIGNvbnN0cnVjdG9yKHJ1bnRpbWVVUkwsIHJ1bnRpbWVD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IHtVUkwuVVJMfSAgICAgZG9tYWluICAgICAgICAgIGRvbWFpblxuICAqL1xuXG4gIGxvYWRJZHBQcm94eShpZHBQcm94eVVSTCkge1xuXG4gICAgaWYgKCF0aGlzLl9yZWFkeVRvVXNlKCkpIHJldHVybiBmYWxzZTtcbiAgICBpZiAoIWlkcFByb3h5VVJMKSB0aHJvdyBuZXcgICBFcnJvcignW1J1bnRpbWUuTG9hZGVyXSBJZHBQcm94eSBkZXNjcmlwdG9yIHVybCBwYXJhbWV0ZXIgaXMgbmVlZGVkJyk7XG5cbiAgICByZXR1cm4gbmV3IFByb21pc2UoKHJlc29sdmUsIHJlamVjdCkgPT4ge1xuXG4gICAgICBsZXQgZG9tYWluID0gZGl2aWRlVVJMKGlkcFByb3h5VVJMKS5kb21haW47XG5cbiAgICAgIGlmICghZG9tYWluKSB7XG4gICAgICAgIGRvbWFpbiA9IGlkcFByb3h5VVJMO1xuICAgICAgfVxuXG4gICAgICBsZXQgX3Byb3h5U2FuZGJveDtcbiAgICAgIGxldCBfcHJveHlEZXNjcmlwdG9yO1xuICAgICAgbGV0IF9ydW50aW1lSWRwUHJveHlVUkw7XG4gICAgICBsZXQgX3Byb3h5U291cmNlUGFja2FnZTtcbiAgICAgIGxldCBoYXZlRXJyb3IgPSBmYWxzZTtcblxuICAgICAgbGV0IGVycm9yUmVhc29uID0gKHJlYXNvbikgPT4ge1xuICAgICAgICBsb2cuaW5mbygnW1J1bnRpbWUuTG9hZGVyXSBTb21ldGhpbmcgZmFpbGVkIG9uIHRoZSBkZXBsb3kgb2YgSWRwUHJveHk6ICcsIHJlYXNvbik7XG4gICAgICAgIHJlamVjdChyZWFzb24pO1xuICAgICAgfTtcblxuICAgICAgbGV0IGhhbmRsZUVycm9yID0gKHJlYXNvbikgPT4ge1xuICAgICAgICBoYXZlRXJyb3IgPSB0cnVlO1xuICAgICAgICByZWplY3QocmVhc29uKTtcbiAgICAgIH07XG5cbiAgICAgIC8vIERpc2NvdmVyIElEUFByb3h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3Rvc3R1Yi5tZFxuXG4gICAgICAgICAgICBfcHJveHlTb3VyY2VQYWNrYWdlID0gc291cmNlUGFja2FnZTtcblxuICAgICAgICAgICAgLy8gVE9ETzogQ2hlY2sgb24gUEVQIChwb2xpY3kgRW5naW5lKSBpZiB3ZSBuZWVkIHRoZSBzYW5kYm94IGFuZCBjaGVjayBpZiB0aGUgU2FuZGJveCBGYWN0b3J5IGhhdmUgdGhlIGNvbnRleHQgc2FuZGJveDtcbiAgICAgICAgICAgIGxldCBwb2xpY3kgPSB0cnVlO1xuICAgICAgICAgICAgcmV0dXJuIHBvbGljeTtcbiAgICAgICAgICB9LCBoYW5kbGVFcnJvcilcbiAgICAgICAgICAudGhlbigocG9saWN5KSA9PiB7XG4gICAgICAgICAgICBpZiAoaGF2ZUVycm9yKSByZXR1cm4gZmFsc2U7XG5cbiAgICAgICAgICAgIC8vIHRoaXMgd2lsbCByZXR1cm4gdGhlIHNhbmRib3ggb3Igb25lIHByb21pc2UgdG8gZ2V0U2FuZGJveDtcbiAgICAgICAgICAgIHJldHVybiB0aGlzLnJlZ2lzdHJ5LmdldFNhbmRib3goZG9tYWluKTtcbiAgICAgICAgICB9KVxuICAgICAgICAgIC50aGVuKChwcm94eVNhbmRib3gpID0+IHtcbiAgICAgICAgICAgIGlmIChoYXZlRXJyb3IpIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIGxvZy5pbmZvKCdbUnVudGltZS5Mb2FkZXJdIDQuIGlmIHRoZSBzYW5kYm94IGlzIHJlZ2lzdGVyZWQgdGhlbiByZXR1cm4gdGhlIHNhbmRib3gnLCBwcm94eVNhbmRib3gpO1xuXG4gICAgICAgICAgICBfcHJveHlTYW5kYm94ID0gcHJveHlTYW5kYm94O1xuICAgICAgICAgICAgcmV0dXJuIHByb3h5U2FuZGJveDtcbiAgICAgICAgICB9KVxuICAgICAgICAgIC5jYXRjaCgocmVhc29uKSA9PiB7XG4gICAgICAgICAgICBpZiAoaGF2ZUVycm9yKSByZXR1cm4gZmFsc2U7XG4gICAgICAgICAgICBsb2cuaW5mbygnW1J1bnRpbWUuTG9hZGVyXSA1LiBTYW5kYm94IHdhcyBub3QgZm91bmQsIGNyZWF0aW5nIGEgbmV3IG9uZScsIHJlYXNvbik7XG5cbiAgICAgICAgICAgIGxldCBwcm94eUNhcGFiaWxpdGllcyA9IHt9O1xuICAgICAgICAgICAgaWYgKF9wcm94eURlc2NyaXB0b3IgJiYgX3Byb3h5RGVzY3JpcHRvci5oYXNPd25Qcm9wZXJ0eSgnY2FwYWJpbGl0aWVzJykpIHtcbiAgICAgICAgICAgICAgX3Byb3h5RGVzY3JpcHRvciA9IF9wcm94eURlc2NyaXB0b3Iuc3R1YkNhcGFiaWxpdGllcztcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgcmV0dXJuIHRoaXMuX3J1bnRpbWVGYWN0b3J5LmNyZWF0ZVNhbmRib3gocHJveHlDYXBhYmlsaXRpZXMpLnRoZW4oKHNhbmRib3gpID0+IHtcblxuICAgICAgICAgICAgICBzYW5kYm94LmFkZExpc3RlbmVyKCcqJywgKG1zZykgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMubWVzc2FnZUJ1cy5wb3N0TWVzc2FnZShtc2cpO1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICByZXR1cm4gc2FuZGJveDtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pXG4gICAgICAgICAgLnRoZW4oKHNhbmRib3gpID0+IHtcbiAgICAgICAgICAgIGlmIChoYXZlRXJyb3IpIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIGxvZy5pbmZvKCdbUnVudGltZS5Mb2FkZXJdIDYuIHJldHVybiB0aGUgc2FuZGJveCBpbnN0YW5jZSBhbmQgcmVnaXN0ZXInLCBzYW5kYm94LCAndG8gZG9tYWluICcsIGRvbWFpbik7XG5cbiAgICAgICAgICAgIF9wcm94eVNhbmRib3ggPSBzYW5kYm94O1xuXG4gICAgICAgICAgICA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KSB7XG4gICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgY29uZmlndXJhdGlvbiA9IE9iamVjdC5hc3NpZ24oe30sIEpTT04ucGFyc2UoX3Byb3h5RGVzY3JpcHRvci5jb25maWd1cmF0aW9uKSk7XG4gICAgICAgICAgICAgIH0gY2F0Y2ggKGUpIHtcbiAgICAgICAgICAgICAgICBjb25maWd1cmF0aW9uID0gX3Byb3h5RGVzY3JpcHRvci5jb25maWd1cmF0aW9uO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBjb25maWd1cmF0aW9uLnJ1bnRpbWVVUkwgPSB0aGlzLl9ydW50aW1lVVJMO1xuXG4gICAgICAgICAgICAvLyBEZXBsb3kgQ29tcG9uZW50IHN0ZXAgeHh4XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAvLyB3ZSBoYXZlIGNvbXBsZXRlZCBzdGVwIHh4eCBodHRwczovL2dpdGh1Yi5jb20vcmVUSElOSy1wcm9qZWN0L2NvcmUtZnJhbWV3b3JrL2Jsb2IvbWFzdGVyL2RvY3Mvc3BlY3MvcnVudGltZS9keW5hbWljLXZpZXcvYmFzaWNzL2RlcGxveS1wcm90b3N0dWIubWRcblxuICAgICAgICAgICAgICAvLyBBZGQgdGhlIG1lc3NhZ2UgYnVzIGxpc3RlbmVyXG4gICAgICAgICAgICAgIHRoaXMubWVzc2FnZUJ1cy5hZGRMaXN0ZW5lcihfcnVudGltZUlkcFByb3h5VVJMLCAobXNnKSA9PiB7XG4gICAgICAgICAgICAgICAgX3Byb3h5U2FuZGJveC5wb3N0TWVzc2FnZShtc2cpO1xuICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICByZXR1cm4gX3Byb3h5U2FuZGJveC5kZXBsb3lDb21wb25lbnQoX3Byb3h5U291cmNlUGFja2FnZS5zb3VyY2VDb2RlLCBydW50aW1lSWRwUHJveHlVUkwsIGNvbmZpZ3VyYXRpb24pO1xuIC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true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nvar _runtimeUtils = __webpack_require__(102);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Descriptors');\n\nvar Descriptors = function () {\n function Descriptors(runtimeURL, catalogue, runtimeConfiguration) {\n (0, _classCallCheck3.default)(this, Descriptors);\n\n if (!runtimeURL) throw Error('The descriptor need to know the runtime url to be used');\n if (!catalogue) throw Error('The descriptor needs the catalogue instance');\n if (!runtimeConfiguration) throw Error('The descriptor needs the runtime configuration');\n\n this.log = log;\n\n this.runtimeConfiguration = runtimeConfiguration;\n this.runtimeURL = runtimeURL;\n this.catalogue = catalogue;\n\n this.constraints = _runtimeUtils.runtimeUtils.runtimeCapabilities;\n }\n\n (0, _createClass3.default)(Descriptors, [{\n key: 'getHypertyDescriptor',\n value: function getHypertyDescriptor(hypertyURL) {\n return this.catalogue.getHypertyDescriptor(hypertyURL, true, this.constraints);\n }\n }, {\n key: 'getStubDescriptor',\n value: function getStubDescriptor(stubURL) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = void 0;\n var protostub = void 0;\n var protoStubURL = void 0;\n\n var originDividedURL = (0, _utils.divideURL)(_this.runtimeURL);\n var originDomain = originDividedURL.domain;\n\n if (stubURL.includes('://')) {\n var dividedURL = (0, _utils.divideURL)(stubURL);\n domain = dividedURL.domain;\n var path = dividedURL.identity;\n\n if (path) {\n protostub = path.substring(path.lastIndexOf('/') + 1);\n } else {\n protostub = 'default';\n }\n } else {\n protostub = 'default';\n domain = stubURL;\n }\n\n protoStubURL = (0, _utils.buildURL)(_this.runtimeConfiguration, 'catalogueURLs', 'protocolstub', protostub);\n if (domain !== _this.runtimeConfiguration.domain) {\n if (!stubURL.indexOf('https') || !stubURL.indexOf('hyperty-catalogue')) {\n protoStubURL = stubURL;\n } else {\n\n // TODO: check how to load form different configuration domain\n var resource = (0, _utils.getConfigurationResources)(_this.runtimeConfiguration, 'catalogueURLs', 'protocolstub');\n protoStubURL = resource.prefix + domain + resource.suffix + protostub;\n }\n }\n\n log.log('Load ProtocolStub for domain, ' + domain + ' : ', protoStubURL);\n return _this.catalogue.getStubDescriptor(protoStubURL, true, _this.constraints).then(function (result) {\n\n resolve(result);\n }).catch(function (error) {\n\n // log.log('Error: ', error);\n\n protostub = domain;\n domain = originDomain;\n\n var resource = (0, _utils.getConfigurationResources)(_this.runtimeConfiguration, 'catalogueURLs', 'protocolstub');\n protoStubURL = resource.prefix + domain + resource.suffix + protostub;\n\n // log.log('Fallback -> Load Protocolstub for domain, ' + domain + ' : ', protostub);\n return _this.catalogue.getStubDescriptor(protoStubURL, true, _this.constraints);\n }).then(function (result) {\n resolve(result);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'getIdpProxyDescriptor',\n value: function getIdpProxyDescriptor(idpProxyURL) {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var domain = void 0;\n var idpproxy = void 0;\n\n var originDividedURL = (0, _utils.divideURL)(_this2.runtimeURL);\n var originDomain = originDividedURL.domain;\n var constraints = _this2.constraints;\n\n constraints.constraints.onlyAccessToken = true;\n constraints.constraints.onlyIdAssertionValidation = true;\n console.log('LOG HERE', constraints);\n if (idpProxyURL.includes('://')) {\n var dividedURL = (0, _utils.divideURL)(idpProxyURL);\n domain = dividedURL.domain;\n var path = dividedURL.identity;\n if (path) {\n idpproxy = path.substring(path.lastIndexOf('/') + 1);\n } else {\n idpproxy = 'default';\n }\n } else {\n idpproxy = 'default';\n domain = idpProxyURL;\n }\n\n var resource = (0, _utils.getConfigurationResources)(_this2.runtimeConfiguration, 'catalogueURLs', 'idpProxy');\n\n idpProxyURL = resource.prefix + domain + resource.suffix + idpproxy;\n // log.log('Load Idp Proxy for domain, ' + domain + ' : ', idpProxyURL);\n return _this2.catalogue.getIdpProxyDescriptor(idpProxyURL, true, constraints).then(function (result) {\n\n resolve(result);\n }).catch(function () {\n\n idpproxy = domain;\n domain = originDomain;\n\n idpProxyURL = (0, _utils.buildURL)(_this2.runtimeConfiguration, 'catalogueURLs', 'idpProxy', idpproxy);\n\n // log.log('Load Idp Proxy for domain, ' + domain + ' : ', idpProxyURL);\n return _this2.catalogue.getIdpProxyDescriptor(idpProxyURL, true, constraints);\n }).then(function (result) {\n resolve(result);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }]);\n return Descriptors;\n}();\n\nexports.default = Descriptors;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL0Rlc2NyaXB0b3JzLmpzP2ZjZDgiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtkaXZpZGVVUkwsIGdldENvbmZpZ3VyYXRpb25SZXNvdXJjZXMsIGJ1aWxkVVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5pbXBvcnQgeyBydW50aW1lVXRpbHMgfSBmcm9tICcuL3J1bnRpbWVVdGlscyc7XG5cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignRGVzY3JpcHRvcnMnKTtcblx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TtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7OztBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBOzs7OztBQUdBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///530\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('RuntimeUA'); /**\n * Class where message bus handlers are built. To be used by the RuntimeUA to initialise the runtime UA.\n */\n\n//import { log as logLevels } from '../logLevels';\n\n// Log System\n\nvar MsgBusHandlers = function () {\n function MsgBusHandlers(pep, idm, crypto) {\n (0, _classCallCheck3.default)(this, MsgBusHandlers);\n\n if (!pep) throw Error('[MsgBusHandlers] pep input paramenter is mandatory');\n if (!idm) throw Error('[MsgBusHandlers] idm input paramente is mandatory');\n if (!crypto) throw Error('[MsgBusHandlers] crypto input paramente is mandatory');\n\n this.policyEngine = pep;\n this.identityManager = idm;\n this.cryptoManager = crypto;\n }\n\n // Policy based access control for incoming messages\n\n (0, _createClass3.default)(MsgBusHandlers, [{\n key: 'pepInHandler',\n get: function get() {\n var _this = this;\n\n return function (ctx) {\n _this.policyEngine.authorise(ctx.msg, true).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // Policy based access control for outgoing messages\n\n }, {\n key: 'pepOutHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.policyEngine.authorise(ctx.msg, false).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // Add Identity info to messages\n\n }, {\n key: 'idmHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.identityManager.processMessage(ctx.msg).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // encrypt messages\n\n }, {\n key: 'encryptHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.cryptoManager.encryptMessage(ctx.msg).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.error(reason);\n ctx.fail(reason);\n });\n };\n }\n\n // decrypt messages\n\n }, {\n key: 'decryptHandler',\n get: function get() {\n var _this = this;\n return function (ctx) {\n _this.cryptoManager.decryptMessage(ctx.msg).then(function (changedMgs) {\n ctx.msg = changedMgs;\n ctx.next();\n }).catch(function (reason) {\n log.warn(reason);\n ctx.fail(reason);\n });\n };\n }\n }]);\n return MsgBusHandlers;\n}();\n\nexports.default = MsgBusHandlers;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lL01zZ0J1c0hhbmRsZXJzLmpzPzZiYmEiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiAgQ2xhc3Mgd2hlcmUgbWVzc2FnZSBidXMgaGFuZGxlcnMgYXJlIGJ1aWx0LiBUbyBiZSB1c2VkIGJ5IHRoZSBSdW50aW1lVUEgdG8gaW5pdGlhbGlzZSB0aGUgcnVudGltZSBVQS5cbiAqL1xuXG4vL2ltcG9ydCB7IGxvZyBhcyBsb2dMZXZlbHMgfSBmcm9tICcuLi9sb2dMZXZlbHMnO1xuXG4vLyBMb2cgU3lzdGVtXG5pbXBvcnQgKiBhcyBsb2dnZXIgZnJvbSAnbG9nbGV2ZWwnO1xubGV0IGxvZyA9IGxvZ2dlci5nZXRMb2dnZXIoJ1J1bnRpbWVVQScpO1xuXG5jbGFzcyBNc2dCdXNIYW5kbGVycyB7XG5cbiAgY29uc3RydWN0b3IocGVwLCBpZG0sIGNyeXB0bykge1xuICAgIGlmICghcGVwKSB0aHJvdyBFcnJvcignW01zZ0J1c0hhbmRsZXJzXSBwZXAgaW5wdXQgcGFyYW1lbnRlciBpcyBtYW5kYXRvcnknKTtcbiAgICBpZiAoIWlkbSkgdGhyb3cgRXJyb3IoJ1tNc2dC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UFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7OztBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///531\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('CoreDiscovery'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n* Core Discovery interface\n* Class to allow applications to search for hyperties and DataObjects using the message bus\n*/\nvar CoreDiscovery = function () {\n\n /**\n * To initialise the Discovery, which will provide the support for hyperties to\n * query users registered in outside the internal core.\n * @param {MessageBus} msgbus msgbus\n * @param {RuntimeURL} runtimeURL runtimeURL\n * @param {graphConnector} graphConnector\n */\n function CoreDiscovery(runtimeURL, msgBus, graphConnector, runtimeFactory, registry) {\n (0, _classCallCheck3.default)(this, CoreDiscovery);\n\n if (!runtimeFactory) throw Error('The catalogue needs the runtimeFactory');\n\n var _this = this;\n this._messageBus = msgBus;\n _this.graphConnector = graphConnector;\n _this.httpRequest = runtimeFactory.createHttpRequest();\n _this.domain = (0, _utils.divideURL)(runtimeURL).domain;\n _this.discoveryURL = runtimeURL + '/discovery/';\n _this.registry = registry;\n\n _this.messageBus.addListener(_this.discoveryURL, function (msg) {\n\n _this.discoveryManager(msg).then(function (result) {\n\n //FLOW-OUT: message response\n _this.messageBus.postMessage({\n id: msg.id,\n type: 'response',\n from: msg.to,\n to: msg.from,\n body: {\n code: 200,\n value: result\n }\n });\n }).catch(function (err) {\n var description = void 0;\n var code = void 0;\n\n if (err === 'GraphConnector') {\n description = 'This search is not available at the moment. Try later.';\n code = 500;\n } else {\n description = 'Not Found';\n code = 404;\n }\n\n //FLOW-OUT: error message response\n _this.messageBus.postMessage({\n id: msg.id,\n type: 'response',\n from: msg.to,\n to: msg.from,\n body: {\n code: code,\n description: description\n }\n });\n });\n });\n }\n\n /**\n * Returns the MessageBus.\n */\n\n\n (0, _createClass3.default)(CoreDiscovery, [{\n key: 'discoveryManager',\n\n\n /* function to decide what discovery method to call and later return the response msg */\n value: function discoveryManager(msg) {\n var _this = this;\n var domain = (0, _utils.divideURL)(msg.from).domain;\n var atributes = msg.body.resource.split('/').filter(Boolean);\n var resources = [];\n var dataSchemes = [];\n\n log.log('[CoreDiscovery.discoveryManager] received: ', msg);\n\n if (msg.body.criteria) {\n if (msg.body.criteria.resources) {\n resources = msg.body.criteria.resources;\n }\n if (msg.body.criteria.dataSchemes) {\n dataSchemes = msg.body.criteria.dataSchemes;\n }\n }\n\n switch (atributes[1]) {\n case 'user':\n if (atributes[0] == 'hyperty') {\n return _this.discoverHyperties(msg.body.resource.split('user/')[1], dataSchemes, resources, msg.body.criteria.domain);\n } else {\n return _this.discoverDataObjects(msg.body.resource.split('user/')[1], dataSchemes, resources, msg.body.criteria.domain);\n }\n break;\n\n case 'url':\n if (atributes[0] == 'hyperty') {\n return _this.discoverHypertyPerURL(msg.body.resource.split('url/')[1], msg.body.criteria.domain);\n } else {\n return _this.discoverDataObjectPerURL(msg.body.resource.split('url/')[1], msg.body.criteria.domain);\n }\n break;\n case 'name':\n return _this.discoverDataObjectsPerName(msg.body.resource.split('name/')[1], dataSchemes, resources, msg.body.criteria.domain);\n break;\n case 'reporter':\n return _this.discoverDataObjectsPerReporter(msg.body.resource.split('reporter/')[1], dataSchemes, resources, msg.body.criteria.domain);\n break;\n case 'guid':\n if (typeof _this.graphConnector !== 'undefined' && _this.graphConnector !== null) {\n if (atributes[0] == 'hyperty') {\n return _this.discoverHypertiesPerGUID(msg.body.resource.split('user-guid://')[1], dataSchemes, resources);\n } else {\n return _this.discoverDataObjectsPerGUID(msg.body.resource.split('user-guid://')[1], dataSchemes, resources);\n }\n break;\n } else {\n return _promise2.default.reject('GraphConnector');\n break;\n }\n case 'userprofile':\n if (typeof _this.graphConnector !== 'undefined' && _this.graphConnector !== null) {\n if (atributes[0] == 'hyperty') {\n return _this.discoverHypertiesPerUserProfileData(msg.body.resource.split('userprofile/')[1], dataSchemes, resources);\n } else {\n return _this.discoverDataObjectsPerUserProfileData(msg.body.resource.split('userprofile/')[1], dataSchemes, resources);\n }\n break;\n } else {\n return _promise2.default.reject('GraphConnector');\n break;\n }\n }\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerUserProfileData',\n value: function discoverHypertiesPerUserProfileData(userIdentifier, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate user identifier (e.g. email, name...) into the associated GUIDs\n _this.discoverGUIDPerUserIdentifier(userIdentifier).then(function (guids) {\n\n var hypertiesPromises = guids.map(function (guid) {\n\n return new _promise2.default(function (resolve, reject) {\n _this.discoverHypertiesPerGUID(guid, dataSchemes, resources).then(function (hyperties) {\n resolve(hyperties);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(hypertiesPromises).then(function (hypertiesResult) {\n\n var hyperties = [].concat.apply([], hypertiesResult);\n\n if (hyperties.length === 0) {\n return reject('No hyperties were found');\n }\n\n resolve(hyperties);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverDataObjectsPerUserProfileData',\n value: function discoverDataObjectsPerUserProfileData(userIdentifier, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate user identifier (e.g. email, name...) into the associated GUIDs\n _this.discoverGUIDPerUserIdentifier(userIdentifier).then(function (guids) {\n\n var dataObjectsPromises = guids.map(function (guid) {\n\n return new _promise2.default(function (resolve, reject) {\n _this.discoverDataObjectsPerGUID(guid, dataSchemes, resources).then(function (dataObjects) {\n resolve(dataObjects);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(dataObjectsPromises).then(function (dataObjectsResult) {\n\n var dataObjects = [].concat.apply([], dataObjectsResult);\n\n if (dataObjects.length === 0) {\n return reject('No dataObjects were found');\n }\n\n resolve(dataObjects);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * Advanced Search for Hyperties registered in domain registry associated with some GUID\n * @param {String} guid\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverHypertiesPerGUID',\n value: function discoverHypertiesPerGUID(guid, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate GUID into the user IDs to query the domain registry\n _this.discoverUserIdsPerGUID(guid).then(function (uids) {\n\n //translate user IDs into the associated hyperties registered in some domain\n var hypertiesPromises = uids.map(function (uid) {\n return new _promise2.default(function (resolve, reject) {\n _this.discoverHyperties(uid.uID, dataSchemes, resources, uid.domain).then(function (hyperties) {\n resolve(hyperties);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(hypertiesPromises).then(function (hypertiesResult) {\n\n var hyperties = [].concat.apply([], hypertiesResult);\n\n if (hyperties.length === 0) {\n return reject('No hyperties were found');\n }\n\n // log.log('Hyperties : ', hyperties);\n resolve(hyperties);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * Advanced Search for DataObjects registered in domain registry associated with some GUID\n * @param {String} guid\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n */\n\n }, {\n key: 'discoverDataObjectsPerGUID',\n value: function discoverDataObjectsPerGUID(guid, dataSchemes, resources) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate GUID into the user IDs to query the domain registry\n _this.discoverUserIdsPerGUID(guid).then(function (uids) {\n\n //translate user IDs into the associated dataObjects registered in some domain\n var dataObjectPromises = uids.map(function (uid) {\n return new _promise2.default(function (resolve, reject) {\n _this.discoverDataObjects(uid.uID, dataSchemes, resources, uid.domain).then(function (dataObjects) {\n resolve(dataObjects);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(dataObjectPromises).then(function (dataObjectsResult) {\n\n var dataObjects = [].concat.apply([], dataObjectsResult);\n\n if (dataObjects.length === 0) {\n return reject('No dataObjects were found');\n }\n\n // log.log('DataObjects : ', dataObjects);\n resolve(dataObjects);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /** Advanced Search for Hyperties registered in domain registry and associated with some user ID\n * @param {String} user user identifier, either in url or email format\n * @param {Array} dataSchemes (Optional) types of hyperties schemas\n * @param {Array} resources (Optional) types of hyperties resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverHyperties',\n value: function discoverHyperties(user, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {}\n };\n\n if (user.indexOf('user://') > -1) {\n msg.body.resource = user;\n } else {\n msg.body.resource = '/hyperty/idp-identifier/' + user;\n }\n\n if (dataSchemes.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.dataSchemes = dataSchemes;\n }\n\n if (resources.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.resources = resources;\n }\n\n return new _promise2.default(function (resolve, reject) {\n // log.log(\"[CoreDiscovery.discoverHyperties] sending msg \", msg);\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n // log.log(\"[CoreDiscovery.discoverHyperties] rcved reply \", reply);\n\n if (reply.body.code === 200 || reply.body.code === 500) {\n var hyperties = reply.body.value;\n\n var finalHyperties = [];\n for (var key in hyperties) {\n finalHyperties.push(hyperties[key]);\n }if (finalHyperties.length > 0) {\n // log.log(\"[CoreDiscovery.discoverHyperties] Hyperties Found: \", finalHyperties);\n resolve(finalHyperties);\n } else {\n return reject('No Hyperty was found');\n }\n } else {\n return reject('No Hyperty was found');\n }\n\n /*_this.registry.isLegacy(user).then((legacy) => {\n if (legacy) resolve([{hypertyID: user }])\n else return reject('No Hyperty was found');\n });*/\n });\n });\n }\n\n /** Advanced Search for DataObjects registered in domain registry and associated with some user ID\n * @param {String} user user identifier, either in url or email format\n * @param {Array} dataSchemes (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjects',\n value: function discoverDataObjects(user, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n var dataObjectsArray = [];\n\n activeDomain = !domain ? _this.domain : domain;\n\n return new _promise2.default(function (resolve, reject) {\n\n //translate user identifier (e.g. email, name...) into the associated hyperties\n _this.discoverHyperties(user, [], [], activeDomain).then(function (hyperties) {\n\n var finalHyperties = [];\n for (var key in hyperties) {\n finalHyperties.push(hyperties[key]);\n } //translate hyperties URLs into the associated dataObjects registered in some domain\n var dataObjectsPromises = finalHyperties.map(function (hyperty) {\n return new _promise2.default(function (resolve, reject) {\n _this.discoverDataObjectsPerReporter(hyperty.hypertyID, dataSchemes, resources, activeDomain).then(function (dataObject) {\n resolve(dataObject);\n }).catch(function (err) {\n resolve([]);\n });\n });\n });\n\n _promise2.default.all(dataObjectsPromises).then(function (dataObjectsResult) {\n\n var dataObjects = [].concat.apply([], dataObjectsResult);\n\n dataObjects.forEach(function (dataObject) {\n dataObjectsArray.push(dataObject);\n });\n\n var finalDataObjects = [];\n for (var key in dataObjectsArray) {\n finalDataObjects.push(dataObjectsArray[key]);\n }if (finalDataObjects.length === 0) {\n return reject('No dataObjects were found');\n }\n\n // log.log('DataObjects Found: ', finalDataObjects);\n resolve(finalDataObjects);\n });\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * function to request about hyperties registered in domain registry, and\n * return the hyperty information, if found.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverHypertyPerURL',\n value: function discoverHypertyPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: url\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n if (reply.body.code !== 200 && reply.body.code !== 500) {\n return reject('No Hyperty was found');\n }\n\n var hyperty = reply.body.value;\n\n if (hyperty) {\n // log.log('Hyperty found: ', hyperty);\n resolve(hyperty);\n } else {\n return reject('No Hyperty was found');\n }\n });\n });\n }\n\n /**\n * function to request about dataObject registered in domain registry, and\n * return the dataObject information, if found.\n * @param {String} url dataObject URL\n * @param {String} domain (Optional)\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverDataObjectPerURL',\n value: function discoverDataObjectPerURL(url, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: url\n }\n };\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var dataObject = reply.body.value;\n\n if (dataObject) {\n // log.log('DataObject found: ', dataObject);\n resolve(dataObject);\n } else {\n return reject('DataObject not found');\n }\n });\n });\n }\n\n /** Advanced Search for dataObjects registered in domain registry\n * @param {String} name name of the dataObject\n * @param {Array} dataSchemes (Optional) types of dataObject schemas\n * @param {Array} resources (Optional) types of dataObject resources\n * @param {String} domain (Optional) domain of the registry to search\n */\n\n }, {\n key: 'discoverDataObjectsPerName',\n value: function discoverDataObjectsPerName(name, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: name\n }\n };\n\n if (dataSchemes.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.dataSchemes = dataSchemes;\n }\n\n if (resources.length > 0) {\n if (!msg.body.criteria) {\n msg.body.criteria = {};\n }\n msg.body.criteria.resources = resources;\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var dataObjects = reply.body.value;\n\n var finalDataObjects = [];\n for (var key in dataObjects) {\n finalDataObjects.push(dataObjects[key]);\n }if (finalDataObjects.length > 0) {\n // log.log(\"DataObjects Found: \", finalDataObjects);\n resolve(finalDataObjects);\n } else {\n return reject('No DataObject was found');\n }\n });\n });\n }\n\n /**\n * function to request about specific reporter dataObject registered in domain registry, and\n * return the dataObjects from that reporter.\n * @param {String} reporter dataObject reporter\n * @param {Array} scdataSchemeshema (Optional) types of dataObjects schemas\n * @param {Array} resources (Optional) types of dataObjects resources\n * @param {String} domain (Optional)\n */\n\n }, {\n key: 'discoverDataObjectsPerReporter',\n value: function discoverDataObjectsPerReporter(reporter, dataSchemes, resources, domain) {\n var _this = this;\n var activeDomain = void 0;\n\n activeDomain = !domain ? _this.domain : domain;\n\n var msg = {\n type: 'read',\n from: _this.discoveryURL,\n to: 'domain://registry.' + activeDomain,\n body: {\n resource: '/comm',\n criteria: {\n reporter: reporter\n }\n }\n };\n\n if (dataSchemes.length > 0) {\n msg.body.criteria.dataSchemes = dataSchemes;\n }\n\n if (resources.length > 0) {\n msg.body.criteria.resources = resources;\n }\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.messageBus.postMessage(msg, function (reply) {\n\n var dataObjects = reply.body.value;\n\n var finalDataObjects = [];\n for (var key in dataObjects) {\n finalDataObjects.push(dataObjects[key]);\n }if (finalDataObjects.length > 0) {\n // log.log(\"DataObjects Found: \", finalDataObjects);\n resolve(finalDataObjects);\n } else {\n return reject('No DataObject was found');\n }\n });\n });\n }\n\n /**\n * function to request global registry about the user IDs associated with some GUID\n * @param {String} guid\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverUserIdsPerGUID',\n value: function discoverUserIdsPerGUID(guid) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n // log.log(\"GO graphConnector:\", guid);\n\n _this.graphConnector.queryGlobalRegistry(guid).then(function (graphConnectorContactData) {\n\n // log.log('Information returned from Global Registry: ', graphConnectorContactData);\n\n if (typeof graphConnectorContactData === 'string' || !graphConnectorContactData) {\n return reject('Unsuccessful discover userIDs by GUID');\n } else {\n\n var userids = graphConnectorContactData.userIDs;\n\n if (userids.length === 0) {\n return reject('UserIDs not available');\n }\n\n resolve(userids);\n }\n }).catch(function (err) {\n return reject(err);\n });\n });\n }\n\n /**\n * function to request discovery service about the GUID associated with some user identifier (eg email, name ...)\n * @param {String} userIdentifier\n * @return {Promise} Promise\n */\n\n }, {\n key: 'discoverGUIDPerUserIdentifier',\n value: function discoverGUIDPerUserIdentifier(userIdentifier) {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var lookupURLDiscoveryService = 'https://rethink.tlabscloud.com/discovery/rest/discover/lookup?searchquery=';\n _this.httpRequest.get(lookupURLDiscoveryService + userIdentifier).then(function (json) {\n // log.log('discover GUID by user identifier', json);\n\n var response = JSON.parse(json);\n var filteredGuid = response.results.filter(function (x) {\n return x.rethinkID != undefined;\n });\n\n if (filteredGuid.length === 0) {\n return reject('Unsuccessful discover GUID by user identifier');\n }\n\n var guids = filteredGuid.map(function (x) {\n return x.rethinkID;\n });\n\n return resolve(guids);\n }).catch(function (err) {\n // log.log(\"HTTP Request error: \", err);\n return reject(err);\n });\n });\n }\n }, {\n key: 'messageBus',\n get: function get() {\n return this._messageBus;\n }\n\n /**\n * Sets the MessageBus.\n * @param {MessageBus} messageBus The Message Bus.\n */\n ,\n set: function set(messageBus) {\n this._messageBus = messageBus;\n }\n }]);\n return CoreDiscovery;\n}();\n\nexports.default = CoreDiscovery;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9kaXNjb3ZlcnkvQ29yZURpc2NvdmVyeS5qcz8yMzdkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4qIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4qIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4qIENvcHlyaWdodCAyMDE2IEFwaXplZVxuKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuKlxuKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4qIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdFxuKlxuKiAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuKlxuKiBVbmxlc3MgcmVx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GlkOiBtc2cuaWQsXG4gICAgICAgICAgdHlwZTogJ3Jlc3BvbnNlJyxcbiAgICAgICAgICBmcm9tOiBtc2cudG8sXG4gICAgICAgICAgdG86IG1zZy5mcm9tLFxuICAgICAgICAgIGJvZHk6IHtcbiAgICAgICAgICAgIGNvZGU6IDIwMCxcbiAgICAgICAgICAgIHZhbHVlOiByZXN1bHRcbiAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgICAgfSlcbiAgICAgICAgLmNhdGNoKGZ1bmN0aW9uKGVycikge1xuICAgICAgICAgIGxldCBkZXNjcmlwdGlvbjtcbiAgICAgICAgICBsZXQgY29kZTtcblxuICAgICAgICAgIGlmIChlcnIgPT09ICdHcmFwaENvbm5lY3RvcicpIHtcbiAgICAgICAgICAgIGRlc2NyaXB0aW9uID0gJ1RoaXMgc2VhcmNoIGlzIG5vdCBhdmFpbGFibGUgYXQgdGhlIG1vbWVudC4gVHJ5IGxhdGVyLic7XG4gICAgICAgICAgICBjb2RlID0gNTAwO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBkZXNjcmlwdGlvbiA9ICdOb3QgRm91bmQnO1xuICAgICAgICAgICAgY29kZSA9IDQwNDtcbiAgICAgICAgICB9XG5cbiAgICAgICAgICAvL0ZMT1ctT1VUOiBlcnJvciBtZXNzYWdlIHJlc3BvbnNlXG4gICAgICAgICAgX3RoaXMubWVzc2FnZUJ1cy5wb3N0TWVzc2FnZSh7XG4gICAgICAgICAgICBpZDogbXNnLmlkLFxuICAgICAgICAgICAgdHlwZTogJ3Jlc3BvbnNlJyxcbiAgICAgICAgICAgIGZyb206IG1zZy50byxcbiAgICAgICAgICAgIHRvOiBtc2cuZnJvbSxcbiAgICAgICAgICAgIGJvZHk6IHtcbiAgICAgICAgICAgICAgY29kZTogY29kZSxcbiAgICAgICAgICAgICAgZGVzY3JpcHRpb246IGRlc2NyaXB0aW9uXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSk7XG4gICAgICAgIH0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ZiBoeXBlcnRpZXMgcmVzb3VyY2VzXG4gICovXG4gIGRpc2NvdmVySHlwZXJ0aWVzUGVyVXNlclByb2ZpbGVEYXRhKHVzZXJJZGVudGlmaWVyLCBkYXRhU2NoZW1lcywgcmVzb3VyY2VzKSB7XG4gICAgbGV0IF90aGlzID0gdGhpcztcblxuICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcblxuICAgICAgLy90cmFuc2xhdGUgdXNlciBpZGVudGlmaWVyIChlLmcuIGVtYWlsLCBuYW1lLi4uKSBpbnRvIHRoZSBhc3NvY2lhdGVkIEdVSURzXG4gICAgICBfdGhpcy5kaXNjb3ZlckdVSURQZXJVc2VySWRlbnRpZmllcih1c2VySWRlbnRpZmllcilcbiAgICAgICAgLnRoZW4oZnVuY3Rpb24oZ3VpZHMpIHtcblxuICAgICAgICAgIGxldCBoeXBlcnRpZXNQcm9taXNlcyA9IGd1aWRzLm1hcChmdW5jdGlvbihndWlkKSB7XG5cbiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgICAgX3RoaXMuZGlzY292ZXJIeXBlcnRpZXNQZXJHVUlEKGd1aWQsIGRhdGFTY2hlbWVzLCByZXNvdXJjZXMpXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oaHlwZXJ0aWVzKSB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKGh5cGVydGllcyk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKFtdKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgUHJvbWlzZS5hbGwoaHlwZXJ0aWVzUHJvbWlzZXMpXG4gICAgICAg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sZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKGZ1bmN0aW9uKHJlc29sdmUsIHJlamVjdCkge1xuXG4gICAgICAvL3RyYW5zbGF0ZSB1c2VyIGlkZW50aWZpZXIgKGUuZy4gZW1haWwsIG5hbWUuLi4pIGludG8gdGhlIGFzc29jaWF0ZWQgR1VJRHNcbiAgICAgIF90aGlzLmRpc2NvdmVyR1VJRFBlclVzZXJJZGVudGlmaWVyKHVzZXJJZGVudGlmaWVyKVxuICAgICAgICAudGhlbihmdW5jdGlvbihndWlkcykge1xuXG4gICAgICAgICAgbGV0IGRhdGFPYmplY3RzUHJvbWlzZXMgPSBndWlkcy5tYXAoZnVuY3Rpb24oZ3VpZCkge1xuXG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgIF90aGlzLmRpc2NvdmVyRGF0YU9iamVjdHNQZXJHVUlEKGd1aWQsIGRhdGFTY2hlbWVzLCByZXNvdXJjZXMpXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdHMpIHtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUoZGF0YU9iamVjdHMpO1xuICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uKGVycikge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShbXSk7XG4gICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KTtcblxuICAgICAgICAgIFByb21pc2UuYWxsKGRhdGFPYmplY3RzUHJvbWlzZXMpXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbihkYXRhT2JqZWN0c1Jlc3VsdCkge1xuXG4gICAgICAgICAgICAgIGxldCBkYXRhT2JqZWN0cyA9IFtdLmNvbmNhdC5hcHBseShbXSwgZGF0YU9iamVjd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cy5kaXNjb3ZlclVzZXJJZHNQZXJHVUlEKGd1aWQpXG4gICAgICAgIC50aGVuKGZ1bmN0aW9uKHVpZHMpIHtcblxuICAgICAgICAvL3RyYW5zbGF0ZSB1c2VyIElEcyBpbnRvIHRoZSBhc3NvY2lhdGVkIGh5cGVydGllcyByZWdpc3RlcmVkIGluIHNvbWUgZG9tYWluXG4gICAgICAgICAgbGV0IGh5cGVydGllc1Byb21pc2VzID0gdWlkcy5tYXAoZnVuY3Rpb24odWlkKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgIF90aGlzLmRpc2NvdmVySHlwZXJ0aWVzKHVpZC51SUQsIGRhdGFTY2hlbWVzLCByZXNvdXJjZXMsIHVpZC5kb21haW4pXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oaHlwZXJ0aWVzKSB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKGh5cGVydGllcyk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKFtdKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgUHJvbWlzZS5hbGwoaHlwZXJ0aWVzUHJvbWlzZXMpXG4gICAgICAgICAgICAudGhlbihmdW5jdGlvbihoeXBlcnRpZXNSZXN1bHQpIHtcblxuICAgICAgICAgICAgICBsZXQgaHlwZXJ0aWVzID0gW10uY29uY2F0LmFwcGx5KFtdLCBoeXBlcnRpZXNSZXN1bHQpO1xuXG4gICAgICAgICAgICAgIGlmIChoeXBlcnRpZXMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdCgnTm8gaHlwZXJ0aWVzIHdlcmUgZm91b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pIHtcblxuICAgICAgICAvL3RyYW5zbGF0ZSB1c2VyIElEcyBpbnRvIHRoZSBhc3NvY2lhdGVkIGRhdGFPYmplY3RzIHJlZ2lzdGVyZWQgaW4gc29tZSBkb21haW5cbiAgICAgICAgICBsZXQgZGF0YU9iamVjdFByb21pc2VzID0gdWlkcy5tYXAoZnVuY3Rpb24odWlkKSB7XG4gICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoZnVuY3Rpb24ocmVzb2x2ZSwgcmVqZWN0KSB7XG4gICAgICAgICAgICAgIF90aGlzLmRpc2NvdmVyRGF0YU9iamVjdHModWlkLnVJRCwgZGF0YVNjaGVtZXMsIHJlc291cmNlcywgdWlkLmRvbWFpbilcbiAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbihkYXRhT2JqZWN0cykge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShkYXRhT2JqZWN0cyk7XG4gICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgICAgICAgICByZXNvbHZlKFtdKTtcbiAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgUHJvbWlzZS5hbGwoZGF0YU9iamVjdFByb21pc2VzKVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdHNSZXN1bHQpIHtcblxuICAgICAgICAgICAgICBsZXQgZGF0YU9iamVjdHMgPSBbXS5jb25jYXQuYXBwbHkoW10sIGRhdGFPYmplY3RzUmVzdWx0KTtcblxuICAgICAgICAgICAgICBpZiAoZGF0YU9iamVjdHMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuIHJlamVjdCgnTm8gZGF0YU9iamVjdHMgd2VyZSBmb3VuZCcpO1xuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgLy8gbG9nLmxvZygnRGF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Y3Rpb24oaHlwZXJ0aWVzKSB7XG5cbiAgICAgICAgICBsZXQgZmluYWxIeXBlcnRpZXMgPSBbXTtcbiAgICAgICAgICBmb3IgKHZhciBrZXkgaW4gaHlwZXJ0aWVzKSBmaW5hbEh5cGVydGllcy5wdXNoKGh5cGVydGllc1trZXldKTtcblxuICAgICAgICAgIC8vdHJhbnNsYXRlIGh5cGVydGllcyBVUkxzIGludG8gdGhlIGFzc29jaWF0ZWQgZGF0YU9iamVjdHMgcmVnaXN0ZXJlZCBpbiBzb21lIGRvbWFpblxuICAgICAgICAgIGxldCBkYXRhT2JqZWN0c1Byb21pc2VzID0gZmluYWxIeXBlcnRpZXMubWFwKGZ1bmN0aW9uKGh5cGVydHkpIHtcbiAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZShmdW5jdGlvbihyZXNvbHZlLCByZWplY3QpIHtcbiAgICAgICAgICAgICAgX3RoaXMuZGlzY292ZXJEYXRhT2JqZWN0c1BlclJlcG9ydGVyKGh5cGVydHkuaHlwZXJ0eUlELCBkYXRhU2NoZW1lcywgcmVzb3VyY2VzLCBhY3RpdmVEb21haW4pXG4gICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdCkge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShkYXRhT2JqZWN0KTtcbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbihlcnIpIHtcbiAgICAgICAgICAgICAgICAgIHJlc29sdmUoW10pO1xuICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICBQcm9taXNlLmFsbChkYXRhT2JqZWN0c1Byb21pc2VzKVxuICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24oZGF0YU9iamVjdHNSZXN1bHQpIHtcblxuICAgICAgICAgICAgICBsZXQgZGF0YU9iamVjdHMgPSBbXS5jb25jYXQuYXBwbHkoW10sIGRhdGFPYmplY3RzUmVzdWx0KTtcblxuICAgICAgICAgICAgICBkYXRhT2JqZWN0cy5mb3JFYWNoKGZ1bmN0aW9uKGRhdGFPYmplY3QpIHtcbiAgICAgICAgICAgICAgICBkYXRhT2JqZWN0c0FycmF5LnB1c2goZGF0YU9iamVjdCk7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIGxldCBmaW5hbERhdGFPYmplY3RzID0gW107XG4gICAgICAgICAgICAgIGZvciAodmFyIGtleSBpbiBkYXRhT2JqZWN0c0FycmF5KSBmaW5hbERhdGFPYmplY3RzLnB1c2goZGF0YU9iamVjdHNBcnJheVtrZXldKTtcblxuICAgICAgICAgICAgICBpZiAoZmluYWxEYXRhT2JqZWN0cy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gcmVqZWN0KCdObyBkYXRhT2JqZWN0cyB3ZXJlIGZvdW5kJyk7XG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAvLyBsb2cubG9nKCdEYXRhT2JqZWN0cyBGb3VuZDogJywgZmluYWxEYXRhT2JqZWN0cyk7XG4gICAgICAgICAgICAgIHJlc29sdmUoZmluYWxEYXRhT2JqZWN0cyk7XG4gICAgICAgICAgICB9KTtcblxuICAgICAgICB9KVxuICAgICAgICAuY2F0Y2goZnVuY3Rpb24oZXJyKSB7XG4gICAgICAgICAgcmV0dXJuIHJlamVjdChlcnIpO1xuICAgICAgICB9KTtcbiAgICB9KTtcbiAgfVxuXG4gIC8qKlxuICAqIGZ1bmN0aW9uIHRvIHJlcXVlc3QgYWJvdXQgaHlwZXJ0aWVzIHJlZ2lzdGVyZWQgaW4gZG9tYWluIHJlZ2lzdHJ5LCBhbmRcbiAgKiByZXR1cm4gdGhlIGh5cGVydHkgaW5mb3JtYXRpb24sIGlmIGZvdW5kLlxuICAqIEBwYXJhbSAge1N0cmluZ30gICAgICAgICAgICAgIHVybCAgZGF0YU9iamVjdCBVUkxcbiAgK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OztBQUtBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFLQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFBQTtBQUFBO0FBQ0E7QUFDQTtBQUFBO0FBQUE7QUFDQTtBQUNBO0FBRUE7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUF2bUJBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7O0FBSUE7QUFDQTtBQUNBOzs7OztBQWdtQkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///532\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _from = __webpack_require__(222);\n\nvar _from2 = _interopRequireDefault(_from);\n\nvar _typeof2 = __webpack_require__(82);\n\nvar _typeof3 = _interopRequireDefault(_typeof2);\n\nvar _assign = __webpack_require__(42);\n\nvar _assign2 = _interopRequireDefault(_assign);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Storage = __webpack_require__(221);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('DataObjectsStorage'); // Log System\n\nvar DataObjectsStorage = function () {\n function DataObjectsStorage(storageManager) {\n var storedDataObjects = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var factory = arguments[2];\n var runtimeStatusUpdate = arguments[3];\n (0, _classCallCheck3.default)(this, DataObjectsStorage);\n\n if (!storageManager) throw new Error('[Store Data Objects] - Needs the storageManager component');\n\n this._storageManager = storageManager;\n\n this._storeDataObject = storedDataObjects;\n\n this._cache = {};\n\n this._createSyncDB = _Storage.createSyncDB; // to create Data Objects to be synched with remote storages\n this._remotes = {}; // List of DO synched with remote storages\n this._factory = factory;\n this._table = 'syncherManager:ObjectURLs';\n this._remoteStorageTable = 'dataObjectStorage';\n this._remoteSchema = 'url';\n this._runtimeStatusUpdate = runtimeStatusUpdate;\n }\n\n // load Data Objects synched with remote Storages\n\n (0, _createClass3.default)(DataObjectsStorage, [{\n key: 'loadRemote',\n value: function loadRemote() {\n var _this2 = this;\n\n var resume = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n var loading = [];\n var loadingDBs = [];\n\n _this._storageManager.get(null, null, 'remotes').then(function (remotes) {\n\n // in case we don't have any remotes locally stored\n log.info('[StoreDataObjects.loadRemote] remotes: ', remotes);\n if (!remotes) resolve();\n\n if (!resume) _this._remotes = remotes;\n\n log.info('[StoreDataObjects.loadRemote] loading: ', _this._remotes);\n\n var remoteObjects = (0, _keys2.default)(remotes);\n\n // in case we don't have any remotes locally stored\n\n if (remoteObjects.length === 0) resolve();\n\n remoteObjects.forEach(function (db) {\n var schema = {};\n var table = db.split('/')[3];\n schema[table] = _this2._remoteSchema;\n _this._remotes[db] = (0, _Storage.createSyncDB)(db, _this2._factory, schema, _this2._runtimeStatusUpdate);\n // _this._remotes[remote] = createSyncDB(remote, _this._factory, 'remoteDataObjectStorage' );\n loading.push(_this._remotes[db].get(null, null, table));\n });\n\n _promise2.default.all(loading).then(function () {\n log.log('[StoreDataObjects.loadRemote] loaded. Starting init');\n //TODO: init this._storeDataObject with loaded data objects\n (0, _keys2.default)(_this._remotes).forEach(function (remote) {\n var table = remote.split('/')[3];\n loadingDBs.push(_this._remotes[remote].get(null, null, table));\n });\n _promise2.default.all(loadingDBs).then(function (dataObjs) {\n\n if (dataObjs.length === 0) resolve();\n\n dataObjs.forEach(function (dO) {\n (0, _keys2.default)(dO).forEach(function (url) {\n\n log.log('[StoreDataObjects.loadRemote] loaded remote ', dO[url]);\n // if (dO[remote].isReporter) {\n var type = _this2._getTypeOfObject(dO[url].isReporter);\n\n if (!_this._storeDataObject) _this._storeDataObject = {};\n\n if (!_this._storeDataObject.hasOwnProperty(type)) _this._storeDataObject[type] = {};\n\n _this._storeDataObject[type][url] = dO[url];\n\n // let backupRevision \n\n /* let synching = [];\n \n synching.push(\n _this._sync(url, dO[url].data.backupRevision, true, url.split('/')[3]).then((synchedObj) => {\n _this._storeDataObject[type][url] = synchedObj;\n log.log('[StoreDataObjects.loadRemote] storeDataObject updated: ', _this._storeDataObject);\n })\n );\n \n Promise.all(synching).then(() => {\n resolve(_this._storeDataObject);\n });*/\n\n /* setTimeout(function () {\n _this._remotes[url].disconnect().then(() => {\n log.log('[DataObjectStorage.loadRemote] disconnected ');\n \n }, (error) => {\n log.error('[DataObjectStorage.sync] Error synching with remote storage');\n reject(error);\n });\n \n }, 1000);*/\n });\n });\n resolve(_this._storeDataObject);\n }, function (error) {\n reject(error);\n });\n });\n }, function (error) {\n reject(error);\n });\n\n resolve();\n });\n }\n\n /**\n * @description should set the initial state of the dataObjectURL to be resumed if necessary;\n *\n * @param {DataObjectURL} url - dataObjectURL to be saved;\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {SchemaURL} schema - the schema url\n * @param {String} status - the status of current dataObject\n * @param {HypertyURL} reporter - the Reporter hypertyURL\n * @param {Array} subscription - list of subscriptions\n * @param {Array} children - list of childs of dataObjectURL\n * @param {Array} childrens - list of childrens, like, 'chatmessage';\n * @param {Array {\n \n console.log('[DataObjectStorage.initialObserverSync] connected ');\n \n setTimeout(function() {\n _this._remotes[resource].disconnect().then(()=>{\n console.log('[DataObjectStorage.initialObserverSync] disconnected ');\n },(error)=> {\n log.error('[DataObjectStorage.initialObserverSync] Error disconnecting with remote storage');\n reject(error);\n });\n }, 15000)\n \n }, (error) => {\n log.error('[DataObjectStorage.initialObserverSync] Error connecting to remote storage');\n reject(error)\n });\n \n }*/\n\n /**\n * @description should save and update the current dataObject data information\n *\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {DataObjectURL} resource - dataObjectURL to be saved or updated;\n * @param {String} attribute - attribute inside the data which will be saved\n * @param {any} data - value will be saved inside the attribute;\n */\n\n }, {\n key: 'saveData',\n value: function saveData(isReporter, resource, attribute, value, updateRuntimeStatus) {\n\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - save data] - not saved');\n return;\n }\n\n log.log('[StoreDataObjects - saveData] - ', isReporter, type, resource, attribute, value);\n\n if (!storeDataObject[type][resource].hasOwnProperty('data')) {\n storeDataObject[type][resource].data = {};\n }\n\n if (attribute) {\n var _data = void 0;\n if ((typeof value === 'undefined' ? 'undefined' : (0, _typeof3.default)(value)) === 'object') _data = (0, _utils.deepClone)(value);else _data = value;\n\n (0, _utils.assign)(storeDataObject[type][resource].data, attribute, _data);\n } else {\n storeDataObject[type][resource].data = (0, _utils.deepClone)(value) || {};\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : this._filterRemotes(storeDataObject);\n storage.set(db, 1, data, table, updateRuntimeStatus).then(function () {\n return storeDataObject[type][resource];\n }, function (error) {\n console.error(error);\n return storeDataObject[type][resource];\n });\n }\n }, {\n key: 'saveChildrens',\n value: function saveChildrens(isReporter, resource, attribute, value) {\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - save childrens] - not saved');\n return;\n }\n\n if (!storeDataObject[type][resource].hasOwnProperty('childrens')) {\n storeDataObject[type][resource].childrenObjects = {};\n }\n\n /* if (!storeDataObject[type][resource].childrenObjects.hasOwnProperty('resources')) {\n storeDataObject[type][resource].childrenObjects.resources = {};\n }*/\n\n if (attribute) {\n (0, _utils.assign)(storeDataObject[type][resource].childrenObjects, attribute, (0, _utils.deepClone)(value));\n } else {\n storeDataObject[type][resource].childrenObjects = (0, _utils.deepClone)(value) || {};\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : this._filterRemotes(storeDataObject);\n storage.set(db, 1, data, table).then(function () {\n return storeDataObject[type][resource];\n });\n }\n\n /**\n * @description should save and update the current dataObject information\n *\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {DataObjectURL} resource - dataObjectURL to be saved or updated;\n * @param {String} attribute - attribute inside the data which will be saved\n * @param {any} data - value will be saved inside the attribute;\n */\n\n }, {\n key: 'update',\n value: function update(isReporter, resource, attribute, value, updateRuntimeStatus) {\n\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - update] - not saved');\n return;\n }\n\n log.log('[StoreDataObjects - update] - ', isReporter, type, resource, attribute, value);\n\n if (storeDataObject[type] && storeDataObject[type][resource] && resource && attribute && value) {\n\n if (attribute === 'subscriptions' || attribute === 'subscriberUsers') {\n var update = true;\n\n if (attribute === 'subscriptions') {\n update = !this._isOwner(storeDataObject[type][resource], value);\n }\n\n if (update) this._updateToArray(storeDataObject[type], resource, attribute, value);\n } else {\n storeDataObject[type][resource][attribute] = value;\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : this._filterRemotes(storeDataObject);\n storage.set(db, 1, data, table, updateRuntimeStatus).then(function () {\n return storeDataObject[type][resource];\n });\n }\n }\n\n /**\n * @description should delete stored information from the dataObject\n *\n * @param {Boolean} isReporter - the object to be saved is a reporter\n * @param {DataObjectURL} resource - dataObjectURL to be saved or updated;\n * @param {String} attribute - attribute inside the data which will be saved\n * @param {any} data - value will be saved inside the attribute;\n */\n\n }, {\n key: 'delete',\n value: function _delete(isReporter, resource, attribute, value) {\n\n var storeDataObject = this._storeDataObject;\n var type = this._getTypeOfObject(isReporter);\n\n if (!storeDataObject || !storeDataObject[type] || !storeDataObject[type][resource]) {\n log.log('[StoreDataObjects - delete] - not saved');\n return;\n }\n\n if (storeDataObject[type] && storeDataObject[type][resource] && resource && attribute && value) {\n\n if (attribute === 'subscriptions' || attribute === 'subscriberUsers') {\n this._removeFromArray(storeDataObject[type], resource, attribute, value);\n } else {\n delete storeDataObject[type][resource][attribute];\n }\n\n this._storeDataObject = storeDataObject;\n var db = storeDataObject[type][resource].backup ? storeDataObject[type][resource].url : 'syncherManager:ObjectURLs';\n var storage = storeDataObject[type][resource].backup ? this._remotes[db] : this._storageManager;\n var table = storeDataObject[type][resource].backup ? db.split('/')[3] : this._table;\n var data = storeDataObject[type][resource].backup ? storeDataObject[type][resource] : this._filterRemotes(storeDataObject);\n storage.set(db, 1, data, table);\n\n return storeDataObject[type][resource];\n }\n }\n\n /**\n * Delete Data Object from the storage\n */\n\n }, {\n key: 'deleteResource',\n value: function deleteResource(resource) {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (resource) {\n // return this.getAll().then((storedDataObjects) => {\n log.info('[DataObjectStorage.deleteResource] deleting: ', resource);\n\n // let this._storeDataObject = Object.assign(this._storeDataObject || {});\n\n var backup = void 0;\n var db = void 0;\n var storage = void 0;\n\n if (_this._storeDataObject.hasOwnProperty('observers') && _this._storeDataObject.observers.hasOwnProperty(resource)) {\n backup = _this._storeDataObject.observers[resource].backup ? true : false;\n\n db = backup ? _this._storeDataObject.observers[resource].url : 'syncherManager:ObjectURLs';\n storage = backup ? _this._remotes[db] : _this._storageManager;\n delete _this._storeDataObject.observers[resource];\n }\n\n if (_this._storeDataObject.hasOwnProperty('reporters') && _this._storeDataObject.reporters.hasOwnProperty(resource)) {\n backup = _this._storeDataObject.reporters[resource].backup ? true : false;\n\n db = backup ? _this._storeDataObject.reporters[resource].url : 'syncherManager:ObjectURLs';\n storage = backup ? _this._remotes[db] : _this._storageManager;\n delete _this._storeDataObject.reporters[resource];\n }\n\n // this._storeDataObject = this._storeDataObject;\n\n if (backup && storage) {\n storage.delete().then(function () {\n delete _this._remotes[db];\n _this._storageManager.delete(resource, null, 'remotes');\n });\n } else {\n storage.set(db, 1, _this4._filterRemotes(_this._storeDataObject));\n }\n\n return resolve();\n\n // });\n } else {\n reject(new Error('[StoreDataObjects] - Can\\'t delete this ' + resource));\n }\n });\n }\n }, {\n key: 'getAll',\n value: function getAll() {\n var _this5 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this._storeDataObject = _this5._storageManager.get('syncherManager:ObjectURLs').then(function (objects) {\n _this._storeDataObject = objects;\n _this.loadRemote(true).then(function (storedObjects) {\n resolve(_this._storeDataObject);\n });\n });\n });\n // return this._storageManager.get('syncherManager:ObjectURLs');\n }\n\n // To sync local storage with remote storage server\n\n }, {\n key: 'sync',\n value: function sync(resource, backupRevision) {\n var once = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n\n var _this = this;\n\n if (_this._remotes[resource]) {\n\n var table = resource.split('/')[3];\n\n if (backupRevision) return _this._sync(resource, backupRevision, once, table);else _this._remotes[resource].getBackupRevision(resource).then(function (backupRevision) {\n return _this._sync(resource, backupRevision, once, table);\n });\n } else {\n var info = '[DataObjectStorage.sync] Info: ' + resource + ' is not synched with remote storage.';\n log.info(info);\n // reject(info);\n }\n }\n }, {\n key: '_sync',\n value: function _sync(resource, backupRevision, once, table) {\n var _this = this;\n\n console.log('[DataObjectStorage._sync] backupRevision: ', backupRevision);\n\n return new _promise2.default(function (resolve, reject) {\n\n var options = { table: table, observer: false, syncedRevision: backupRevision + 3 };\n\n _this._remotes[resource].connect(options).then(function () {\n log.info('[DataObjectStorage.sync] connected with remote ');\n\n _this._remotes[resource].get(null, null, table).then(function (dataObject) {\n // this._remotes[resource].get().then((dataObject)=>{\n log.info('[DataObjectStorage.sync] returning synched DO: ', dataObject);\n\n if (once) {\n setTimeout(function () {\n _this._remotes[resource].disconnect().then(function () {\n log.info('[DataObjectStorage.sync] disconnected ');\n // resolve(dataObject[resource]);\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error synching with remote storage');\n reject(error);\n });\n }, 2000);\n }\n resolve(dataObject[resource]);\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error retrieving stored data object');\n reject(error);\n });\n }, function (error) {\n log.error('[DataObjectStorage.sync] Error connecting to remote storage ', error);\n _this._remotes[resource].get(null, null, table).then(function (dataObject) {\n log.info('[DataObjectStorage.sync] returning synched DO: ', dataObject);\n resolve(dataObject[resource]);\n });\n });\n });\n }\n }, {\n key: 'stopSync',\n value: function stopSync(resource) {\n\n if (this._remotes[resource]) this._remotes[resource].disconnect();\n }\n\n /**\n * @description should look for a specific dataObjectURL\n *\n * @param {DataObjectURL} resource - the dataObjectURL will be searched\n *\n * @returns Promise object with the dataObject information;\n */\n\n }, {\n key: 'getDataObject',\n value: function getDataObject(resource) {\n var _this6 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n /* this._remotes[resource].get().then((dataObject)=> {\n return resolve(dataObject);\n } , () => {\n this._storageManager.get('syncherManager:ObjectURLs').then((storedDataObject) => {*/\n\n var storedDataObject = _this6._storeDataObject;\n\n var observers = storedDataObject.hasOwnProperty('observers') ? storedDataObject.observers : {};\n var reporters = storedDataObject.hasOwnProperty('reporters') ? storedDataObject.reporters : {};\n\n var currentReporter = (0, _keys2.default)(reporters).find(function (value) {\n return value === resource;\n });\n var currentObserver = (0, _keys2.default)(observers).find(function (value) {\n return value === resource;\n });\n var dataObject = void 0;\n\n if (currentObserver) {\n dataObject = storedDataObject.observers[currentObserver];\n }\n if (currentReporter) {\n dataObject = storedDataObject.reporters[currentReporter];\n }\n\n log.info('[StoreDataObjects - getDataObject] - for observer: ', currentObserver);\n log.info('[StoreDataObjects - getDataObject] - for reporters: ', currentReporter);\n\n log.info('[StoreDataObjects - getDataObject] - resolve: ', dataObject);\n return dataObject ? resolve(dataObject) : reject('No dataObject was found');\n\n // });\n\n // });\n });\n }\n\n /**\n * @description should get the dataObject information by the message\n *\n * @param {Object} msg - message would be analised to get the current dataObject information\n * @param {Boolean} isReporter - the object to be saved is a reporter\n *\n * @returns Promise should retun an object with the dataObject or null\n */\n\n }, {\n key: 'getResourcesByCriteria',\n value: function getResourcesByCriteria(msg, isReporter) {\n var _this7 = this;\n\n return new _promise2.default(function (resolve) {\n\n var type = _this7._getTypeOfObject(isReporter);\n\n // this.getAll(isReporter).then((storedDataObjects) => {\n var storedDataObjects = _this7._storeDataObject;\n\n if (!storedDataObjects) {\n log.log('[DataObjectsStorage.getResourcesByCriteria] don\\'t have stored data objects');\n return resolve(null);\n }\n\n if (msg.body && msg.body.hasOwnProperty('resume') && !msg.body.resume) {\n return resolve(null);\n }\n\n // check if the message have other criteria\n // if not search for on the 'from' of the message.\n var result = [];\n var hasSubscription = _this7._hasSubscription(storedDataObjects[type], msg.from);\n var isOwner = _this7._searchOwner(storedDataObjects[type], msg.from);\n var isToProtoStubResume = _this7._checkProtostubResume(storedDataObjects, msg);\n log.log('[StoredDataObjects - getResourcesByCriteria]:', storedDataObjects, msg, hasSubscription, isOwner);\n if (msg.hasOwnProperty('from') && hasSubscription || isOwner || isToProtoStubResume) {\n var resource = void 0;\n\n if (isOwner) {\n resource = _this7._getResourcesByOwner(storedDataObjects[type], msg.from);\n } else {\n resource = _this7._getResourcesBySubscription(storedDataObjects[type], msg.from);\n }\n\n var identityFoundData = [];\n if (msg.body && msg.body.identity) identityFoundData = _this7._getResourcesByIdentity(storedDataObjects[type], msg.body.identity);\n\n //TODO: remove schema since metadata already includes the schema?\n\n var schemaFoundData = [];\n if (msg.body && msg.body.schema) schemaFoundData = _this7._getResourcesBySchema(storedDataObjects[type], msg.body.schema);\n\n var metadataFound = [];\n if (msg.body && msg.body.value) {\n var metadata = msg.body.value;\n delete metadata.data;\n metadataFound = _this7._getResourcesByMetadata(storedDataObjects[type], metadata);\n }\n\n var dataFound = [];\n if (msg.body && msg.body.value && msg.body.value.data) dataFound = _this7._getResourcesByData(storedDataObjects[type], msg.body.value.data);\n\n // you can pass as arrays as you want.. it will be merged in on place\n // removed duplicates;\n result = _this7._intersection(resource, identityFoundData, schemaFoundData, dataFound, metadataFound);\n\n if (result.length == 0 && isToProtoStubResume && type == 'observers' && msg.from.split('protostub').length > 0) {\n var storedObservers = storedDataObjects[type];\n var fromDomain = (0, _utils.divideURL)(msg.from).domain;\n (0, _keys2.default)(storedObservers).filter(function (objectURL) {\n var subscriptions = storedObservers[objectURL].subscriptions;\n var hasSubscription = false;\n subscriptions.forEach(function (subscription) {\n var subscriptionDomain = (0, _utils.divideURL)(subscription).domain;\n if (subscriptionDomain == fromDomain) {\n result.push(objectURL);\n }\n });\n });\n }\n } else {\n return resolve(null);\n }\n\n var init = {};\n result.forEach(function (key) {\n var currentIsReporter = storedDataObjects[type][key];\n init[key] = currentIsReporter;\n return init;\n });\n\n log.log('[Store Data Objects] - ', init);\n\n resolve(init);\n });\n\n // });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByIdentity',\n value: function _getResourcesByIdentity(storedData, userURL) {\n if (!storedData) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].subscriberUsers.filter(function (current) {\n return current === userURL;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByOwner',\n value: function _getResourcesByOwner(storedData, owner) {\n if (!storedData) return [];\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].reporter === owner;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesBySubscription',\n value: function _getResourcesBySubscription(storedData, subscription) {\n if (!storedData) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].subscriptions.filter(function (current) {\n return current === subscription;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesBySchema',\n value: function _getResourcesBySchema(storedData, schema) {\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n var currentObject = storedData[objectURL];\n return (0, _keys2.default)(currentObject).filter(function (key) {\n return key === 'schema' && currentObject[key] === schema;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByMetadata',\n value: function _getResourcesByMetadata(storedData, metadata) {\n if (!metadata) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n var currentObject = storedData[objectURL];\n return (0, _keys2.default)(currentObject).filter(function (key) {\n // search on storeDataObjects for specific key provided from data;\n return (0, _keys2.default)(metadata).filter(function (searchFor) {\n return key === searchFor && currentObject[key] === metadata[searchFor];\n }).length;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getResourcesByData',\n value: function _getResourcesByData(storedData, data) {\n if (!data) return [];\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n var currentObject = storedData[objectURL].hasOwnProperty('data') ? storedData[objectURL].data : {};\n return (0, _keys2.default)(currentObject).filter(function (key) {\n // search on storeDataObjects for specific key provided from data;\n return (0, _keys2.default)(data).filter(function (searchFor) {\n return key === searchFor && currentObject[key] === data[searchFor];\n }).length;\n }).length;\n });\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_hasSubscription',\n value: function _hasSubscription(storedData, subscription) {\n if (!storedData) return false;\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].subscriptions.filter(function (current) {\n return current === subscription;\n }).length;\n }).length > 0 ? true : false;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_searchOwner',\n value: function _searchOwner(storedData, from) {\n if (!storedData) return false;\n\n return (0, _keys2.default)(storedData).filter(function (objectURL) {\n return storedData[objectURL].reporter === from;\n }).length > 0 ? true : false;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_checkProtostubResume',\n value: function _checkProtostubResume(storedDataObjects, msg) {\n\n if (!storedDataObjects) return false;\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('value') && msg.body.value.hasOwnProperty('reporter')) {\n var reporter = msg.body.value.reporter;\n if (storedDataObjects.hasOwnProperty('reporters')) {\n var reportersStored = storedDataObjects.reporters;\n return (0, _keys2.default)(reportersStored).filter(function (objectURL) {\n return reportersStored[objectURL].reporter === reporter;\n }).length > 0 ? true : false;\n } else {\n return false;\n }\n } else if (storedDataObjects.hasOwnProperty('observers')) {\n var storedObservers = storedDataObjects.observers;\n var fromDomain = (0, _utils.divideURL)(msg.from).domain;\n\n return (0, _keys2.default)(storedObservers).filter(function (objectURL) {\n var subscriptions = storedObservers[objectURL].subscriptions;\n var hasSubscription = false;\n subscriptions.forEach(function (subscription) {\n var subscriptionDomain = (0, _utils.divideURL)(subscription).domain;\n if (subscriptionDomain == fromDomain) {\n hasSubscription = true;\n }\n });\n if (hasSubscription) {\n return true;\n }\n }).length > 0 ? true : false;\n }\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_isOwner',\n value: function _isOwner(value, url) {\n if (!value) return false;\n return value.reporter === url ? true : false;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_intersection',\n value: function _intersection() {\n var args = (0, _from2.default)(arguments);\n\n var result = args.reduce(function (first, second) {\n return first.concat(second);\n }).filter(function (value, index, self) {\n return self.indexOf(value) === index;\n });\n log.log('DataObjectsStorage._intersection] Result an unique array of strings: ', result);\n return result;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_updateToArray',\n value: function _updateToArray(storeDataObject, resource, key, value) {\n log.log('[DataObjectsStorage] - _updateToArray: ', storeDataObject, resource, key, value);\n if (storeDataObject[resource][key].indexOf(value) === -1) storeDataObject[resource][key].push(value);\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_removeFromArray',\n value: function _removeFromArray(storeDataObject, resource, key, value) {\n var indexOfValue = storeDataObject[resource][key].indexOf(value);\n if (indexOfValue === -1) storeDataObject[resource][key].splice(indexOfValue, 1);\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_hasValue',\n value: function _hasValue(obj, key, value) {\n return obj.hasOwnProperty(key) && obj[key] === value;\n }\n\n /**\n * @private\n * @todo documentation\n */\n\n }, {\n key: '_getTypeOfObject',\n value: function _getTypeOfObject(isReporter) {\n return isReporter ? 'reporters' : 'observers';\n }\n }]);\n return DataObjectsStorage;\n}();\n\nexports.default = DataObjectsStorage;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTMzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zdG9yZS1vYmplY3RzL0RhdGFPYmplY3RzU3RvcmFnZS5qcz9lOTU2Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignRGF0YU9iamVjdHNTdG9yYWdlJyk7XG5cbmltcG9ydCB7IGFzc2lnbiwgZGVlcENsb25lLCBkaXZpZGVVUkwgfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmltcG9ydCB7IGNyZWF0ZVN5bmNEQiB9IGZyb20gJy4uL3J1bnRpbWUvU3RvcmFnZSc7XG5cbmNsYXNzIERhdGFPYmplY3RzU3RvcmFnZSB7XG5cbiAgY29uc3RydWN0b3Ioc3RvcmFnZU1hbmFnZXIsIHN0b3JlZERhdGFPYmplY3RzID0ge30sIGZhY3RvcnksIHJ1bnRpbWVTdGF0dXNVcGRhdGUpIHtcbiAgICBpZiAoIXN0b3JhZ2VNYW5hZ2VyKSB0aHJvdyBuZXcgRXJyb3IoJ1tTdG9yZSBEYXRhIE9iamVjdHNdIC0gTmVlZHMgdGhlIHN0b3JhZ2VNYW5hZ2VyIGNvbXBvbmVudCcpO1xuXG4gICAgdGhpcy5fc3RvcmFnZU1hbmFnZXIgPSBzdG9yYWdlTWFuYWdlcjtcblxuICAgIHRoaXMuX3N0b3JlRGF0YU9iamVjdCA9IHN0b3JlZERhdGFPYmplY3RzO1xuXG4gICAgdGhpcy5fY2FjaGUgPSB7fTtcblxuICAgIHRoaXMuX2NyZWF0ZVN5bmN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1xuXG4gICAgICAgICAgICAgICAgaWYgKCFfdGhpcy5fc3RvcmVEYXRhT2JqZWN0Lmhhc093blByb3BlcnR5KHR5cGUpKSBfdGhpcy5fc3RvcmVEYXRhT2JqZWN0W3R5cGVdID0ge307XG5cbiAgICAgICAgICAgICAgICBfdGhpcy5fc3RvcmVEYXRhT2JqZWN0W3R5cGVdW3VybF0gPSBkT1t1cmxdO1xuXG4gICAgICAgICAgICAgICAgLy8gICAgICAgICAgICAgICAgICAgICAgbGV0IGJhY2t1cFJldmlzaW9uIFxuXG4vKiAgICAgICAgICAgICAgICBsZXQgc3luY2hpbmcgPSBbXTtcblxuICAgICAgICAgICAgICAgIHN5bmNoaW5nLnB1c2goXG4gICAgICAgICAgICAgICAgICBfdGhpcy5fc3luYyh1cmwsIGRPW3VybF0uZGF0YS5iYWNrdXBSZXZpc2lvbiwgdHJ1ZSwgdXJsLnNwbGl0KCcvJylbM10pLnRoZW4oKHN5bmNoZWRPYmopID0+IHtcbiAgICAgICAgICAgICAgICAgICAgX3RoaXMuX3N0b3JlRGF0YU9iamVjdFt0eXBlXVt1cmxdID0gc3luY2hlZE9iajtcbiAgICAgICAgICAgICAgICAgICAgbG9nLmxvZygnW1N0b3JlRGF0YU9iamVjdHMubG9hZFJlbW90ZV0gc3RvcmVEYXRhT2JqZWN0IHVwZGF0ZWQ6ICcsIF90aGlzLl9zdG9yZURhdGFPYmplY3QpO1xuICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgUHJvbWlzZS5hbGwoc3luY2hpbmcpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgcmVzb2x2ZShfdGhpcy5fc3RvcmVEYXRhT2JqZWN0KTtcbiAgICAgICAgICAgICAgICB9KTsqL1xuXG4vKiAgICAgICAgICAgICAgICBzZXRUaW1lb3V0KGZ1bmN0aW9uICgpIHtcbiAgICAgICAgICAgICAgICAgIF90aGlzLl9yZW1vdGVzW3VybF0uZGlzY29ubmVjdCgpLnRoZW4oKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICBsb2cubG9nKCdbRGF0YU9iamVjdFN0b3JhZ2UubG9hZFJlbW90ZV0gZGlzY29ubmVjdGVkICcpO1xuXG4gICAgICAgICAgICAgICAgICB9LCAoZXJyb3IpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgbG9nLmVycm9yKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gRXJyb3Igc3luY2hpbmcgd2l0aCByZW1vdGUgc3RvcmFnZScpO1xuICAgICAgICAgICAgICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICB9LCAxMDAwKTsqL1xuICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgcmVzb2x2ZShfdGhpcy5fc3RvcmVEYXRhT2JqZWN0KTtcblxuICAgICAgICAgIH0sIChlcnJvcikgPT4geyByZWplY3QoZXJyb3IpIH0pO1xuICAgICAgICB9KTtcbiAgICAgIH0sIChlcnJvcikgPT4ge1xuICAgICAgICByZWplY3QoZXJyb3IpO1xuICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuXG4gICAgfSk7XG4gIH1cblxuICAvKipcbiAgICogQGRlc2NyaXB0aW9uIHNob3VsZCBzZXQgdGhlIGluaXRpYWwgc3RhdGUgb2YgdGhlIGRhdGFPYmplY3RVUkwgdG8gYmUgcmVzdW1lZCBpZiBuZWNlc3Nhcnk7XG4gICAqXG4gICAqIEBwYXJhbSB7RGF0YU9iamVjdFVSTH0gdXJsIC0gZGF0YU9iamVjdFVSTCB0byBiZSBzYXZlZDtcbiAgICogQHBhcmFtIHtCb29sZWFufSBpc1JlcG9ydGVyIC0gdGhlIG9iamVjdCB0byBiZSBzYXZlZCBpcyBhIHJlcG9ydGVyXG4gICAqIEBwYXJhbSB7U2NoZW1hVVJMfSBzY2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gICAgICAgICAvLyAgICAgICAgICAgICAgICAgICAgICByZXNvbHZlKGRhdGFPYmplY3RbcmVzb3VyY2VdKTtcbiAgICAgICAgICAgICAgfSwgKGVycm9yKSA9PiB7XG4gICAgICAgICAgICAgICAgbG9nLmVycm9yKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gRXJyb3Igc3luY2hpbmcgd2l0aCByZW1vdGUgc3RvcmFnZScpO1xuICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcik7XG4gICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSwgMjAwMClcbiAgICAgICAgICB9XG4gICAgICAgICAgcmVzb2x2ZShkYXRhT2JqZWN0W3Jlc291cmNlXSk7XG4gICAgICAgIH0sIChlcnJvcikgPT4ge1xuICAgICAgICAgIGxvZy5lcnJvcignW0RhdGFPYmplY3RTdG9yYWdlLnN5bmNdIEVycm9yIHJldHJpZXZpbmcgc3RvcmVkIGRhdGEgb2JqZWN0Jyk7XG4gICAgICAgICAgcmVqZWN0KGVycm9yKVxuICAgICAgICB9KTtcbiAgICAgIH0sIChlcnJvcikgPT4ge1xuICAgICAgICBsb2cuZXJyb3IoJ1tEYXRhT2JqZWN0U3RvcmFnZS5zeW5jXSBFcnJvciBjb25uZWN0aW5nIHRvIHJlbW90ZSBzdG9yYWdlICcsIGVycm9yKTtcbiAgICAgICAgX3RoaXMuX3JlbW90ZXNbcmVzb3VyY2VdLmdldChudWxsLCBudWxsLCB0YWJsZSkudGhlbigoZGF0YU9iamVjdCkgPT4ge1xuICAgICAgICAgIGxvZy5pbmZvKCdbRGF0YU9iamVjdFN0b3JhZ2Uuc3luY10gcmV0dXJuaW5nIHN5bmNoZWQgRE86ICcsIGRhdGFPYmplY3QpO1xuICAgICAgICAgIHJlc29sdmUoZGF0YU9iamVjdFtyZXNvdXJjZV0pO1xuICAgICAgICB9KTtcbiAgICAgIH0pO1xuICAgIH0pO1xuICB9XG5cbiAgc3RvcFN5bmMocmVzb3VyY2UpIHtc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ICAgICAgICAgICBsZXQgaGFzU3Vic2NyaXB0aW9uID0gZmFsc2U7XG4gICAgICAgICAgICBzdWJzY3JpcHRpb25zLmZvckVhY2goZnVuY3Rpb24gKHN1YnNjcmlwdGlvbikge1xuICAgICAgICAgICAgICBsZXQgc3Vic2NyaXB0aW9uRG9tYWluID0gZGl2aWRlVVJMKHN1YnNjcmlwdGlvbikuZG9tYWluO1xuICAgICAgICAgICAgICBpZiAoc3Vic2NyaXB0aW9uRG9tYWluID09IGZyb21Eb21haW4pIHtcbiAgICAgICAgICAgICAgICByZXN1bHQucHVzaChvYmplY3RVUkwpO1xuICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICB9KVxuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICByZXR1cm4gcmVzb2x2ZShudWxsKTtcbiAgICAgIH1cblxuICAgICAgbGV0IGluaXQgPSB7fTtcbiAgICAgIHJlc3VsdC5mb3JFYWNoKChrZXkpID0+IHtcbiAgICAgICAgbGV0IGN1cnJlbnRJc1JlcG9ydGVyID0gc3RvcmVkRGF0YU9iamVjdHNbdHlwZV1ba2V5XTtcbiAgICAgICAgaW5pdFtrZXldID0gY3VycmVudElzUmVwb3J0ZXI7XG4gICAgICAgIHJldHVybiBpbml0O1xuICAgICAgfSk7XG5cbiAgICAgIGxvZy5sb2coJ1tTdG9yZSBEYXRhIE9iamVjdHNdIC0gJywgaW5pdCk7XG5cbiAgICAgIHJlc29sdmUoaW5pdCk7XG4gICAgfSk7XG5cbiAgICAvLyAgICB9KTtcblxuICB9XG5cbiAgLyoqXG4gICAqIEBwcml2YXRlXG4gICAqIEB0b2RvIGRvY3VtZW50YXRpb25cbiAgICovXG4gIF9nZXRSZXNvdXJjZXNCeUlkZW50aXR5KHN0b3JlZERhdGEsIHVzZXJVUkwpIHtcbiAgICBpZiAoIXN0b3JlZERhdGEpIHJldHVybiBbXTtcblxuICAgIHJldHVybiBPYmplY3Qua2V5cyhzdG9yZ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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Ozs7Ozs7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7Ozs7O0FBSUE7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///533\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(80);\n__webpack_require__(535);\nmodule.exports = __webpack_require__(11).Array.from;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9hcnJheS9mcm9tLmpzP2U3MzciXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yJyk7XG5yZXF1aXJlKCcuLi8uLi9tb2R1bGVzL2VzNi5hcnJheS5mcm9tJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uLy4uL21vZHVsZXMvX2NvcmUnKS5BcnJheS5mcm9tO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2FycmF5L2Zyb20uanNcbi8vIG1vZHVsZSBpZCA9IDUzNFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///534\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar ctx = __webpack_require__(69);\nvar $export = __webpack_require__(26);\nvar toObject = __webpack_require__(76);\nvar call = __webpack_require__(197);\nvar isArrayIter = __webpack_require__(198);\nvar toLength = __webpack_require__(133);\nvar createProperty = __webpack_require__(536);\nvar getIterFn = __webpack_require__(143);\n\n$export($export.S + $export.F * !__webpack_require__(203)(function (iter) { Array.from(iter); }), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);\n // if object isn't iterable or it's array with default iterator - use simple case\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n result.length = index;\n return result;\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5mcm9tLmpzP2FiMjIiXSwic291cmNlc0NvbnRlbnQiOlsiJ3VzZSBzdHJpY3QnO1xudmFyIGN0eCA9IHJlcXVpcmUoJy4vX2N0eCcpO1xudmFyICRleHBvcnQgPSByZXF1aXJlKCcuL19leHBvcnQnKTtcbnZh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V0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNi5hcnJheS5mcm9tLmpzXG4vLyBtb2R1bGUgaWQgPSA1MzVcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTsiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///535\n")},function(module,exports,__webpack_require__){"use strict";eval("\nvar $defineProperty = __webpack_require__(45);\nvar createDesc = __webpack_require__(79);\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));\n else object[index] = value;\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19jcmVhdGUtcHJvcGVydHkuanM/N2MxNCJdLCJzb3VyY2VzQ29udGVudCI6WyIndXNlIHN0cmljdCc7XG52YXIgJGRlZmluZVByb3BlcnR5ID0gcmVxdWlyZSgnLi9fb2JqZWN0LWRwJyk7XG52YXIgY3JlYXRlRGVzYyA9IHJlcXVpcmUoJy4vX3Byb3BlcnR5LWRlc2MnKTtcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAob2JqZWN0LCBpbmRleCwgdmFsdWUpIHtcbiAgaWYgKGluZGV4IGluIG9iamVjdCkgJGRlZmluZVByb3BlcnR5LmYob2JqZWN0LCBpbmRleCwgY3JlYXRlRGVzYygwLCB2YWx1ZSkpO1xuICBlbHNlIG9iamVjdFtpbmRleF0gPSB2YWx1ZTtcbn07XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9fY3JlYXRlLXByb3BlcnR5LmpzXG4vLyBtb2R1bGUgaWQgPSA1MzZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///536\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _PromiseQueue = __webpack_require__(538);\n\nvar _PromiseQueue2 = _interopRequireDefault(_PromiseQueue);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('HypertyResourcesStorage'); // Log System\n\nvar HypertyResourcesStorage = function () {\n function HypertyResourcesStorage(runtimeURL, bus, storageManager, hypertyResources) {\n (0, _classCallCheck3.default)(this, HypertyResourcesStorage);\n\n\n if (!storageManager) throw new Error('[HypertyResourcesStorage constructor] mandatory storageManager parameter missing');\n if (!runtimeURL) throw new Error('[HypertyResourcesStorage constructor] mandatory runtimeURL parameter missing');\n if (!bus) throw new Error('[HypertyResourcesStorage constructor] mandatory bus parameter missing');\n\n var _this = this;\n\n _this._bus = bus;\n\n _this._storageLimit = 0.9; // the save storageLimit;\n\n _this._url = runtimeURL + '/storage';\n\n _this._storageManager = storageManager;\n\n _this.promiseQueue = new _PromiseQueue2.default();\n\n _this._hypertyResources = hypertyResources;\n\n bus.addListener(_this._url, function (msg) {\n log.info('[HypertyResourcesStorage] Message RCV: ', msg);\n switch (msg.type) {\n case 'create':\n _this._onCreate(msg);break;\n case 'read':\n _this._onRead(msg);break;\n case 'delete':\n _this._onDelete(msg);break;\n }\n });\n }\n\n /**\n * check the available storage quota\n *\n * @memberof HypertyResourcesStorage\n */\n\n\n (0, _createClass3.default)(HypertyResourcesStorage, [{\n key: 'checkStorageQuota',\n value: function checkStorageQuota() {\n var _this2 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n if (_this2._availableQuota && _this2._usage) {\n return resolve((0, _utils.availableSpace)(_this2._usage, _this2._availableQuota));\n }\n\n if (navigator) {\n\n navigator.storage.estimate().then(function (estimate) {\n _this2._availableQuota = estimate.quota;\n _this2._usage = estimate.usage;\n resolve((0, _utils.availableSpace)(_this2._usage, _this2._availableQuota));\n }).catch(function (reason) {\n log.error('[HypertyResourcesStorage] CheckStorageQuota error: ', reason);\n reject(reason);\n });\n }\n });\n }\n\n /**\n * @description should save an HypertyResource contained in the body of a create message request;\n *\n * @param {string} message - message containing the hyperty resource to be stored\n */\n\n }, {\n key: '_onCreate',\n value: function _onCreate(message) {\n\n var _this = this;\n\n if (!message.body || !message.body.value) throw new Error('[HypertyResourcesStorage._onCreate] mandatory message body value missing: ', message);\n\n var content = message.body.value;\n var contentURL = content.contentURL;\n var resourceURL = '';\n\n if (!contentURL) {\n\n contentURL = [];\n resourceURL = _this._url + '/' + (0, _utils.generateGUID)();\n } else {\n var currentURL = contentURL[0];\n var resource = currentURL.substr(currentURL.lastIndexOf('/') + 1);\n resourceURL = _this._url + '/' + resource;\n }\n\n if (!_this._hypertyResources.hasOwnProperty(resourceURL)) {\n\n contentURL.push(resourceURL);\n content.contentURL = contentURL;\n }\n\n this._hypertyResources[resourceURL] = content;\n\n this.promiseQueue.add(this._toSave(resourceURL, message, content));\n }\n }, {\n key: '_toSave',\n value: function _toSave(resourceURL, message, content) {\n var _this3 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n var error = function error(reason) {\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { value: resourceURL, code: 500, description: reason }\n };\n\n _this3._bus.postMessage(response);\n\n return reject(reason);\n };\n\n _this3.checkStorageQuota().then(function (result) {\n\n if (content.size > result.quota) {\n var msg = 'The storage do not have space to store that resource';\n error(msg);\n throw Error(msg);\n }\n\n var spaceAvailable = result.quota;\n var allocated = result.usage + content.size;\n\n if (result.percent >= _this3._storageLimit || allocated > spaceAvailable) {\n return _this3._getOlderResources(content.size);\n } else {\n return true;\n }\n }).then(function () {\n return _this3._storageManager.set(resourceURL, 1, content);\n }).then(function () {\n\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { value: resourceURL, code: 200 }\n };\n\n _this3._bus.postMessage(response);\n\n log.log('Success');\n\n return resolve();\n }).catch(error);\n });\n }\n }, {\n key: '_getOlderResources',\n value: function _getOlderResources(size) {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this4._storageManager.get().then(function (result) {\n\n var resources = (0, _keys2.default)(result);\n\n var total = 0;\n var reduced = resources.sort(function (a, b) {\n return result[a].created < result[b].created;\n }).reduce(function (previousResource, currentResource) {\n var current = _this4._hypertyResources[currentResource];\n\n log.log('[HypertyResourcesStorage] _getOlderResources: ', total, size, currentResource, _this4._availableQuota);\n\n if (total <= size) {\n total += current.size;\n previousResource.push(currentResource);\n }\n\n return previousResource;\n }, []);\n\n var deleting = reduced.map(function (key) {\n return _this4._storageManager.delete(key);\n });\n\n _promise2.default.all(deleting).then(function () {\n resolve(true);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n });\n }\n\n /**\n * @description should return an HypertyResource stored in the Storage Manager identified by the content url contained in the body of a read message request;\n *\n * @param {string} message - message containing the hyperty resource to be stored\n */\n\n }, {\n key: '_onRead',\n value: function _onRead(message) {\n\n var _this = this;\n\n if (!message.body || !message.body.resource) throw new Error('[HypertyResourcesStorage._onRead] mandatory message body resource missing: ', message);\n\n var contentUrl = message.body.resource;\n\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: {}\n };\n\n // let content = _this._hypertyResources[contentUrl];\n\n log.info('[HypertyResourcesStorage._onRead] get resourceURL:', contentUrl);\n\n this._storageManager.get('resourceURL', contentUrl).then(function (content) {\n\n log.info('[HypertyResourcesStorage._onRead] found content:', content);\n\n if (content) {\n\n if (content.resourceType === 'file') {\n _this._onReadFile(response, content);\n } else {\n response.body.code = 200;\n response.body.p2p = true;\n response.body.value = content;\n _this._bus.postMessage(response);\n }\n } else {\n response.body.code = 404;\n response.body.desc = 'Content Not Found for ' + contentUrl;\n _this._bus.postMessage(response);\n }\n });\n\n //response.body.code = 404;\n\n //_this._hypertyResources[contentUrl] = message.body.value;\n\n }\n }, {\n key: '_onReadFile',\n value: function _onReadFile(response, resource) {\n var _this = this;\n\n var reader = new FileReader();\n\n reader.onload = function (theFile) {\n\n log.info('[FileHypertyResource.init] file loaded ', theFile);\n\n response.body.code = 200;\n response.body.p2p = true;\n response.body.value = (0, _utils.deepClone)(resource);\n response.body.value.content = theFile.target.result;\n _this._bus.postMessage(response);\n };\n\n if (resource.mimetype.includes('text/')) {\n reader.readAsText(resource.content);\n } else {\n var current = resource.content;\n\n var blob = void 0;\n if (Array.isArray(current)) {\n blob = new Blob(current, { type: resource.mimetype });\n } else {\n blob = new Blob([current], { type: resource.mimetype });\n }\n\n reader.readAsArrayBuffer(blob);\n }\n }\n\n /**\n * @description should delete an HypertyResource from the storage;\n *\n * @param {string} message - message containing the content URL of the hyperty resource to be deleted\n */\n\n }, {\n key: '_onDelete',\n value: function _onDelete(message) {\n\n var _this = this;\n\n if (!message.body) throw new Error('[HypertyResourcesStorage._onDelete] mandatory message body missing: ', message);\n\n if (message.body.resource) {\n delete _this._hypertyResources[message.body.resource];\n } else if (message.body.resources) {\n message.body.resources.forEach(function (resource) {\n delete _this._hypertyResources[resource];\n });\n } else {\n throw new Error('[HypertyResourcesStorage._onDelete] mandatory resource missing: ', message);\n }\n\n _this._storageManager.delete('resourceURL', message.body.resource).then(function () {\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { code: 200 }\n };\n\n _this._bus.postMessage(response);\n }).catch(function (reason) {\n var response = {\n from: message.to,\n to: message.from,\n id: message.id,\n type: 'response',\n body: { code: 400, description: reason }\n };\n\n _this._bus.postMessage(response);\n });\n }\n }]);\n return HypertyResourcesStorage;\n}();\n\nexports.default = HypertyResourcesStorage;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9oeXBlcnR5LXJlc291cmNlL0h5cGVydHlSZXNvdXJjZXNTdG9yYWdlLmpzP2I5YzkiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdIeXBlcnR5UmVzb3VyY2VzU3RvcmFnZScpO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nRlbnQuY29udGVudFVSTDtcbiAgICBsZXQgcmVzb3VyY2VVUkwgPSAnJztcblxuICAgIGlmICghY29udGVudFVSTCkge1xuXG4gICAgICBjb250ZW50VVJMID0gW107XG4gICAgICByZXNvdXJjZVVSTCA9IF90aGlzLl91cmwgKyAnLycgKyBnZW5lcmF0ZUdVSUQoKTtcblxuICAgIH0gZWxzZSB7XG4gICAgICBjb25zdCBjdXJyZW50VVJMID0gY29udGVudFVSTFswXTtcbiAgICAgIGNvbnN0IHJlc291cmNlID0gY3VycmVudFVSTC5zdWJzdHIoY3VycmVudFVSTC5sYXN0SW5kZXhPZignLycpICsgMSk7XG4gICAgICByZXNvdXJjZVVSTCA9IF90aGlzLl91cmwgKyAnLycgKyByZXNvdXJjZTtcbiAgICB9XG5cbiAgICBpZiAoIV90aGlzLl9oeXBlcnR5UmVzb3VyY2VzLmhhc093blByb3BlcnR5KHJlc291cmNlVVJMKSkge1xuXG4gICAgICBjb250ZW50VVJMLnB1c2gocmVzb3VyY2VVUkwpO1xuICAgICAgY29udGVudC5jb250ZW50VVJMID0gY29udGVudFVSTDtcblxuICAgIH1cblxuICAgIHRoaXMuX2h5cGVydHlSZXNvdXJjZXNbcmVzb3VyY2VVUkxdID0gY29udGVudDtcblxuICAgIHRoaXMucHJvbWlzZVF1ZXVlLmFkZCh0aGlzLl90b1NhdmUocmVzb3VyY2VVUkwsIG1lc3NhZ2UsIGNvbnRlbnQpKTtcblxuICB9XG5cbiAgX3RvU2F2ZShyZXNvdXJjZVVSTCwgbWVzc2FnZSwgY29udGVudCkge1xuXG4gICAgcmV0dXJuIG5ldyBQcm9taXNlKChyZXNvbHZlLCByZWplY3QpID0+IHtcblxuICAgICAgY29uc3QgZXJyb3IgPSAocmVhc29uKSA9PiB7XG4gICAgICAgIGxldCByZXNwb25zZSA9IHtcbiAgICAgICAgICBmcm9tOiBtZXNzYWdlLnRvLFxuICAgICAgICAgIHRvOiBtZXNzYWdlLmZyb20sXG4gICAgICAgICAgaWQ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BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7QUFNQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBTEE7QUFDQTtBQU9BO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFMQTtBQUNBO0FBT0E7QUFDQTtBQUVBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///537\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _toConsumableArray2 = __webpack_require__(539);\n\nvar _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PromiseQueue = function () {\n\n // TODO: Improve this Queuing\n function PromiseQueue(concurrency) {\n (0, _classCallCheck3.default)(this, PromiseQueue);\n\n this.flushing = false;\n this.Promise = _promise2.default;\n this.concurrency = typeof concurrency !== 'number' ? 1 : concurrency;\n this.promises = [];\n this.queue = [];\n this.isProcessing = false;\n }\n\n (0, _createClass3.default)(PromiseQueue, [{\n key: 'done',\n value: function done(cb) {\n this.callback = cb;\n }\n }, {\n key: 'add',\n value: function add(promise) {\n var _this = this;\n\n this.queue.push(promise);\n\n if (!this.isProcessing) {\n return this.queue.reduce(function (promiseChain, currentTask) {\n return promiseChain.then(function (chainResults) {\n return currentTask.then(function (currentResult) {\n return [].concat((0, _toConsumableArray3.default)(chainResults), [currentResult]);\n });\n });\n }, _promise2.default.resolve([])).then(function (arrayOfResults) {\n // Do something with all results\n _this.isProcessing = false;\n });\n }\n }\n }]);\n return PromiseQueue;\n}();\n\nexports.default = PromiseQueue;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy91dGlscy9Qcm9taXNlUXVldWUuanM/MDViZCJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBQcm9taXNlUXVldWUge1xuXG4gIC8vIFRPRE86IEltcHJvdmUgdGhpcyBRdWV1aW5nXG4gIGNvbnN0cnVjdG9yKGNvbmN1cnJlbmN5KSB7XG4gICAgdGhpcy5mbHVzaGluZyA9IGZhbHNlO1xuICAgIHRoaXMuUHJvbWlzZSA9IFByb21pc2U7XG4gICAgdGhpcy5jb25jdXJyZW5jeSA9ICh0eXBlb2YgY29uY3VycmVuY3kgIT09ICdudW1iZXInKSA/IDEgOiBjb25jdXJyZW5jeTtcbiAgICB0aGlzLnByb21pc2VzID0gW107XG4gICAgdGhpcy5xdWV1ZSA9IFtdO1xuICAgIHRoaXMuaXNQcm9jZXNzaW5nID0gZ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7QUFDQTs7Ozs7QUFJQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///538\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nexports.__esModule = true;\n\nvar _from = __webpack_require__(222);\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTM5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy90b0NvbnN1bWFibGVBcnJheS5qcz8xYWVlIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5leHBvcnRzLl9fZXNNb2R1bGUgPSB0cnVlO1xuXG52YXIgX2Zyb20gPSByZXF1aXJlKFwiLi4vY29yZS1qcy9hcnJheS9mcm9tXCIpO1xuXG52YXIgX2Zyb20yID0gX2ludGVyb3BSZXF1aXJlRGVmYXVsdChfZnJvbSk7XG5cbmZ1bmN0aW9uIF9pbnRlcm9wUmVxdWlyZURlZmF1bHQob2JqKSB7IHJldHVybiBvYmogJiYgb2JqLl9fZXNNb2R1bGUgPyBvYmogOiB7IGRlZmF1bHQ6IG9iaiB9OyB9XG5cbmV4cG9ydHMuZGVmYXVsdCA9IGZ1bmN0aW9uIChhcnIpIHtcbiAgaWYgKEFycmF5LmlzQXJyYXkoYXJyKSkge1xuICAgIGZvciAodmFyIGkgPSAwLCBhcnIyID0gQXJyYXkoYXJyLmxlbmd0aCk7IGkgPCBhcnIubGVuZ3RoOyBpKyspIHtcbiAgICAgIGFycjJbaV0gPSBhcnJbaV07XG4gICAgfVxuXG4gICAgcmV0dXJuIGFycjI7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuICgwLCBfZnJvbTIuZGVmYXVsdCkoYXJyKTtcbiAgfVxufTtcblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9iYWJlbC1ydW50aW1lL2hlbHBlcnMvdG9Db25zdW1hYmxlQXJyYXkuanNcbi8vIG1vZHVsZSBpZCA9IDUzOVxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///539\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _values = __webpack_require__(223);\n\nvar _values2 = _interopRequireDefault(_values);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _AddressAllocation = __webpack_require__(104);\n\nvar _AddressAllocation2 = _interopRequireDefault(_AddressAllocation);\n\nvar _ReporterObject = __webpack_require__(544);\n\nvar _ReporterObject2 = _interopRequireDefault(_ReporterObject);\n\nvar _ObserverObject = __webpack_require__(545);\n\nvar _ObserverObject2 = _interopRequireDefault(_ObserverObject);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar cryptoManager = _interopRequireWildcard(_CryptoManager);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('SyncherManager'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n//import { schemaValidation } from '../utils/schemaValidation';\n\n/**\n * @author micaelpedrosa@gmail.com\n * Core Syncronization system.\n */\nvar SyncherManager = function () {\n /* private\n _url: URL\n _bus: MiniBus\n _registry: Registry\n _allocator: AddressAllocation\n _reporters: { ObjectURL: ReporterObject }\n _observers: { ObjectURL: ObserverObject }\n */\n\n function SyncherManager(runtimeURL, bus, registry, catalog, storageManager, allocator, storeDataObjects, identityModule) {\n (0, _classCallCheck3.default)(this, SyncherManager);\n\n if (!runtimeURL) throw new Error('[Syncher Manager] - needs the runtimeURL parameter');\n if (!bus) throw new Error('[Syncher Manager] - needs the MessageBus instance');\n if (!registry) throw new Error('[Syncher Manager] - needs the Registry instance');\n if (!catalog) throw new Error('[Syncher Manager] - needs the RuntimeCatalogue instance');\n if (!storageManager) throw new Error('[Syncher Manager] - need the storageManager instance');\n\n var _this = this;\n\n _this._bus = bus;\n _this._registry = registry;\n _this._catalog = catalog;\n _this._storageManager = storageManager;\n _this._identityModule = identityModule;\n\n //TODO: these should be saved in persistence engine?\n _this.runtimeURL = runtimeURL;\n _this._url = runtimeURL + '/sm';\n _this._objectURL = runtimeURL + '/object-allocation';\n\n _this._reporters = {};\n _this._observers = {};\n\n _this._dataObjectsStorage = storeDataObjects;\n console.log('[NOTSAVING] storeDataObjects', storeDataObjects);\n //TODO: this should not be hardcoded!\n _this._domain = (0, _utils.divideURL)(runtimeURL).domain;\n\n if (allocator) {\n _this._allocator = allocator;\n } else {\n _this._allocator = _AddressAllocation2.default.instance;\n }\n\n log.log('[SyncherManager - AddressAllocation] - ', _this._allocator);\n\n bus.addListener(_this._url, function (msg) {\n log.info('[SyncherManager] RCV: ', msg);\n switch (msg.type) {\n case 'create':\n _this._onCreate(msg);break;\n case 'delete':\n _this._onDelete(msg);break;\n case 'subscribe':\n _this._onLocalSubscribe(msg);break;\n case 'unsubscribe':\n _this._onLocalUnSubscribe(msg);break;\n case 'read':\n _this._onRead(msg);break;\n case 'execute':\n _this._onExecute(msg);break;\n }\n });\n }\n\n (0, _createClass3.default)(SyncherManager, [{\n key: '_onExecute',\n\n\n //FLOW-IN: message received from Syncher -> read\n value: function _onExecute(msg) {\n\n var _this = this;\n\n var reply = {\n type: 'response',\n from: msg.to,\n to: msg.from,\n id: msg.id\n };\n\n log.info('[SyncherManager.onExecute] new message', msg);\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('method') && msg.body.hasOwnProperty('params')) {\n\n switch (msg.body.method) {\n case 'sync':\n _this._dataObjectsStorage.sync(msg.body.params[0], msg.body.params[1], false);\n break;\n case 'stopSync':\n _this._dataObjectsStorage.stopSync(msg.body.params[0]);\n break;\n }\n\n reply.body = {\n code: 200\n };\n\n _this._bus.postMessage(reply);\n } else {\n reply.body = {\n code: 400,\n desc: 'missing body or body method / params mandatory fields'\n };\n\n log.error('[SyncherManager.onExecute] error. Missing body or body method / params mandatory fields', msg);\n\n _this._bus.postMessage(reply);\n }\n }\n\n //FLOW-IN: message received from Syncher -> read\n\n }, {\n key: '_onRead',\n value: function _onRead(msg) {\n\n var _this = this;\n\n var reply = {\n type: 'response',\n from: msg.to,\n to: msg.from,\n id: msg.id\n };\n log.info('[SyncherManager.onRead] new message', msg);\n\n if (msg.hasOwnProperty('body') && msg.body.hasOwnProperty('resource')) {\n _this._dataObjectsStorage.sync(msg.body.resource, criteria.backupRevision, true).then(function (dataObject) {\n reply.body = {\n code: 200,\n value: dataObject\n };\n\n log.info('[SyncherManager.onRead] found object: ', dataObject);\n\n _this._bus.postMessage(reply);\n }, function (error) {\n reply.body = {\n code: 400,\n desc: error\n };\n\n log.error('[SyncherManager.onRead] error: ', error);\n\n _this._bus.postMessage(reply);\n });\n } else {\n reply.body = {\n code: 400,\n desc: 'missing body or body resource mandatory fields'\n };\n\n log.error('[SyncherManager.onRead] error. Missing body or body resource mandatory fields', msg);\n\n _this._bus.postMessage(reply);\n }\n }\n\n //FLOW-IN: message received from Syncher -> create\n\n }, {\n key: '_onCreate',\n value: function _onCreate(msg) {\n var _this2 = this;\n\n var from = msg.from;\n var to = msg.to;\n var _this = this;\n\n // check if message is to save new childrenObjects in the local storage\n // TODO: check if message is to store new child in the local storage and call storeChild. How to distinguish from others?\n\n //debugger;\n if (msg.body.attribute) {\n this._storeChildrens(msg);\n } else {\n\n if (!msg.body.hasOwnProperty('resume') || msg.body.hasOwnProperty('resume') && !msg.body.resume) {\n\n // check if this is an invitation message\n if (msg.body.authorise) {\n this._authorise(msg);\n log.info('[SyncherManager.onCreate - invite observers]', msg);\n } else {\n // this is to create a new data object\n log.info('[SyncherManager.onCreate - Create New Object]', msg);\n this._newCreate(msg);\n }\n } else {\n\n // If from the hyperty side, call the resumeReporter we will have resume = true'\n // so we will create an resumed object and will try to resume the object previously saved;\n this._dataObjectsStorage.getResourcesByCriteria(msg, true).then(function (result) {\n\n log.info('[SyncherManager - Create Resumed] - ResourcesByCriteria | Message: ', msg, ' result: ', result);\n\n if (result && (0, _keys2.default)(result).length > 0) {\n\n var listOfReporters = [];\n\n (0, _keys2.default)(result).forEach(function (objURL) {\n\n listOfReporters.push(_this._resumeCreate(msg, result[objURL]));\n });\n\n _promise2.default.all(listOfReporters).then(function (resumedReporters) {\n log.log('[SyncherManager - Create Resumed]', resumedReporters);\n\n // TODO: shoud send the information if some object was failing;\n var successfullyResumed = (0, _values2.default)(resumedReporters).filter(function (reporter) {\n return reporter !== false;\n });\n\n log.info('[SyncherManager.onCreate] returning resumed objects : ', successfullyResumed);\n\n //FLOW-OUT: message response to Syncher -> create resume\n _this2._bus.postMessage({\n id: msg.id, type: 'response', from: to, to: from,\n body: { code: 200, value: (0, _utils.deepClone)(successfullyResumed) }\n });\n\n /*successfullyResumed.forEach((reporter) => {\n if (reporter.backup) {\n this._dataObjectsStorage.sync(reporter.url);\n }\n });*/\n });\n } else {\n //forward to hyperty:\n var reply = {};\n reply.id = msg.id;\n reply.from = msg.to;\n reply.to = msg.from;\n reply.type = 'response';\n reply.body = {\n code: 404,\n desc: 'No data objects reporters to be resumed'\n };\n _this2._bus.postMessage(reply);\n }\n });\n }\n }\n }\n }, {\n key: '_storeChildrens',\n value: function _storeChildrens(msg) {\n var _this = this;\n\n var resource = msg.body.resource;\n var attribute = msg.body.attribute;\n\n if (attribute === 'childrenObjects') {\n _this._dataObjectsStorage.saveChildrens(false, resource, undefined, msg.body.value);\n } else {\n _this._dataObjectsStorage.saveChildrens(true, resource, attribute, msg.body.value);\n }\n }\n }, {\n key: '_newCreate',\n value: function _newCreate(msg) {\n var _this3 = this;\n\n var _this = this;\n\n var owner = msg.from;\n var domain = (0, _utils.divideURL)(msg.from).domain;\n\n // if reporter is in a Interworking Protostub the runtime domain backend services will be used\n if (_this._registry.isInterworkingProtoStub(msg.from)) {\n domain = (0, _utils.divideURL)(_this.runtimeURL).domain;\n }\n\n // let domainRegistration = msg.body.value.hasOwnProperty('domain_registration') ? msg.body.value.domain_registration : true;\n var domainRouting = msg.body.value.hasOwnProperty('domain_routing') ? msg.body.value.domain_routing : true;\n\n // Process invitation message to observers\n\n /*if (msg.body.authorise) {\n _this._authorise(msg);\n return;\n }*/\n\n //get schema from catalogue and parse -> (scheme, children)\n _this._catalog.getDataSchemaDescriptor(msg.body.schema).then(function (descriptor) {\n\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var scheme = properties.scheme ? properties.scheme.constant : 'resource';\n var childrens = properties.children ? properties.children.constant : [];\n\n // Do schema validation\n // TODO: check if is need to handle with the result of validation\n // schemaValidation(scheme, descriptor, msg.body.value);\n\n var objectInfo = {\n name: msg.body.value.name,\n schema: msg.body.value.schema,\n reporter: msg.body.value.reporter,\n resources: msg.body.value.resources\n };\n\n // should resuse data object url if it passed\n var reuseDataObject = msg.body.value.resource;\n var numOfAddress = 1;\n\n //debugger;\n //request address allocation of a new object from the msg-node\n //_this._allocator.create(domain, numOfAddress, objectInfo, scheme, reuseDataObject).then((allocated) => {\n _this._allocator.create(domain, numOfAddress, objectInfo, scheme, reuseDataObject).then(function (allocated) {\n\n var objectRegistration = (0, _utils.deepClone)(msg.body.value);\n objectRegistration.url = allocated.address[0];\n objectRegistration.authorise = msg.body.authorise;\n objectRegistration.childrens = childrens;\n\n //objectRegistration.expires = 30;//TODO: get it from data object configuration description when present\n\n delete objectRegistration.data;\n\n log.log('[SyncherManager._newCreate] ALLOCATOR CREATE:', allocated);\n\n var subscriptionURL = objectRegistration.url + '/subscription';\n\n log.log('[SyncherManager._newCreate] Subscription URL', subscriptionURL);\n\n //To register the dataObject in the runtimeRegistry\n log.info('[SyncherManager._newCreate] Register Object: ', objectRegistration);\n\n //_this._registry.registerDataObject(msg.body.value.name, msg.body.value.schema, objURL, msg.body.value.reporter, msg.body.value.resources, allocated, msg.body.authorise).then((resolve) => {\n _this._registry.registerDataObject(objectRegistration).then(function (registeredObject) {\n log.log('[SyncherManager._newCreate] DataObject successfully registered', registeredObject);\n\n //all OK -> create reporter and register listeners\n var reporter = void 0;\n\n if (!_this3._reporters[objectRegistration.url]) {\n var offline = objectRegistration.offline ? objectRegistration.offline : false;\n reporter = new _ReporterObject2.default(_this, owner, objectRegistration.url, childrens, offline);\n } else {\n reporter = _this3._reporters[objectRegistration.url];\n }\n\n log.log('[SyncherManager - new Create] - ', msg);\n\n // Store for each reporter hyperty the dataObject\n var userURL = void 0;\n // let interworking = false;\n\n if (msg.body.hasOwnProperty('identity') && msg.body.identity.userProfile && msg.body.identity.userProfile.userURL) {\n userURL = msg.body.identity.userProfile.userURL;\n\n // if (!userURL.includes('user://')) {\n // interworking = true;\n // }\n } else {\n userURL = _this._registry.getHypertyOwner(msg.from);\n\n // if (!userURL) {\n // interworking = true;\n // }\n }\n\n // should we use the msg.body.value instead?\n\n var metadata = (0, _utils.deepClone)(objectRegistration);\n metadata.subscriberUser = userURL;\n metadata.isReporter = true;\n\n // Store the dataObject information\n\n //if (!interworking) {\n\n if (msg.body.hasOwnProperty('store') && msg.body.store) {\n reporter.isToSaveData = true;\n metadata.isToSaveData = true;\n if (msg.body.value.data) {\n metadata.data = (0, _utils.deepClone)(msg.body.value.data);\n // _this._dataObjectsStorage.saveData(true, objectRegistration.url, null, msg.body.value.data); }\n // _this._dataObjectsStorage.update(true, objectRegistration.url, 'isToSaveData', true);\n\n // if (msg.body.value.data) { _this._dataObjectsStorage.saveData(true, objectRegistration.url, null, msg.body.value.data); }\n }\n }\n _this._dataObjectsStorage.set(metadata).then(function (storeObject) {\n\n if (metadata.offline) {\n //register new DataObject at Offline Subscription Manager\n msg.body.identity.guid = _this._identityModule._identities.guid;\n var forward = {\n from: msg.to,\n to: metadata.offline + '/register',\n type: 'forward',\n body: msg\n };\n\n forward.body.body.resource = objectRegistration.url;\n\n forward.body.body.value = metadata;\n\n log.log('[SyncherManager.newCreate] registering new object at offline manager ', forward);\n\n _this._bus.postMessage(forward);\n }\n //}\n var responseMsg = {\n id: msg.id, type: 'response', from: msg.to, to: owner,\n body: { code: 200, resource: objectRegistration.url, childrenResources: childrens }\n };\n\n // adding listeners to forward to reporter\n\n if (domainRouting) {\n\n reporter.forwardSubscribe([objectRegistration.url, subscriptionURL]).then(function () {\n reporter.addChildrens().then(function () {\n _this._reporters[objectRegistration.url] = reporter;\n\n //FLOW-OUT: message response to Syncher -> create\n _this._bus.postMessage(responseMsg);\n });\n });\n } else {\n reporter.addChildrens().then(function () {\n _this._reporters[objectRegistration.url] = reporter;\n\n //FLOW-OUT: message response to Syncher -> create\n _this._bus.postMessage(responseMsg);\n });\n }\n }, function (error) {\n log.error(error);\n });\n }, function (error) {\n log.error(error);\n });\n });\n }).catch(function (reason) {\n //FLOW-OUT: error message response to Syncher -> create\n var responseMsg = {\n id: msg.id, type: 'response', from: msg.to, to: owner,\n body: { code: 500, desc: reason }\n };\n\n _this._bus.postMessage(responseMsg);\n });\n }\n }, {\n key: '_resumeCreate',\n value: function _resumeCreate(msg, storedObject) {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n var owner = msg.from;\n var schema = storedObject.schema;\n var resource = storedObject.url;\n var domainRegistration = storedObject.hasOwnProperty('domain_registration') ? storedObject.domain_registration : true;\n var initialData = storedObject.data;\n\n log.log('[SyncherManager] - resume create', msg, storedObject);\n\n //get schema from catalogue and parse -> (scheme, children)\n _this._catalog.getDataSchemaDescriptor(schema).then(function (descriptor) {\n\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var scheme = properties.scheme ? properties.scheme.constant : 'resource';\n var childrens = properties.children ? properties.children.constant : [];\n\n log.log('[SyncherManager] - getDataSchemaDescriptor: ', descriptor, childrens);\n\n // Do schema validation\n // TODO: check if is need to handle with the result of validation\n // schemaValidation(scheme, descriptor, initialData);\n\n\n //all OK -> create reporter and register listeners\n var reporter = void 0;\n var offline = void 0;\n\n if (!_this4._reporters[resource]) {\n offline = storedObject.offline ? storedObject.offline : false;\n reporter = new _ReporterObject2.default(_this, owner, resource, childrens, offline);\n } else {\n reporter = _this4._reporters[resource];\n }\n\n reporter.isToSaveData = storedObject.isToSaveData;\n\n if (offline) {\n //update new DataObject at Offline Subscription Manager\n var _msg = {\n from: _this._url,\n to: offline + '/register',\n type: 'update',\n body: {}\n };\n\n log.log('[SyncherManager._resumeCreate] update object at offline manager ', _msg);\n\n _this._bus.postMessage(_msg);\n }\n\n if (domainRegistration) {\n reporter.forwardSubscribe([storedObject.url]).then(function () {\n log.log('[SyncherManager._resumeCreate] resumingReporterSubscription ', storedObject);\n _this._resumeReporterSubscriptions(msg, storedObject, reporter, childrens, domainRegistration).then(function (resumeObject) {\n log.log('[SyncherManager._resumeCreate] resolved resumed object ', resumeObject);\n resolve(resumeObject);\n });\n });\n } else resolve(_this._resumeReporterSubscriptions(msg, storedObject, reporter, childrens, domainRegistration));\n\n // resolve();\n }).catch(function (reason) {\n log.error('[SyncherManager - resume create] - fail on getDataSchemaDescriptor: ', reason);\n resolve(false);\n });\n });\n }\n }, {\n key: '_resumeReporterSubscriptions',\n value: function _resumeReporterSubscriptions(msg, storedObject, reporter, childrens, domainRegistration) {\n var _this = this;\n var resource = storedObject.url;\n var objectRegistration = (0, _utils.deepClone)(msg.body.value);\n objectRegistration.url = storedObject.url;\n objectRegistration.expires = storedObject.expires;\n objectRegistration.domain_registration = domainRegistration;\n\n delete objectRegistration.data;\n\n return new _promise2.default(function (resolve) {\n\n reporter.addChildrens().then(function () {\n\n reporter.resumeSubscriptions(storedObject.subscriptions);\n\n _this._reporters[resource] = reporter;\n\n log.info('[SyncherManager - resume create] - resolved resumed: ', storedObject);\n\n return _this._decryptChildrens(storedObject, childrens);\n }).then(function (decryptedObject) {\n\n log.info('[SyncherManager._resumeReporterSubscriptions] Register Object: ', objectRegistration);\n _this._registry.registerDataObject(objectRegistration).then(function (registered) {\n log.log('[SyncherManager._resumeReporterSubscriptions] DataObject registration successfully updated', registered);\n log.log('[SyncherManager._resumeReporterSubscriptions] resolving object', decryptedObject);\n resolve(decryptedObject);\n });\n\n // log.log('result of previous promise');\n }).catch(function (reason) {\n log.error('[SyncherManager - resume create] - fail on addChildrens: ', reason);\n resolve(false);\n });\n });\n }\n\n // to decrypt DataChildObjects if they are encrypted\n\n }, {\n key: '_decryptChildrens',\n value: function _decryptChildrens(encryptedObject, childrens) {\n var _this = this;\n\n var storedObject = (0, _utils.deepClone)(encryptedObject);\n return new _promise2.default(function (resolve) {\n\n if (!childrens) {\n resolve(storedObject);\n } else {\n var childrensObj = (0, _keys2.default)(storedObject.childrenObjects);\n\n if (childrensObj.length === 0) {\n resolve(storedObject);\n }\n\n childrens.forEach(function (children) {\n\n // let childObjects = storedObject.childrenObjects[children];\n var childObjects = storedObject.childrenObjects;\n\n log.log('[SyncherManager._decryptChildrens] dataObjectChilds to decrypt ', childObjects);\n\n var listOfDecryptedObjects = [];\n\n (0, _keys2.default)(childObjects).forEach(function (childId) {\n var child = childObjects[childId];\n var owner = childId.split('#')[0];\n\n if (typeof child.value === 'string') {\n\n log.log('[SyncherManager._decryptChildrens] createdBy ', owner, ' object: ', child.value);\n\n var decrypted = cryptoManager.default.decryptDataObject(JSON.parse(child.value), storedObject.url);\n\n listOfDecryptedObjects.push(decrypted);\n }\n });\n\n _promise2.default.all(listOfDecryptedObjects).then(function (decryptedObjects) {\n\n log.log('[SyncherManager._decryptChildrens] returning decrypted ', decryptedObjects);\n\n decryptedObjects.forEach(function (decryptedObject) {\n var childId = decryptedObject.value.url;\n storedObject.childrenObjects[childId].value = decryptedObject.value;\n });\n\n log.log('[SyncherManager._decryptChildrens] storedObject ', storedObject);\n\n resolve(storedObject);\n }).catch(function (reason) {\n log.warn('[SyncherManager._decryptChildrens] failed : ', reason);\n });\n });\n }\n });\n }\n\n // Process invitations to observers\n\n }, {\n key: '_authorise',\n value: function _authorise(msg) {\n var _this = this;\n\n if (!msg.body.resource) {\n throw new Error('[SyncherManager._authorise] invitation request without data object url:', msg);\n }\n\n var objSubscriptorURL = msg.body.resource + '/subscription';\n var p2p = msg.body.p2p ? msg.body.p2p : false;\n\n log.log('[SyncherManager - authorise] - ', msg);\n\n if (msg.body.authorise) {\n msg.body.authorise.forEach(function (hypertyURL) {\n //FLOW-OUT: send invites to list of remote Syncher -> _onRemoteCreate -> onNotification\n\n _this._bus.postMessage({\n type: 'create', from: objSubscriptorURL, to: hypertyURL,\n body: { p2p: p2p, identity: msg.body.identity, source: msg.from, value: msg.body.value, schema: msg.body.schema }\n }, function (reply) {\n // lets forward the invitation response\n var response = {\n from: msg.to,\n to: msg.from,\n id: msg.id,\n type: reply.type,\n body: reply.body\n };\n\n _this._bus.postMessage(response);\n });\n });\n }\n }\n\n //FLOW-IN: message received from DataObjectReporter -> delete\n\n }, {\n key: '_onDelete',\n value: function _onDelete(msg) {\n var _this = this;\n\n var objURL = msg.body.resource;\n\n var object = _this._reporters[objURL];\n if (object) {\n //TODO: is there any policy verification before delete?\n\n if (object.offline) {\n //register new DataObject at Offline Subscription Manager\n var forward = {\n from: msg.to,\n to: object.offline + '/register',\n type: 'forward',\n body: msg\n };\n\n log.log('[SyncherManager._onDelete] unregistering object from offline manager ', forward);\n\n _this._bus.postMessage(forward);\n }\n\n object.delete();\n\n this._dataObjectsStorage.deleteResource(objURL).then(function (result) {\n\n log.log('[SyncherManager - onDelete] - deleteResource: ', result);\n\n _this._registry.unregisterDataObject(objURL);\n\n //TODO: unregister object?\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n });\n });\n }\n }\n\n //FLOW-IN: message received from local Syncher -> subscribe\n\n }, {\n key: '_onLocalSubscribe',\n value: function _onLocalSubscribe(msg) {\n var _this5 = this;\n\n //debugger;\n\n if (msg.body.hasOwnProperty('resume') && msg.body.resume) {\n this._dataObjectsStorage.getResourcesByCriteria(msg, false).then(function (result) {\n\n log.info('[SyncherManager.onLocalSubscribe. resume]: ', msg, ' result: ', result);\n\n if (result && (0, _keys2.default)(result).length > 0) {\n\n var listOfObservers = [];\n\n // TODO: should reuse the stored information\n (0, _keys2.default)(result).forEach(function (objURL) {\n log.log('[SyncherManager - resume Subscribe] - reuse current object url: ', result[objURL]);\n listOfObservers.push(_this5._resumeSubscription(msg, result[objURL]));\n });\n\n _promise2.default.all(listOfObservers).then(function (resumedObservers) {\n log.log('[SyncherManager - Observers Resumed]', resumedObservers);\n\n // TODO: shoud send the information if some object is failing;\n var successfullyResumed = (0, _values2.default)(resumedObservers).filter(function (observer) {\n return observer !== false;\n });\n\n var response = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, value: successfullyResumed }\n };\n\n log.log('[SyncherManager - Observers Resumed] replying ', response);\n\n //FLOW-OUT: message response to Syncher -> create\n _this5._bus.postMessage(response);\n });\n } else {\n //forward to hyperty:\n var reply = {};\n reply.id = msg.id;\n reply.from = msg.to;\n reply.to = msg.from;\n reply.type = 'response';\n reply.body = {\n code: 404,\n desc: 'No data objects observers to be resumed'\n };\n _this5._bus.postMessage(reply);\n }\n });\n } else {\n log.log('[SyncherManager.onLocalSubscribe - new Subscribe] - ', msg.body.schema, msg.body.resource);\n this._newSubscription(msg);\n }\n }\n }, {\n key: '_newSubscription',\n value: function _newSubscription(msg) {\n var _this = this;\n\n var objURL = msg.body.resource;\n\n var hypertyURL = msg.from;\n var domain = (0, _utils.divideURL)(objURL).domain;\n var domainSubscription = msg.body.hasOwnProperty('domain_subscription') ? msg.body.domain_subscription : true;\n\n var childBaseURL = objURL + '/children/';\n\n //get schema from catalogue and parse -> (children)\n _this._catalog.getDataSchemaDescriptor(msg.body.schema).then(function (descriptor) {\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var childrens = properties.children ? properties.children.constant : [];\n\n var subscriptions = [];\n subscriptions.push(objURL + '/changes');\n\n // childrens.forEach((child) => subscriptions.push(childBaseURL + child));\n subscriptions.push(childBaseURL);\n\n //children addresses\n\n if (domainSubscription) {\n //FLOW-OUT: subscribe message to the msg-node, registering listeners on the broker\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { identity: msg.body.identity, resources: subscriptions, source: hypertyURL }\n };\n\n //subscribe in msg-node\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('node-subscribe-response(observer): ', reply);\n console.log('REUSETEST SyncherManager - node-subscribe-response(observer): ', reply);\n if (reply.body.code === 200) {\n _this._newReporterSubscribe(msg, hypertyURL, objURL, childrens);\n } else {\n //listener rejected\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n body: reply.body\n });\n }\n });\n } else _this._newReporterSubscribe(msg, hypertyURL, objURL, childrens);\n });\n }\n }, {\n key: '_newReporterSubscribe',\n value: function _newReporterSubscribe(msg, hypertyURL, objURL, childrens) {\n\n var _this = this;\n\n var objURLSubscription = objURL + '/subscription';\n\n //FLOW-OUT: reply with provisional response\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n body: { code: 100, childrenResources: childrens, schema: msg.body.schema, resource: msg.body.resource }\n });\n\n //FLOW-OUT: subscribe message to remote ReporterObject -> _onRemoteSubscribe\n var objSubscribeMsg = {\n type: 'subscribe', from: _this._url, to: objURLSubscription,\n body: { identity: msg.body.identity, subscriber: hypertyURL }\n };\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual')) objSubscribeMsg.body.mutual = msg.body.mutual;\n log.log('[SyncherManager._newSubscription]', objSubscribeMsg, msg);\n console.log('REUSETEST SyncherManager - [SyncherManager._newSubscription]', objSubscribeMsg, msg);\n //subscribe to reporter SM\n _this._bus.postMessage(objSubscribeMsg, function (reply) {\n log.log('reporter-subscribe-response-new: ', reply);\n console.log('REUSETEST SyncherManager - reporter-subscribe-response-new: ', reply);\n if (reply.body.code === 200) _this._processSuccessfullSubscription(reply, hypertyURL, objURL, childrens, msg);else if (msg.body.offline) _this._processOfflineSubscription(objSubscribeMsg, msg.body.offline, hypertyURL, objURL, childrens, msg);else {\n //TODO: send response back to Hyperty with error message received in the reply\n }\n });\n }\n }, {\n key: '_processOfflineSubscription',\n value: function _processOfflineSubscription(subscription, redirectTo, hypertyURL, objURL, childrens, msg) {\n var _this = this;\n\n var forward = {\n from: subscription.from,\n type: 'forward',\n to: redirectTo,\n body: subscription\n };\n\n console.log('[SyncherManager._processOfflineSubscription] forwading ', forward);\n\n _this._bus.postMessage(forward, function (reply) {\n log.log('[SyncherManager._processOfflineSubscription] reply ', reply);\n if (reply.body.code === 200) _this._processSuccessfullSubscription(reply, hypertyURL, objURL, childrens, msg);else {\n //TODO: send response back to Hyperty with error message received in the reply\n }\n });\n }\n }, {\n key: '_processSuccessfullSubscription',\n value: function _processSuccessfullSubscription(reply, hypertyURL, objURL, childrens, msg) {\n\n var _this = this;\n\n log.log('[SyncherManager._newSubscription] - observers: ', _this._observers, objURL, _this._observers[objURL]);\n console.log('REUSETEST SyncherManager - 200 code[SyncherManager._newSubscription] - observers: ', _this._observers, objURL, _this._observers[objURL]);\n var observer = _this._observers[objURL];\n if (!observer) {\n observer = new _ObserverObject2.default(_this, objURL, childrens);\n log.log('[SyncherManager._newSubscription] - observers: create new ObserverObject: ', observer);\n _this._observers[objURL] = observer;\n\n // register new hyperty subscription\n observer.addSubscription(hypertyURL);\n\n // add childrens and listeners to save data if necessary\n observer.addChildrens();\n }\n\n var interworking = false;\n\n //debugger;\n\n // Store for each reporter hyperty the dataObject\n var userURL = void 0;\n if (msg.body.hasOwnProperty('identity') && msg.body.identity.userProfile && msg.body.identity.userProfile.userURL) {\n userURL = msg.body.identity.userProfile.userURL;\n if (!userURL.includes('user://')) {\n interworking = true;\n }\n } else {\n userURL = _this._registry.getHypertyOwner(msg.from);\n if (!userURL) interworking = true;\n }\n\n var metadata = (0, _utils.deepClone)(reply.body.value);\n\n // let childrenObjects = metadata.childrenObjects || {};\n\n delete metadata.data;\n delete metadata.childrenObjects;\n\n metadata.childrens = childrens;\n metadata.subscriberUser = userURL;\n metadata.isReporter = false;\n metadata.subscriberHyperty = hypertyURL;\n\n if (!interworking) {\n //_this._dataObjectsStorage.set(objURL, false, msg.body.schema, 'on', reply.body.owner, hypertyURL, childrens, userURL);\n _this._dataObjectsStorage.set(metadata);\n if (metadata.hasOwnProperty('store') && metadata.store || metadata.hasOwnProperty('isToSaveData') && metadata.isToSaveData) {\n observer.isToSaveData = true;\n _this._dataObjectsStorage.update(false, objURL, 'isToSaveData', true);\n _this._dataObjectsStorage.saveData(false, objURL, null, reply.body.value.data);\n // if (childrens) _this._dataObjectsStorage.initialObserverSync(objURL, reply.body.value.data.backupRevision);\n }\n }\n\n //forward to hyperty:\n reply.id = msg.id;\n reply.from = _this._url;\n reply.to = hypertyURL;\n reply.body.schema = msg.body.schema;\n reply.body.resource = msg.body.resource;\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual')) reply.body.mutual = msg.body.mutual;\n log.log('[subscribe] - new subscription: ', msg, reply, observer);\n\n this._bus.postMessage(reply);\n }\n }, {\n key: '_resumeSubscription',\n value: function _resumeSubscription(msg, storedObject) {\n var _this6 = this;\n\n return new _promise2.default(function (resolve) {\n\n var objURL = storedObject.url;\n var schema = storedObject.schema;\n\n var hypertyURL = msg.from;\n\n // let objURLSubscription = objURL + '/subscription';\n\n var childBaseURL = objURL + '/children/';\n\n log.log('[SyncherManager - ReuseSubscription] - objURL: ', objURL, ' - schema:', schema);\n\n //get schema from catalogue and parse -> (children)\n // TODO: remove this since children resources should be available in the DataObjectsStorage\n _this6._catalog.getDataSchemaDescriptor(schema).then(function (descriptor) {\n var properties = descriptor.sourcePackage.sourceCode.properties;\n var childrens = properties.children ? properties.children.constant : [];\n\n //children addresses\n var subscriptions = [];\n subscriptions.push(objURL + '/changes');\n // childrens.forEach((child) => subscriptions.push(childBaseURL + child));\n subscriptions.push(childBaseURL);\n\n //FLOW-OUT: reply with provisional response\n _this6._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n body: { code: 100, childrenResources: childrens, schema: schema, resource: objURL }\n });\n\n //FLOW-OUT: subscribe message to remote ReporterObject -> _onRemoteSubscribe\n /*let objSubscribeMsg = {\n type: 'subscribe', from: this._url, to: objURLSubscription,\n body: { subscriber: hypertyURL, identity: msg.body.identity }\n };\n //subscribe to reporter SM\n this._bus.postMessage(objSubscribeMsg, (reply) => {*/\n\n var observer = _this6._observers[objURL];\n if (!observer) {\n observer = new _ObserverObject2.default(_this6, objURL, childrens);\n observer.isToSaveData = storedObject.isToSaveData;\n _this6._observers[objURL] = observer;\n }\n\n //register new hyperty subscription\n observer.addSubscription(hypertyURL);\n observer.addChildrens();\n\n // Object.assign(storedObject.data, reply.body.value.data);\n // Object.assign(storedObject.childrens, reply.body.value.childrens);\n\n //log.log('[subscribe] - resume subscription: ', msg, reply, storedObject, observer);\n\n return _this6._decryptChildrens(storedObject, childrens);\n }).then(function (decryptedObject) {\n // log.log('result of previous promise');\n resolve(decryptedObject);\n }).catch(function (reason) {\n log.error('[SyncherManager - resume subscription] - fail on getDataSchemaDescriptor: ', reason);\n resolve(false);\n });\n });\n }\n\n //FLOW-IN: message received from local DataObjectObserver -> unsubscribe\n\n }, {\n key: '_onLocalUnSubscribe',\n value: function _onLocalUnSubscribe(msg) {\n var _this = this;\n\n var hypertyURL = msg.from;\n var objURL = msg.body.resource;\n\n var observer = _this._observers[objURL];\n if (observer) {\n //TODO: is there any policy verification before delete?\n observer.removeSubscription(msg);\n\n //TODO: destroy object in the registry?\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n });\n\n this._dataObjectsStorage.deleteResource(objURL);\n\n //TODO: remove Object if no more subscription?\n delete _this._observers[objURL];\n }\n }\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n }]);\n return SyncherManager;\n}();\n\nexports.default = SyncherManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1N5bmNoZXJNYW5hZ2VyLmpzPzMzMzciXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4qIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS5cbiogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0XG4qXG4qICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wXG4qXG4qIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3J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ocmVzdW1lZFJlcG9ydGVycykuZmlsdGVyKChyZXBvcnRlcikgPT4ge1xuICAgICAgICAgICAgICAgIHJldHVybiByZXBvcnRlciAhPT0gZmFsc2U7XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIGxvZy5pbmZvKCdbU3luY2hlck1hbmFnZXIub25DcmVhdGVdIHJldHVybmluZyByZXN1bWVkIG9iamVjdHMgOiAnLCBzdWNjZXNzZnVsbHlSZXN1bWVkKTtcblxuICAgICAgICAgICAgICAvL0ZMT1ctT1VUOiBtZXNzYWdlIHJlc3BvbnNlIHRvIFN5bmNoZXIgLT4gY3JlYXRlIHJlc3VtZVxuICAgICAgICAgICAgICB0aGlzLl9idXMucG9zdE1lc3NhZ2Uoe1xuICAgICAgICAgICAgICAgIGlkOiBtc2cuaWQsIHR5cGU6ICdyZXNwb25zZScsIGZyb206IHRvLCB0bzogZnJvbSxcbiAgICAgICAgICAgICAgICBib2R5OiB7IGNvZGU6IDIwMCwgdmFsdWU6IGRlZXBDbG9uZShzdWNjZXNzZnVsbHlSZXN1bWVkKSB9XG4gICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgIC8qc3VjY2Vzc2Z1bGx5UmVzdW1lZC5mb3JFYWNoKChyZXBvcnRlcikgPT4ge1xuICAgICAgICAgICAgICAgIGlmIChyZXBvcnRlci5iYWNrdXApIHtcbiAgICAgICAgICAgICAgICAgIHRoaXMuX2RhdGFPYmplY3RzU3RvcmFnZS5zeW5jKHJlcG9ydGVyLnVybCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICB9KTsqL1xuXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAvL2ZvcndhcmQgdG8gaHlwZXJ0eTpcbiAgICAgICAgICAgIGxldCByZXBseSA9IHt9O1xuICAgICAgICAgICAgcmVwbHkuaWQgPSBtc2cuaWQ7XG4gICAgICAgICAgICByZXBseS5mcm9tID0gb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lciA9IG5ldyBSZXBvcnRlck9iamVjdChfdGhpcywgb3duZXIsIG9iamVjdFJlZ2lzdHJhdGlvbi51cmwsIGNoaWxkcmVucywgb2ZmbGluZSk7XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHJlcG9ydGVyID0gdGhpcy5fcmVwb3J0ZXJzW29iamVjdFJlZ2lzdHJhdGlvbi51cmxdO1xuICAgICAgICAgIH1cblxuICAgICAgICAgIGxvZy5sb2coJ1tTeW5jaGVyTWFuYWdlciAtIG5ldyBDcmVhdGVdIC0gJywgbXNnKTtcblxuICAgICAgICAgIC8vIFN0b3JlIGZvciBlYWNoIHJlcG9ydGVyIGh5cGVydHkgdGhlIGRhdGFPYmplY3RcbiAgICAgICAgICBsZXQgdXNlclVSTDtcbiAgICAgICAgICAvLyBsZXQgaW50ZXJ3b3JraW5nID0gZmFsc2U7XG5cbiAgICAgICAgICBpZiAobXNnLmJvZHkuaGFzT3duUHJvcGVydHkoJ2lkZW50aXR5JykgJiYgbXNnLmJvZHkuaWRlbnRpdHkudXNlclByb2ZpbGUgJiYgbXNnLmJvZHkuaWRlbnRpdHkudXNlclByb2ZpbGUudXNlclVSTCkge1xuICAgICAgICAgICAgdXNlclVSTCA9IG1zZy5ib2R5LmlkZW50aXR5LnVzZXJQcm9maWxlLnVzZXJVUkw7XG5cbiAgICAgICAgICAgIC8vIGlmICghdXNlclVSTC5pbmNsdWRlcygndXNlcjovLycpKSB7XG4gICAgICAgICAgICAvLyAgIGludGVyd29ya2luZyA9IHRydWU7XG4gICAgICAgICAgICAvLyB9XG4gICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIHVzZXJVUkwgPSBfdGhpcy5fcmVnaXN0cnkuZ2V0SHlwZXJ0eU93bmVyKG1zZy5mcm9tKTtcblxuICAgICAgICAgICAgLy8gaWYgKCF1c2VyVVJMKSB7XG4gICAgICAgICAgICAvLyAgIGludGVyd29ya2luZyA9IHRydWU7XG4gICAgICAgICAgICAvLyB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-internal:///540\n")},function(module,exports,__webpack_require__){eval("__webpack_require__(542);\nmodule.exports = __webpack_require__(11).Object.values;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvdmFsdWVzLmpzPzRlNjUiXSwic291cmNlc0NvbnRlbnQiOlsicmVxdWlyZSgnLi4vLi4vbW9kdWxlcy9lczcub2JqZWN0LnZhbHVlcycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi8uLi9tb2R1bGVzL19jb3JlJykuT2JqZWN0LnZhbHVlcztcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9vYmplY3QvdmFsdWVzLmpzXG4vLyBtb2R1bGUgaWQgPSA1NDFcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///541\n")},function(module,exports,__webpack_require__){eval("// https://github.com/tc39/proposal-object-values-entries\nvar $export = __webpack_require__(26);\nvar $values = __webpack_require__(543)(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2VzNy5vYmplY3QudmFsdWVzLmpzPzdkOTMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gaHR0cHM6Ly9naXRodWIuY29tL3RjMzkvcHJvcG9zYWwtb2JqZWN0LXZhbHVlcy1lbnRyaWVzXG52YXIgJGV4cG9ydCA9IHJlcXVpcmUoJy4vX2V4cG9ydCcpO1xudmFyICR2YWx1ZXMgPSByZXF1aXJlKCcuL19vYmplY3QtdG8tYXJyYXknKShmYWxzZSk7XG5cbiRleHBvcnQoJGV4cG9ydC5TLCAnT2JqZWN0Jywge1xuICB2YWx1ZXM6IGZ1bmN0aW9uIHZhbHVlcyhpdCkge1xuICAgIHJldHVybiAkdmFsdWVzKGl0KTtcbiAgfVxufSk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvbW9kdWxlcy9lczcub2JqZWN0LnZhbHVlcy5qc1xuLy8gbW9kdWxlIGlkID0gNTQyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///542\n")},function(module,exports,__webpack_require__){eval("var getKeys = __webpack_require__(68);\nvar toIObject = __webpack_require__(50);\nvar isEnum = __webpack_require__(81).f;\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n while (length > i) if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n } return result;\n };\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL19vYmplY3QtdG8tYXJyYXkuanM/OTliNyJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgZ2V0S2V5cyA9IHJlcXVpcmUoJy4vX29iamVjdC1rZXlzJyk7XG52YXIgdG9JT2JqZWN0ID0gcmVxdWlyZSgnLi9fdG8taW9iamVjdCcpO1xudmFyIGlzRW51bSA9IHJlcXVpcmUoJy4vX29iamVjdC1waWUnKS5mO1xubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiAoaXNFbnRyaWVzKSB7XG4gIHJldHVybiBmdW5jdGlvbiAoaXQpIHtcbiAgICB2YXIgTyA9IHRvSU9iamVjdChpdCk7XG4gICAgdmFyIGtleXMgPSBnZXRLZXlzKE8pO1xuICAgIHZhciBsZW5ndGggPSBrZXlzLmxlbmd0aDtcbiAgICB2YXIgaSA9IDA7XG4gICAgdmFyIHJlc3VsdCA9IFtdO1xuICAgIHZhciBrZXk7XG4gICAgd2hpbGUgKGxlbmd0aCA+IGkpIGlmIChpc0VudW0uY2FsbChPLCBrZXkgPSBrZXlzW2krK10pKSB7XG4gICAgICByZXN1bHQucHVzaChpc0VudHJpZXMgPyBba2V5LCBPW2tleV1dIDogT1trZXldKTtcbiAgICB9IHJldHVybiByZXN1bHQ7XG4gIH07XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvX29iamVjdC10by1hcnJheS5qc1xuLy8gbW9kdWxlIGlkID0gNTQzXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///543\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _keys = __webpack_require__(16);\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Subscription = __webpack_require__(224);\n\nvar _Subscription2 = _interopRequireDefault(_Subscription);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar cryptoManager = _interopRequireWildcard(_CryptoManager);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('ReporterObject'); // Log System\n\nvar ReporterObject = function () {\n function ReporterObject(parent, owner, url, childrens, offline) {\n (0, _classCallCheck3.default)(this, ReporterObject);\n\n var _this = this;\n\n _this._parent = parent;\n _this._owner = owner;\n _this._url = url;\n\n _this._bus = parent._bus;\n\n _this._domain = (0, _utils.divideURL)(url).domain;\n _this._objSubscriptorURL = _this._url + '/subscription';\n\n _this._subscriptions = {};\n _this._childrens = childrens;\n _this._childrenListeners = [];\n\n _this._forwards = {};\n\n _this._isToSaveData = false;\n\n _this._allocateListeners();\n\n _this._offline = offline ? offline : false;\n }\n\n (0, _createClass3.default)(ReporterObject, [{\n key: '_allocateListeners',\n value: function _allocateListeners() {\n var _this2 = this;\n\n var _this = this;\n\n //add subscription listener...\n _this._subscriptionListener = _this._bus.addListener(_this._objSubscriptorURL, function (msg) {\n log.info('[SyncherManager.ReporterObject received ]', msg);\n switch (msg.type) {\n case 'subscribe':\n _this._onRemoteSubscribe(msg);break;\n case 'unsubscribe':\n _this._onRemoteUnSubscribe(msg);break;\n case 'response':\n _this._onRemoteResponse(msg);break;\n case 'forward':\n _this._onForwardedRemoteSubscribe(msg);break;\n }\n });\n\n var changeURL = _this._url + '/changes';\n _this._changeListener = _this._bus.addListener(changeURL, function (msg) {\n\n log.info('[SyncherManager.ReporterObject ] SyncherManager-' + changeURL + '-RCV: ', msg);\n\n //do not save changes to backupRevision to avoid infinite loops\n if (_this2._isToSaveData && msg.body.attribute) {\n var updateRuntimeStatus = msg.body.attribute !== 'backupRevision' ? true : false;\n log.log('[SyncherManager.ReporterObject ] SyncherManager - save data: ', msg);\n _this._parent._dataObjectsStorage.update(true, _this._url, 'version', msg.body.version, updateRuntimeStatus);\n _this._parent._dataObjectsStorage.update(true, _this._url, 'lastModified', msg.body.lastModified, updateRuntimeStatus);\n _this._parent._dataObjectsStorage.saveData(true, _this._url, msg.body.attribute, msg.body.value, updateRuntimeStatus);\n }\n });\n }\n }, {\n key: '_onForwardedRemoteSubscribe',\n\n\n // To handle subscriptions sent while the reporter was offline ie forwarded by a Offline Subscription Manager service\n\n value: function _onForwardedRemoteSubscribe(msg) {\n this._onRemoteSubscribe(msg.body);\n }\n }, {\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._subscriptionListener.remove();\n\n _this._changeListener.remove();\n\n _this._childrenListeners.forEach(function (cl) {\n cl.remove();\n });\n\n (0, _keys2.default)(_this._forwards).forEach(function (key) {\n _this.forwardUnSubscribe(key);\n });\n\n //remove all subscriptions\n (0, _keys2.default)(_this._subscriptions).forEach(function (key) {\n _this._subscriptions[key]._releaseListeners();\n });\n }\n }, {\n key: 'resumeSubscriptions',\n value: function resumeSubscriptions(subscriptions) {\n var _this = this;\n\n if (!subscriptions) return;\n\n (0, _keys2.default)(subscriptions).forEach(function (key) {\n var hypertyURL = subscriptions[key];\n\n log.log('[SyncherManager.ReporterObject] - resume subscriptions', _this, hypertyURL, _this._childrens);\n\n if (!_this._subscriptions[hypertyURL]) {\n _this._subscriptions[hypertyURL] = new _Subscription2.default(_this._bus, _this._owner, _this._url, true);\n }\n });\n }\n\n /**\n * Register a listener in the msg-node and in the local MessageBus, so that messages on this address are forwarded to the reporter object\n * @param {string} address - URL to register the listeners\n * @return {Promise} Return Promise OK or error\n */\n\n }, {\n key: 'forwardSubscribe',\n value: function forwardSubscribe(addresses) {\n var _this = this;\n\n //FLOW-OUT: message sent to the msg-node SubscriptionManager component\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._parent._url, to: 'domain://msg-node.' + _this._domain + '/sm',\n body: { resources: addresses, source: _this._owner }\n };\n\n return new _promise2.default(function (resolve, reject) {\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('[SyncherManager.ReporterObject ]forward-subscribe-response(reporter): ', reply);\n if (reply.body.code === 200) {\n var newForward = _this._bus.addForward(_this._url, _this._owner);\n _this._forwards[addresses[0]] = newForward;\n resolve();\n } else {\n reject('Error on msg-node subscription: ' + reply.body.desc);\n }\n });\n });\n }\n\n /**\n * UnRegister a listener in the msg-node and in the local MessageBus, so that messages on this address are removed from forward\n * @param {string} address - URL to un-register the listeners\n */\n\n }, {\n key: 'forwardUnSubscribe',\n value: function forwardUnSubscribe(address) {\n var _this = this;\n\n _this._forwards[address].remove();\n delete _this._forwards[address];\n\n //FLOW-OUT: message sent to the msg-node SubscriptionManager component\n var nodeUnSubscribeMsg = {\n type: 'unsubscribe', from: _this._parent._url, to: 'domain://msg-node.' + _this._domain + '/sm',\n body: { resources: [address], source: _this._owner }\n };\n\n _this._bus.postMessage(nodeUnSubscribeMsg);\n }\n\n /**\n * Register listeners for a list of childrens. Public channels used to transmit messages.\n * @param {string[]} childrens - channels to register\n * @return {Promise} Return Promise OK or error\n */\n\n }, {\n key: 'addChildrens',\n value: function addChildrens() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (_this._childrens.length === 0) {\n resolve();\n return;\n }\n\n var childBaseURL = _this._url + '/children/';\n log.log('[SyncherManager.ReporterObject - addChildrens] - childrens: ', childBaseURL);\n\n /* childrens.forEach((child) => {\n _this._childrens.push(child);\n });*/\n\n /*\n _this._childrens.forEach((child) => {\n let childId = childBaseURL + child;\n let selfForward = _this._bus.addForward(childId, owner);\n _this._childrenListeners.push(selfForward);\n });*/\n\n var subscriptions = [];\n // childrens.forEach((child) => subscriptions.push(childBaseURL + child));\n subscriptions.push(childBaseURL);\n\n //_this._storageSubscriptions[_this._objSubscriptorURL] = {url: _this._url, owner: _this._owner, childrens: _this._childrens};\n\n //FLOW-OUT: message sent to the msg-node SubscriptionManager component\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._parent._url, to: 'domain://msg-node.' + _this._domain + '/sm',\n body: { resources: subscriptions, source: _this._owner }\n };\n\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('[SyncherManager.ReporterObject ]node-subscribe-response(reporter):', reply);\n if (reply.body.code === 200) {\n\n //add children listeners on local ...\n subscriptions.forEach(function (childURL) {\n var childListener = _this._bus.addListener(childURL, function (msg) {\n //TODO: what todo here? Save childrens?\n log.log('[SyncherManager.ReporterObject received]', msg);\n\n if (msg.type === 'create' && msg.to.includes('children') && _this3._isToSaveData) {\n\n // if the value is not encrypted lets encrypt it\n // todo: should be subject to some policy\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n if (!msg.body.hasOwnProperty('mutual')) msg.body.mutual = true;\n\n //remove false when mutualAuthentication is enabled\n if (!(typeof msg.body.value === 'string') && msg.body.mutual) {\n\n log.log('[SyncherManager.ReporterObject] encrypting received data ', msg.body.value);\n\n cryptoManager.default.encryptDataObject(msg.body.value, url).then(function (encryptedValue) {\n log.log('[SyncherManager.ReporterObject] encrypted data ', encryptedValue);\n\n _this._storeChildObject(msg, (0, _stringify2.default)(encryptedValue));\n }).catch(function (reason) {\n log.warn('[SyncherManager._decryptChildrens] failed : ', reason, ' Storing unencrypted');\n _this._storeChildObject(msg, msg.body.value);\n });\n } else {\n _this._storeChildObject(msg, msg.body.value);\n }\n }\n });\n _this._childrenListeners.push(childListener);\n\n var selfForward = _this._bus.addForward(childURL, _this._owner);\n _this._childrenListeners.push(selfForward);\n });\n\n resolve();\n } else {\n reject('Error on msg-node subscription: ' + reply.body.desc);\n }\n });\n });\n }\n\n // store childObject\n\n }, {\n key: '_storeChildObject',\n value: function _storeChildObject(msg, data) {\n var _this = this;\n\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n var resource = splitedReporterURL.resource;\n var value = void 0;\n\n /* if (msg.body.identity) {\n value.identity = msg.body.identity;\n delete value.identity.assertion;\n delete value.identity.expires;\n }*/\n\n var objectURLResource = msg.body.resource;\n var attribute = resource;\n\n if (objectURLResource === 'heartbeat') value = data;else value = {\n identity: msg.body.identity,\n value: data\n };\n\n // if (objectURLResource) attribute += '.' + objectURLResource;\n if (objectURLResource) attribute = objectURLResource;\n\n // this identity data is not needed to be stored\n\n\n console.log('[SyncherManager.ReporterObject._storeChildObject] : ', url, attribute, value);\n\n _this._parent._dataObjectsStorage.saveChildrens(true, url, attribute, value);\n }\n }, {\n key: 'delete',\n value: function _delete() {\n var _this = this;\n var domain = (0, _utils.divideURL)(_this._owner).domain;\n\n //FLOW-OUT: message sent directly to all subscribers of the reporter\n _this._bus.postMessage({\n type: 'delete', from: _this._objSubscriptorURL, to: _this._url + '/changes'\n });\n\n //FLOW-OUT: message sent to the msg-node ObjectAllocationManager component\n _this._bus.postMessage({\n type: 'delete', from: _this._parent._url, to: 'domain://msg-node.' + domain + '/object-address-allocation',\n body: { resource: _this._url, childrenResources: _this._childrens }\n });\n\n _this._releaseListeners();\n delete _this._parent._reporters[_this._url];\n }\n }, {\n key: '_onRemoteResponse',\n value: function _onRemoteResponse(msg) {\n var _this = this;\n\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: _this._url,\n body: { code: msg.body.code, identity: msg.body.identity, source: msg.from }\n });\n }\n\n //FLOW-IN: message received from Syncher -> subscribe\n\n }, {\n key: '_onRemoteSubscribe',\n value: function _onRemoteSubscribe(msg) {\n var _this = this;\n var hypertyURL = msg.body.subscriber;\n\n //validate if subscription already exists?\n if (_this._subscriptions[hypertyURL]) {\n // let errorMsg = {\n // id: msg.id, type: 'response', from: msg.to, to: hypertyURL,\n // body: { code: 500, desc: 'Subscription for (' + _this._url + ' : ' + hypertyURL + ') already exists!' }\n // };\n //\n // _this._bus.postMessage(errorMsg);\n // return;\n\n // new version because of reusage\n _this._subscriptions[hypertyURL]._releaseListeners();\n }\n\n //ask to subscribe to Syncher? (depends on the operation mode)\n //TODO: get mode from object!\n var mode = 'sub/pub';\n\n if (mode === 'sub/pub') {\n //FLOW-OUT: message sent to local hyperty address Syncher -> _onForward\n var forwardMsg = {\n type: 'forward', from: _this._url, to: _this._owner,\n body: { type: msg.type, from: hypertyURL, to: _this._url, identity: msg.body.identity }\n };\n\n //TODO: For Further Study\n if (msg.body.hasOwnProperty('mutual')) forwardMsg.body.mutual = msg.body.mutual;\n\n _this._bus.postMessage(forwardMsg, function (reply) {\n log.log('[SyncherManager.ReporterObject ]forward-reply: ', reply);\n if (reply.body.code === 200) {\n if (!_this._subscriptions[hypertyURL]) {\n log.log('[SyncherManager.ReporterObject] - _onRemoteSubscribe:', _this._childrens);\n _this._subscriptions[hypertyURL] = new _Subscription2.default(_this._bus, _this._owner, _this._url, true);\n }\n }\n\n // Store for each reporter hyperty the dataObject\n var userURL = void 0;\n if (msg.body.identity && msg.body.identity.userProfile.userURL) {\n userURL = msg.body.identity.userProfile.userURL;\n _this._parent._dataObjectsStorage.update(true, _this._url, 'subscriberUsers', userURL);\n }\n\n //TODO: mutual and sessionkeys updates were removed. FFS\n\n /* if (msg.body.hasOwnProperty('mutual')) {\n // _this._parent._identityModule.updateIsToEncryptForDataObjectSessionKey(_this._url, msg.body.mutual).then(()=>{\n _this._parent._dataObjectsStorage.update(true, _this._url, 'mutual', msg.body.mutual);\n // });\n }*/\n\n _this._parent._dataObjectsStorage.update(true, _this._url, 'subscriptions', hypertyURL);\n\n reply.body.owner = _this._owner;\n\n //FLOW-OUT: subscription response sent (forward from internal Hyperty)\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: reply.body\n });\n });\n }\n }\n\n //FLOW-IN: message received from remote ObserverObject -> removeSubscription\n\n }, {\n key: '_onRemoteUnSubscribe',\n value: function _onRemoteUnSubscribe(msg) {\n var _this = this;\n var unsubscriber = msg.body.source;\n\n var subscription = _this._subscriptions[unsubscriber];\n if (subscription) {\n subscription._releaseListeners();\n delete _this._subscriptions[unsubscriber];\n\n var forwardMsg = {\n type: 'forward', from: _this._url, to: _this._owner,\n body: { type: msg.type, from: unsubscriber, to: _this._url, identity: msg.body.identity }\n };\n\n _this._bus.postMessage(forwardMsg);\n }\n }\n }, {\n key: 'offline',\n get: function get() {\n return this._offline;\n }\n }, {\n key: 'isToSaveData',\n set: function set(value) {\n this._isToSaveData = value;\n }\n }]);\n return ReporterObject;\n}();\n\nexports.default = ReporterObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL1JlcG9ydGVyT2JqZWN0LmpzP2M3Y2IiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdSZXBvcnRlck9iamVjdCcpO1xuXG5pbX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gICAgICAgICAgICAgICAgIGxvZy5sb2coJ1tTeW5jaGVyTWFuYWdlci5SZXBvcnRlck9iamVjdF0gZW5jcnlwdGVkIGRhdGEgJywgIGVuY3J5cHRlZFZhbHVlKTtcblxuICAgICAgICAgICAgICAgICAgICBfdGhpcy5fc3RvcmVDaGlsZE9iamVjdChtc2csIEpTT04uc3RyaW5naWZ5KGVuY3J5cHRlZFZhbHVlKSk7XG4gICAgICAgICAgICAgICAgICB9KS5jYXRjaCgocmVhc29uKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIGxvZy53YXJuKCdbU3luY2hlck1hbmFnZXIuX2RlY3J5cHRDaGlsZHJlbnNdIGZhaWxlZCA6ICcsIHJlYXNvbiwgJyBTdG9yaW5nIHVuZW5jcnlwdGVkJyk7XG4gICAgICAgICAgICAgICAgICAgIF90aGlzLl9zdG9yZUNoaWxkT2JqZWN0KG1zZywgbXNnLmJvZHkudmFsdWUpO1xuICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgIF90aGlzLl9zdG9yZUNoaWxkT2JqZWN0KG1zZywgbXNnLmJvZHkudmFsdWUpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIF90aGlzLl9jaGlsZHJlbkxpc3RlbmVycy5wdXNoKGNoaWxkTGlzdGVuZXIpO1xuXG4gICAgICAgICAgICBsZXQgc2VsZkZvcndhcmQgPSBfdGhpcy5fYnVzLmFkZEZvcndhcmQoY2hpbGRVUkwsIF90aGlzLl9vd25lcik7XG4gICAgICAgICAgICBfdGhpcy5fY2hpbGRyZW5MaXN0ZW5lcnMucHVzaChzZWxmRm9yd2FyZCk7XG4gICAgICAgICAgfSk7XG5cbiAgICAgICAgICByZXNvbHZlKCk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgcmVqZWN0KCdFcnJvciBvbiBtc2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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7O0FBTUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBS0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUNBO0FBS0E7QUFDQTtBQUVBOzs7QUFoWUE7QUFDQTtBQUNBOzs7QUFnQ0E7QUFDQTtBQUNBOzs7OztBQWdXQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///544\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Subscription = __webpack_require__(224);\n\nvar _Subscription2 = _interopRequireDefault(_Subscription);\n\nvar _CryptoManager = __webpack_require__(105);\n\nvar cryptoManager = _interopRequireWildcard(_CryptoManager);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('ObserverObject'); // Log System\n\nvar ObserverObject = function () {\n function ObserverObject(parent, url, childrens) {\n var _this2 = this;\n\n (0, _classCallCheck3.default)(this, ObserverObject);\n\n var _this = this;\n\n _this._parent = parent;\n _this._url = url;\n _this._childrens = childrens;\n\n _this._bus = parent._bus;\n\n _this._subscriptions = {};\n _this._storageSubscriptions = {};\n _this._childrenListeners = [];\n\n this._isToSaveData = false;\n\n var changeURL = _this._url + '/changes';\n _this._changeListener = _this._bus.addListener(changeURL, function (msg) {\n\n log.log('[SyncherManager.ObserverObject ] SyncherManager-' + changeURL + '-RCV: ', msg);\n\n //TODO: what todo here? Save changes?\n if (_this2._isToSaveData && msg.body.attribute) {\n log.log('[SyncherManager.ObserverObject ] SyncherManager - save data: ', msg);\n _this._parent._dataObjectsStorage.update(false, _this._url, 'version', msg.body.version);\n _this._parent._dataObjectsStorage.update(false, _this._url, 'lastModified', msg.body.lastModified);\n _this._parent._dataObjectsStorage.saveData(false, _this._url, msg.body.attribute, msg.body.value);\n }\n });\n }\n\n (0, _createClass3.default)(ObserverObject, [{\n key: '_newSubscription',\n value: function _newSubscription(hyperty) {\n var _this = this;\n\n var subscription = _this._subscriptions[hyperty];\n log.log('[Observer Object - new subscription] - ', _this._subscriptions, hyperty, _this._subscriptions.hasOwnProperty(hyperty));\n if (!subscription) {\n _this._subscriptions[hyperty] = new _Subscription2.default(_this._bus, hyperty, _this._url, false);\n }\n }\n }, {\n key: 'addSubscription',\n value: function addSubscription(hyperty) {\n var _this = this;\n\n _this._newSubscription(hyperty);\n }\n }, {\n key: 'addChildrens',\n value: function addChildrens() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n if (_this._childrens.length === 0) {\n resolve();\n return;\n }\n\n var childBaseURL = _this._url + '/children/';\n log.log('[SyncherManager.ObserverObject - addChildrens] - childrens: ', childBaseURL);\n\n // childrens.forEach((child) => {\n\n var childListener = _this._bus.addListener(childBaseURL, function (msg) {\n //TODO: what todo here? Save childrens?\n log.log('[SyncherManager.ObserverObject received]', msg);\n\n if (msg.type === 'create' && msg.to.includes('children') && _this3._isToSaveData) {\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n if (!msg.body.hasOwnProperty('mutual')) msg.body.mutual = true;\n\n //remove false when mutualAuthentication is enabled\n if (!(typeof msg.body.value === 'string') && msg.body.mutual) {\n\n log.log('[SyncherManager.ObserverObject] encrypting received data ', msg.body.value);\n\n cryptoManager.default.encryptDataObject(msg.body.value, url).then(function (encryptedValue) {\n log.log('[SyncherManager.ObserverObject] encrypted data ', encryptedValue);\n\n _this._storeChildObject(msg, (0, _stringify2.default)(encryptedValue));\n }).catch(function (reason) {\n log.warn('[SyncherManager.ObserverObject._encryptChild] failed, storing unencrypted ', reason);\n _this._storeChildObject(msg, msg.body.value);\n });\n } else {\n _this._storeChildObject(msg, msg.body.value);\n }\n }\n\n log.log('[SyncherManager.ObserverObject children Listeners]', _this._childrenListeners, childListener);\n if (_this._childrenListeners.indexOf(childListener) === -1) {\n _this._childrenListeners.push(childListener);\n }\n });\n });\n\n // });\n }\n\n // store childObject\n\n }, {\n key: '_storeChildObject',\n value: function _storeChildObject(msg, data) {\n var _this = this;\n\n var splitedReporterURL = (0, _utils.splitObjectURL)(msg.to);\n\n var url = splitedReporterURL.url;\n\n var resource = splitedReporterURL.resource;\n var value = {};\n\n /* let value = {\n identity: msg.body.identity,\n value: data\n };*/\n\n // this identity data is not needed to be stored\n /* delete value.identity.assertion;\n delete value.identity.expires;*/\n\n var objectURLResource = msg.body.resource;\n var attribute = resource;\n\n if (objectURLResource === 'heartbeat') {\n value = data;\n } else {\n value.identity = msg.body.identity;\n value.value = data;\n }\n\n // if (objectURLResource) attribute += '.' + objectURLResource;\n if (objectURLResource) attribute = objectURLResource;\n\n log.log('[SyncherManager.ObserverObject._storeChildObject] : ', url, attribute, value);\n\n _this._parent._dataObjectsStorage.saveChildrens(false, url, attribute, value);\n }\n }, {\n key: 'removeSubscription',\n value: function removeSubscription(msg) {\n var _this = this;\n\n var hyperty = msg.from;\n\n var domain = (0, _utils.divideURL)(hyperty).domain;\n var objURLSubscription = _this._url + '/subscription';\n\n var subscription = _this._subscriptions[hyperty];\n if (subscription) {\n //FLOW-OUT: message sent to remote ReporterObject -> _onRemoteUnSubscribe\n _this._bus.postMessage({\n type: 'unsubscribe', from: _this._parent._url, to: objURLSubscription,\n body: { source: hyperty, identity: msg.body.identity }\n });\n\n //TODO: should I wait for response before unsubscribe on msg-node\n //FLOW-OUT: message sent to msg-node SubscriptionManager component\n _this._bus.postMessage({\n type: 'unsubscribe', from: _this._parent._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { resource: _this._url, resources: [_this._url + '/children/'] }\n });\n\n subscription._releaseListeners();\n delete _this._subscriptions[hyperty];\n }\n }\n }, {\n key: 'isToSaveData',\n set: function set(value) {\n this._isToSaveData = value;\n }\n }]);\n return ObserverObject;\n}();\n\nexports.default = ObserverObject;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zeW5jaGVyL09ic2VydmVyT2JqZWN0LmpzPzFiNTUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPS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NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7OztBQUtBO0FBQ0E7OztBQUdBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTs7O0FBNUlBO0FBQ0E7QUFDQTs7Ozs7QUE4SUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///545\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _values = __webpack_require__(223);\n\nvar _values2 = _interopRequireDefault(_values);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _utils = __webpack_require__(6);\n\nvar _Subscription = __webpack_require__(547);\n\nvar _Subscription2 = _interopRequireDefault(_Subscription);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('SubscriptionManager'); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n// Log System\n\n/**\n * @author paulo-g-chainho@alticelabs.com\n * Subscription Manager used to manage routing paths at the runtime.\n */\n\nvar SubscriptionManager = function () {\n function SubscriptionManager(runtimeURL, bus, storage) {\n (0, _classCallCheck3.default)(this, SubscriptionManager);\n\n if (!runtimeURL) throw new Error('[SubscriptionManager] - needs the runtimeURL parameter');\n if (!bus) throw new Error('[SubscriptionManager] - needs the MessageBus instance');\n\n var _this = this;\n\n _this._bus = bus;\n _this._storage = storage;\n\n _this._subscriptions = {};\n\n _this._subscriptionsStorage = {};\n\n //TODO: these should be saved in persistence engine?\n _this.runtimeURL = runtimeURL;\n _this._url = runtimeURL + '/subscriptions';\n\n //TODO: this should not be hardcoded!\n _this._domain = (0, _utils.divideURL)(runtimeURL).domain;\n\n bus.addListener(_this._url, function (msg) {\n log.info('[SubscriptionManager] RCV: ', msg);\n switch (msg.type) {\n case 'subscribe':\n _this._onSubscribe(msg);break;\n case 'unsubscribe':\n _this._onUnSubscribe(msg);break;\n case 'read':\n _this._onRead(msg);break;\n }\n });\n }\n\n (0, _createClass3.default)(SubscriptionManager, [{\n key: 'init',\n value: function init() {\n var _this = this;\n\n return new _promise2.default(function (resolve) {\n\n _this._storage.get('subscriptions').then(function (subscriptions) {\n log.log('[SubscriptionManager.init] resume subscriptions: ', subscriptions);\n if (subscriptions) {\n\n _this._subscriptionsStorage = subscriptions;\n\n (0, _values2.default)(subscriptions).forEach(function (subscription) {\n _this.createSubscription(subscription.domain, subscription.resources, subscription.subscriber, subscription.identity);\n });\n }\n resolve();\n });\n });\n }\n }, {\n key: '_onSubscribe',\n\n\n //message received to set a routing path\n value: function _onSubscribe(msg) {\n\n var _this = this;\n\n var resources = msg.body.resources;\n\n var subscriber = msg.from;\n var domain = (0, _utils.divideURL)(resources[0]).domain; //we are assuming resources are all from the same domain\n\n var identity = msg.body.identity;\n\n _this.createSubscription(domain, resources, subscriber, identity).then(function (reply) {\n //forward to hyperty:\n reply.id = msg.id;\n reply.from = _this._url;\n reply.to = subscriber;\n reply.body = msg.body;\n reply.body.code = 200;\n\n log.log('[SubscriptionManager] - craeteSubscription: ', msg, reply, subscriber);\n\n _this._bus.postMessage(reply);\n\n if (!_this._subscriptionsStorage[subscriber]) {\n\n _this._subscriptionsStorage[subscriber] = {\n domain: domain,\n resources: resources,\n subscriber: subscriber,\n identity: identity\n };\n } else {\n resources.forEach(function (resource) {\n if (!_this._subscriptionsStorage[subscriber].resources.includes(resource)) {\n _this._subscriptionsStorage[subscriber].resources.push(resource);\n }\n });\n }\n\n _this._storage.set('subscriptions', 1, _this._subscriptionsStorage);\n });\n }\n }, {\n key: 'createSubscription',\n value: function createSubscription(domain, resources, subscriber, identity) {\n\n var _this = this;\n //debugger;\n return new _promise2.default(function (resolve) {\n //FLOW-OUT: subscribe message to the msg-node, registering listeners on the broker\n\n var nodeSubscribeMsg = {\n type: 'subscribe', from: _this._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { identity: identity, resources: resources, source: subscriber }\n };\n\n //subscribe in msg-node\n _this._bus.postMessage(nodeSubscribeMsg, function (reply) {\n log.log('[SubscriptionManager] node-subscribe-response: ', reply);\n\n //if (reply.body.code === 200) {//TODO: uncomment when MN replies with correct response body code\n\n //TODO: support multiple routes for multiple resources\n\n var subscription = _this._subscriptions[subscriber];\n log.log('[SubscriptionManager] - ', _this._subscriptions, resources, _this._subscriptions.hasOwnProperty(subscriber));\n if (!subscription) {\n _this._subscriptions[subscriber] = {};\n }\n\n resources.forEach(function (resource) {\n _this._subscriptions[subscriber][resource] = new _Subscription2.default(_this._bus, subscriber, resource);\n });\n\n resolve(reply);\n });\n });\n }\n\n // message received to remove routing path\n\n }, {\n key: '_onUnSubscribe',\n value: function _onUnSubscribe(msg) {\n var _this = this;\n\n var unsubscriber = msg.from;\n var resource = msg.body.resource;\n\n if (_this._subscriptions[unsubscriber] && _this._subscriptions[unsubscriber][resource]) {\n var domain = (0, _utils.divideURL)(resource).domain;\n var subscription = _this._subscriptions[unsubscriber][resource];\n\n //FLOW-OUT: message sent to msg-node SubscriptionManager component\n _this._bus.postMessage({\n type: 'unsubscribe', from: _this._url, to: 'domain://msg-node.' + domain + '/sm',\n body: { resources: [resource], source: unsubscriber }\n });\n\n subscription._releaseListeners();\n delete _this._subscriptions[unsubscriber][resource];\n\n if (_this._subscriptionsStorage[unsubscriber]) {\n var i = _this._subscriptionsStorage[unsubscriber].resources.indexOf(resource);\n if (i != -1) {\n _this._subscriptionsStorage[unsubscriber].resources.splice(i, 1);\n }\n _this._storage.set('subscriptions', 1, _this._subscriptionsStorage);\n }\n }\n\n _this._bus.postMessage({\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200 }\n });\n }\n\n //message received to read existing routing paths. At this point limited to read all existing routing paths set for one listener\n\n }, {\n key: '_onRead',\n value: function _onRead(msg) {\n\n var _this = this;\n\n var listenerAddress = msg.body.resource;\n var reply = void 0;\n\n log.log('[SubscriptionManager] - request to read Subscriptions: ', msg);\n\n _this._storage.get('subscriptions').then(function (subscriptions) {\n if (subscriptions && subscriptions[listenerAddress]) {\n var resources = subscriptions[listenerAddress].resources;\n\n reply = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 200, value: resources }\n };\n } else {\n reply = {\n id: msg.id, type: 'response', from: msg.to, to: msg.from,\n body: { code: 404, description: 'Not Found' }\n };\n }\n _this._bus.postMessage(reply);\n });\n }\n }, {\n key: 'url',\n get: function get() {\n return this._url;\n }\n }]);\n return SubscriptionManager;\n}();\n\nexports.default = SubscriptionManager;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zdWJzY3JpcHRpb25NYW5hZ2VyL1N1YnNjcmlwdGlvbk1hbmFnZXIuanM/ZGE4MiJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4qIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4qIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuKiBDb3B5cmlnaHQgMjAxNi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O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTs7O0FBQUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBQ0E7QUFJQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUtBO0FBQ0E7QUFDQTtBQUNBOzs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUZBO0FBS0E7QUFDQTtBQUNBO0FBQ0E7QUFGQTtBQUlBO0FBQ0E7QUFDQTtBQUNBOzs7QUF2SkE7QUFBQTtBQUFBOzs7OztBQTBKQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///546\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('Subscription'); // Log System\n\nvar Subscription = function () {\n function Subscription(bus, subscriber, resource) {\n (0, _classCallCheck3.default)(this, Subscription);\n\n var _this = this;\n _this._subscriber = subscriber;\n _this.resource = resource;\n\n log.log('[SubscriptionManager.Subscription] new: ', subscriber, resource);\n\n //add forward\n _this._listener = bus.addForward(resource, subscriber);\n }\n\n (0, _createClass3.default)(Subscription, [{\n key: '_releaseListeners',\n value: function _releaseListeners() {\n var _this = this;\n\n _this._listener.remove();\n }\n }]);\n return Subscription;\n}();\n\nexports.default = Subscription;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9zdWJzY3JpcHRpb25NYW5hZ2VyL1N1YnNjcmlwdGlvbi5qcz85NDk1Il0sInNvdXJjZXNDb250ZW50IjpbIi8vIExvZyBTeXN0ZW1cbmltcG9ydCAqIGFzIGxvZ2dlciBmcm9tICdsb2dsZXZlbCc7XG5sZXQgbG9nID0gbG9nZ2VyLmdldExvZ2dlcignU3Vic2NyaXB0aW9uJyk7XG5cbmNsYXNzIFN1YnNjcmlwdGlvbiB7XG5cbiAgY29uc3RydWN0b3IoYnVzLCBzdWJzY3JpYmVyLCByZXNvdXJjZSkge1xuICAgIGxldCBfdGhpcyA9IHRoaXM7XG4gICAgX3RoaXMuX3N1YnNjcmliZXIgPSBzdWJzY3JpYmVyO1xuICAgIF90aGlzLnJlc291cmNlID0gcmVzb3VyY2U7XG5cbiAgICBsb2cubG9nKCdbU3Vic2NyaXB0aW9uTWFuYWdlci5TdWJzY3JpcHRpb25dIG5ldzogJywgc3Vic2NyaWJlciwgcmVzb3VyY2UpXG5cbiAgICAvL2FkZCBmb3J3YXJkXG4gICAgX3RoaXMuX2xpc3RlbmVyID0gYnVzLmFkZEZvcndhcmQocmVzb3VyY2UsIHN1YnNjcmliZXIpO1xuXG4gIH1cblxuICBfcmVsZWFzZUxpc3RlbmVycygpIHtcbiAgICBsZXQgX3RoaXMgPSB0aGlzO1xuXG4gICAgX3RoaXMuX2xpc3RlbmVyLnJlbW92ZSgpO1xuXG4gIH1cblxufVxuXG5leHBvcnQgZGVmYXVsdCBTdWJzY3JpcHRpb247XG5cblxuXG4vLyBXRUJQQUNLIEZPT1RFUiAvL1xuLy8gc3JjL3N1YnNjcmlwdGlvbk1hbmFnZXIvU3Vic2NyaXB0aW9uLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7OztBQUNBO0FBQ0E7QUFEQTtBQUNBOzs7OztBQUFBO0FBQ0E7QUFDQTtBQUVBO0FBQUE7QUFDQTtBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBOzs7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUVBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///547\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _AllowOverrides = __webpack_require__(218);\n\nvar _AllowOverrides2 = _interopRequireDefault(_AllowOverrides);\n\nvar _BlockOverrides = __webpack_require__(219);\n\nvar _BlockOverrides2 = _interopRequireDefault(_BlockOverrides);\n\nvar _utils = __webpack_require__(6);\n\nvar _FirstApplicable = __webpack_require__(220);\n\nvar _FirstApplicable2 = _interopRequireDefault(_FirstApplicable);\n\nvar _ReThinkCtx2 = __webpack_require__(549);\n\nvar _ReThinkCtx3 = _interopRequireDefault(_ReThinkCtx2);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('PEP');\n\nvar RuntimeCoreCtx = function (_ReThinkCtx) {\n (0, _inherits3.default)(RuntimeCoreCtx, _ReThinkCtx);\n\n function RuntimeCoreCtx(runtimeURL, idModule, runtimeRegistry, storageManager, runtimeCapabilities) {\n (0, _classCallCheck3.default)(this, RuntimeCoreCtx);\n\n var _this2 = (0, _possibleConstructorReturn3.default)(this, (RuntimeCoreCtx.__proto__ || (0, _getPrototypeOf2.default)(RuntimeCoreCtx)).call(this));\n\n _this2._runtimeURL = runtimeURL;\n _this2._pepURL = _this2._runtimeURL + '/pep';\n _this2._guiURL = _this2._runtimeURL + '/policy-gui';\n _this2.idModule = idModule;\n _this2.runtimeRegistry = runtimeRegistry;\n _this2.activeUserPolicy = undefined;\n _this2.serviceProviderPolicy = {};\n _this2.userPolicies = {};\n _this2.storageManager = storageManager;\n _this2.runtimeCapabilities = runtimeCapabilities;\n return _this2;\n }\n\n (0, _createClass3.default)(RuntimeCoreCtx, [{\n key: 'loadConfigurations',\n value: function loadConfigurations() {\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n console.log(_this.storageManager);\n\n _this.storageManager.get('rethink:activePolicy').then(function (value) {\n _this.activeUserPolicy = value;\n\n return _this.storageManager.get('rethink:groups');\n }).then(function (groupInfo) {\n var groups = groupInfo;\n _this.groups = groups === undefined ? {} : groups;\n\n return _this.storageManager.get('rethink:spPolicies');\n }).then(function (policiesInfo) {\n var spPolicies = policiesInfo;\n _this.serviceProviderPolicy = spPolicies === undefined ? {} : spPolicies;\n\n _this._loadUserPolicies().then(function () {\n resolve();\n });\n });\n });\n }\n }, {\n key: 'getPolicies',\n value: function getPolicies(message, isIncomingMessage) {\n var policies = {};\n\n if (this.activeUserPolicy !== undefined) {\n policies.userPolicy = this.userPolicies[this.activeUserPolicy];\n }\n\n policies.serviceProviderPolicy = this.getServiceProviderPolicy(message, isIncomingMessage);\n\n return policies;\n }\n }, {\n key: '_isValidUpdate',\n value: function _isValidUpdate(message) {\n var _this = this;\n return new _promise2.default(function (resolve, reject) {\n if (message.from.split('://').length > 1) {\n _this.idModule._getHypertyFromDataObject(message.from).then(function (hypertyURL) {\n if (hypertyURL === message.body.source) {\n resolve(message);\n } else {\n reject('The source of the message is not valid.');\n }\n }, function (error) {\n reject(error);\n });\n } else {\n resolve(message);\n }\n });\n }\n }, {\n key: 'getMyEmails',\n value: function getMyEmails() {\n var identities = this.idModule.getIdentities();\n var emails = [];\n\n for (var i in identities) {\n emails.push((0, _utils.getUserEmailFromURL)(identities[i].identity));\n }\n\n return emails;\n }\n }, {\n key: 'getMyHyperties',\n value: function getMyHyperties() {\n var hyperties = this.runtimeRegistry.hypertiesList;\n var hypertiesNames = [];\n\n for (var i in hyperties) {\n var hypertyName = hyperties[i].objectName;\n if (hypertiesNames.indexOf(hypertyName) === -1) {\n hypertiesNames.push(hypertyName);\n }\n }\n\n return hypertiesNames;\n }\n }, {\n key: 'getServiceProviderPolicy',\n value: function getServiceProviderPolicy(message, isIncoming) {\n var policy = void 0;\n\n if (isIncoming) {\n var toHyperty = this.runtimeRegistry.getHypertyName(message.to);\n policy = this.serviceProviderPolicy[toHyperty];\n } else {\n var fromHyperty = this.runtimeRegistry.getHypertyName(message.from);\n policy = this.serviceProviderPolicy[fromHyperty];\n }\n return policy;\n }\n }, {\n key: 'getURL',\n value: function getURL(url) {\n var splitURL = url.split('/');\n return splitURL[0] + '//' + splitURL[2] + '/' + splitURL[3];\n }\n\n /**\n * Creates a group with the given name.\n * @param {String} groupName\n */\n\n }, {\n key: '_loadUserPolicies',\n value: function _loadUserPolicies() {\n var _this3 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n\n _this.storageManager.get('rethink:userPolicies').then(function (value) {\n var policies = value;\n if (policies !== undefined) {\n for (var i in policies) {\n _this3.pep.addPolicy('USER', i, policies[i]);\n }\n }\n resolve();\n });\n });\n }\n }, {\n key: '_getLastComponentOfURL',\n value: function _getLastComponentOfURL(url) {\n var split = url.split('/');\n return split[split.length - 1];\n }\n }, {\n key: '_getPoliciesJSON',\n value: function _getPoliciesJSON(policies) {\n for (var i in policies) {\n var combiningAlgorithm = policies[i].combiningAlgorithm;\n if (combiningAlgorithm instanceof _BlockOverrides2.default) {\n policies[i].combiningAlgorithm = 'blockOverrides';\n } else {\n if (combiningAlgorithm instanceof _AllowOverrides2.default) {\n policies[i].combiningAlgorithm = 'allowOverrides';\n } else {\n if (combiningAlgorithm instanceof _FirstApplicable2.default) {\n policies[i].combiningAlgorithm = 'firstApplicable';\n } else {\n policies[i].combiningAlgorithm = undefined;\n }\n }\n }\n }\n\n return policies;\n }\n }, {\n key: 'saveActivePolicy',\n value: function saveActivePolicy() {\n var _this4 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.set('rethink:activePolicy', 0, _this4.activeUserPolicy).then(function () {\n resolve();\n });\n });\n }\n }, {\n key: 'saveGroups',\n value: function saveGroups() {\n var _this5 = this;\n\n var _this = this;\n\n return new _promise2.default(function (resolve, reject) {\n _this.storageManager.set('rethink:groups', 0, _this5.groups).then(function () {\n resolve();\n });\n });\n }\n }, {\n key: 'savePolicies',\n value: function savePolicies(source, policy, key) {\n var policiesJson = void 0;\n\n switch (source) {\n case 'USER':\n policiesJson = (0, _stringify2.default)(this.userPolicies);\n policiesJson = this._getPoliciesJSON(JSON.parse(policiesJson));\n this.storageManager.set('rethink:userPolicies', 0, policiesJson);\n break;\n case 'SERVICE_PROVIDER':\n if (policy !== undefined & key !== undefined) {\n this.serviceProviderPolicy[key] = policy;\n }\n policiesJson = (0, _stringify2.default)(this.serviceProviderPolicy);\n policiesJson = this._getPoliciesJSON(JSON.parse(policiesJson));\n this.storageManager.set('rethink:spPolicies', 0, policiesJson);\n break;\n default:\n throw Error('Unknown policy source: ' + source);\n }\n }\n }, {\n key: 'getGroupsNames',\n value: function getGroupsNames() {\n var myGroups = this.groups;\n var groupsNames = [];\n if (myGroups !== undefined) {\n for (var groupName in myGroups) {\n groupsNames.push(groupName);\n }\n }\n return groupsNames;\n }\n }, {\n key: 'getGroup',\n value: function getGroup(groupName, destination) {\n var members = [];\n\n if (groupName === 'preauthorised') {\n var dataObjectURL = destination.split('/');\n dataObjectURL.pop();\n dataObjectURL = dataObjectURL[0] + '//' + dataObjectURL[2];\n members = this.runtimeRegistry.getPreAuthSubscribers(dataObjectURL);\n } else {\n if (this.groups[groupName] !== undefined) {\n members = this.groups[groupName];\n }\n }\n\n return members;\n }\n\n /**\n * Creates a group with the given name.\n * @param {String} groupName\n */\n\n }, {\n key: 'createGroup',\n value: function createGroup(groupName) {\n this.groups[groupName] = [];\n this.saveGroups();\n }\n }, {\n key: 'deleteGroup',\n value: function deleteGroup(groupName) {\n delete this.groups[groupName];\n this.saveGroups();\n }\n\n /**\n * Adds the given user email to the group with the given name.\n * @param {String} userEmail\n * @param {String} groupName\n */\n\n }, {\n key: 'addToGroup',\n value: function addToGroup(groupName, userEmail) {\n var myGroups = this.groups;\n if (myGroups[groupName] !== undefined) {\n if (myGroups[groupName].indexOf(userEmail) === -1) {\n myGroups[groupName].push(userEmail);\n this.saveGroups();\n }\n } else {\n throw Error('Group \"' + groupName + '\" does not exist!');\n }\n }\n }, {\n key: 'removeFromGroup',\n value: function removeFromGroup(groupName, userEmail) {\n var group = this.groups[groupName];\n\n group.splice(group.indexOf(userEmail), 1);\n this.saveGroups();\n }\n }, {\n key: 'pepURL',\n get: function get() {\n var _this = this;\n return _this._pepURL;\n }\n }, {\n key: 'guiURL',\n get: function get() {\n var _this = this;\n return _this._guiURL;\n }\n }, {\n key: 'runtimeURL',\n get: function get() {\n var _this = this;\n return _this._runtimeURL;\n }\n\n /**\n * return the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n\n }, {\n key: 'messageBus',\n get: function get() {\n var _this = this;\n return _this._messageBus;\n }\n\n /**\n * Set the messageBus in this Registry\n * @param {MessageBus} messageBus\n */\n ,\n set: function set(messageBus) {\n var _this = this;\n _this._messageBus = messageBus;\n }\n }, {\n key: 'subscription',\n get: function get() {\n return this._subscription;\n },\n set: function set(params) {\n this._subscription = params.message.body.subscriber;\n }\n }]);\n return RuntimeCoreCtx;\n}(_ReThinkCtx3.default);\n\nexports.default = RuntimeCoreCtx;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvY29udGV4dC9SdW50aW1lQ29yZUN0eC5qcz85NWRhIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIGxvZ2dlciBm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"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _utils = __webpack_require__(6);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ReThinkCtx = function () {\n function ReThinkCtx() {\n (0, _classCallCheck3.default)(this, ReThinkCtx);\n\n this.defaultBehaviour = true;\n this.groups = {};\n }\n\n (0, _createClass3.default)(ReThinkCtx, [{\n key: 'scheme',\n get: function get() {\n return this._scheme;\n },\n set: function set(params) {\n var from = params.message.from;\n if ((0, _utils.isDataObjectURL)(from)) {\n this._scheme = (0, _utils.divideURL)(from).type;\n } else {\n this._scheme = undefined;\n }\n }\n }, {\n key: 'date',\n get: function get() {\n return this._date;\n },\n set: function set(now) {\n var date = new Date();\n var day = String(date.getDate());\n if (day.length === 1) {\n day = '0' + day;\n }\n var month = String(date.getMonth() + 1);\n if (month.length === 1) {\n month = '0' + month;\n }\n this._date = day + '/' + month + '/' + date.getFullYear();\n }\n }, {\n key: 'domain',\n get: function get() {\n return this._domain;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._domain = (0, _utils.divideEmail)(params.message.body.identity.userProfile.username).domain;\n }\n }\n }, {\n key: 'type',\n get: function get() {\n return this._type;\n },\n set: function set(params) {\n var message = params.message;\n if (message.body.value !== undefined) {\n this._type = message.body.value.resourceType;\n }\n }\n }, {\n key: 'source',\n get: function get() {\n return this._source;\n },\n set: function set(params) {\n if (params.message.body.identity !== undefined) {\n this._source = params.message.body.identity.userProfile.username;\n }\n }\n }, {\n key: 'time',\n get: function get() {\n return this._time;\n },\n set: function set(now) {\n now = new Date();\n var minutes = String(now.getMinutes());\n if (minutes.length === 1) {\n minutes = '0' + minutes;\n }\n this._time = parseInt(String(now.getHours()) + minutes);\n }\n }, {\n key: 'weekday',\n get: function get() {\n return this._weekday;\n },\n set: function set(now) {\n this._weekday = String(new Date().getDay());\n }\n }]);\n return ReThinkCtx;\n}();\n\nexports.default = ReThinkCtx;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTQ5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9wb2xpY3kvUmVUaGlua0N0eC5qcz82ZmRhIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7ZGl2aWRlRW1haWwsIGRpdmlkZVVSTCwgaXNEYXRhT2JqZWN0VVJMfSBmcm9tICcuLi91dGlscy91dGlscyc7XG5cbmNsYXNzIFJlVGhpbmtDdHgge1xuXG4gIGNvbnN0cnVjdG9yKCkge1xuICAgIHRoaXMuZGVmYXVsdEJlaGF2aW91ciA9IHRydWU7XG4gICAgdGhpcy5ncm91cHMgPSB7fTtcbiAgfVxuXG4gIGdldCBzY2hlbWUoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3NjaGVtZTtcbiAgfVxuXG4gIGdldCBkYXRlKCkge1xuICAgIHJldHVybiB0aGlzLl9kYXRlO1xuICB9XG5cbiAgZ2V0IGRvbWFpbigpIHtcbiAgICByZXR1cm4gdGhpcy5fZG9tYWluO1xuICB9XG5cbiAgZ2V0IHR5cGUoKSB7XG4gICAgcmV0dXJuIHRoaXMuX3R5cGU7XG4gIH1cblxuICBnZXQgc291cmNlKCkge1xuICAgIHJldHVybiB0aGlzLl9zb3VyY2U7XG4gIH1cblxuICBnZXQgdGltZSgpIHtcbiAgICByZXR1cm4gdGhpcy5fdGltZTtcbiAgfVxuXG4gIGdldCB3ZWVrZGF5KCkge1xuICAgIHJldHVybiB0aGlzLl93ZWVrZGF5O1xuICB9XG5cbiAgc2V0IHNjaGVtZShwYXJhbXMpIHtcbiAgICBsZXQgZnJvbSA9IHBhcmFtcy5tZXNzY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tBQXdDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUExQ0E7QUFDQTtBQUNBO0FBMENBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBN0NBO0FBQ0E7QUFDQTtBQTZDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOzs7QUEvQ0E7QUFDQTtBQUNBO0FBK0NBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQXBEQTtBQUNBO0FBQ0E7QUFvREE7QUFDQTtBQUNBOzs7OztBQUlBO0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///549\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray2 = __webpack_require__(551);\n\nvar _slicedToArray3 = _interopRequireDefault(_slicedToArray2);\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _promise = __webpack_require__(3);\n\nvar _promise2 = _interopRequireDefault(_promise);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _loglevel = __webpack_require__(4);\n\nvar logger = _interopRequireWildcard(_loglevel);\n\nvar _CatalogueDataObjectFactory = __webpack_require__(558);\n\nvar _CatalogueDataObjectFactory2 = _interopRequireDefault(_CatalogueDataObjectFactory);\n\nfunction _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar log = logger.getLogger('RuntimeCatalogue'); // Log System\n\nvar RuntimeCatalogue = function () {\n function RuntimeCatalogue(runtimeFactory, name, schema) {\n (0, _classCallCheck3.default)(this, RuntimeCatalogue);\n\n if (!runtimeFactory) throw Error('The catalogue needs the runtimeFactory');\n\n this._factory = new _CatalogueDataObjectFactory2.default();\n this.httpRequest = runtimeFactory.createHttpRequest();\n this.atob = runtimeFactory.atob ? runtimeFactory.atob : atob;\n\n var storageName = name ? name : 'runtimeCatalogue';\n var storageSchema = schema ? schema : '&cguid, accessControlPolicy, constraints, dataObjects, hypertyType, objectName, sourcePackage, version';\n\n var schemas = {};\n schemas[storageName] = storageSchema;\n\n this.storageManager = runtimeFactory.storageManager(storageName, schemas);\n }\n\n /**\n * Get a Catalogue Data Object (Descriptor) from a URL, and construct it using the provided function\n * @param {String} descriptorURL - e.g. mydomain.com/.well-known/hyperty/MyHyperty\n * @param {function} createFunc - e.g. createHyperty\n * @param {boolean} [getFull] - whether or not to get descriptor with sourcePackage, or only the descriptor part\n * @param {JSON} constraints - constraints object\n * @returns {Promise} - Promise that fulfills with the requested descriptor in the appropriate type.\n * If constraints were provided, a descriptor is only returned if it meets the constraints, otherwise the promise will be rejected.\n */\n\n\n (0, _createClass3.default)(RuntimeCatalogue, [{\n key: 'getDescriptor',\n value: function getDescriptor(descriptorURL, createFunc) {\n var _this = this;\n\n var getFull = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var constraints = arguments[3];\n\n log.info('[RuntimeCatalogue] - getting descriptor from: ', descriptorURL, ' with constraints: ', constraints);\n\n // some flags for optimization\n // (later the descriptor will not be saved in case both of these booleans are true)\n var isSavedDescriptor = false;\n var isCompleteDescriptor = false;\n\n // get raw descriptor\n // first checks if descriptor is already in localStorage (based on cguid and version)\n var descriptorPromise = void 0;\n if (constraints != undefined) {\n descriptorPromise = _promise2.default.all([this.httpRequest.post(descriptorURL + '/version', { body: (0, _stringify2.default)(constraints) }), this.httpRequest.post(descriptorURL + '/cguid', { body: (0, _stringify2.default)(constraints) })]);\n } else {\n descriptorPromise = _promise2.default.all([this.httpRequest.get(descriptorURL + '/version'), this.httpRequest.get(descriptorURL + '/cguid')]);\n }\n descriptorPromise = descriptorPromise.then(function (_ref) {\n var _ref2 = (0, _slicedToArray3.default)(_ref, 2),\n version = _ref2[0],\n cguid = _ref2[1];\n\n log.info('[RuntimeCatalogue] - got version (' + version + ') and cguid (' + cguid + ') for descriptor ' + descriptorURL);\n\n // check if same version is contained in localStorage\n return _this.storageManager.getVersion('cguid', cguid).then(function (dbVersion) {\n if (dbVersion >= version) {\n log.warn('storageManager contains saved version that is the same or newer than requested');\n isSavedDescriptor = true;\n return _this.storageManager.get('cguid', cguid);\n } else {\n log.warn('storageManager does not contain saved version');\n\n // no saved copy, proceed with retrieving descriptor\n var retrievePromise = constraints != undefined ? _this.httpRequest.post(descriptorURL, { body: (0, _stringify2.default)(constraints) }) : _this.httpRequest.get(descriptorURL);\n return retrievePromise.then(function (descriptor) {\n descriptor = JSON.parse(descriptor);\n\n //log.log(\"got descriptor:\", JSON.stringify(descriptor, null, 2));\n if (descriptor['ERROR']) {\n // TODO handle error properly\n throw new Error(descriptor);\n } else {\n return descriptor;\n }\n });\n }\n });\n }).catch(function (error) {\n var errorString = 'Unable to get descriptor for ' + descriptorURL + (constraints != undefined ? ' with constraints ' + constraints : '') + ': ' + error;\n log.error(errorString);\n throw new Error(errorString);\n });\n\n var returnPromise = descriptorPromise;\n\n // if getFull, attach sourcePackage\n if (getFull) {\n log.log('adding promise to attach sourcePackage');\n returnPromise = descriptorPromise.then(function (descriptor) {\n if (descriptor.sourcePackage) {\n isCompleteDescriptor = true;\n return descriptor;\n } else {\n isCompleteDescriptor = false;\n return _this.attachRawSourcePackage(descriptor);\n }\n });\n }\n\n // finally create object\n returnPromise = returnPromise.then(function (descriptor) {\n // store if not saved before, or if full descriptor was requested and only partial descriptor was stored.\n if (!isSavedDescriptor || isSavedDescriptor && !isCompleteDescriptor && getFull) {\n _this.storageManager.set(descriptor.cguid, descriptor.version, descriptor);\n }\n return createFunc.apply(_this, [descriptor, constraints]);\n });\n\n return returnPromise;\n }\n\n /**\n * Uses the sourcePackageURL from the descriptor, requests the sourcePackage and attaches it to the descriptor.\n * @param {CatalogueDataObject} descriptor\n * @param {JSON} constraints - constraints object\n * @returns {Promise} - fulfills with complete descriptor\n */\n\n }, {\n key: 'attachRawSourcePackage',\n value: function attachRawSourcePackage(descriptor, constraints) {\n var _this2 = this;\n\n log.log('attaching raw sourcePackage from:', descriptor.sourcePackageURL);\n return new _promise2.default(function (resolve, reject) {\n var retrievePromise = constraints != undefined ? _this2.httpRequest.post(descriptor.sourcePackageURL, { body: (0, _stringify2.default)(constraints) }) : _this2.httpRequest.get(descriptor.sourcePackageURL);\n retrievePromise.then(function (sourcePackage) {\n sourcePackage = JSON.parse(sourcePackage);\n\n //delete descriptor.sourcePackageURL;\n //log.log(\"attaching sourcePackage:\", sourcePackage);\n descriptor.sourcePackage = sourcePackage;\n resolve(descriptor);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n\n /**\n * Get HypertyDescriptor\n * @param hypertyURL - e.g. mydomain.com/.well-known/hyperty/MyHyperty\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getHypertyDescriptor',\n value: function getHypertyDescriptor(hypertyURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(hypertyURL, this.createHyperty, getFull, constraints);\n }\n\n /**\n * Get StubDescriptor\n * @param stubURL - e.g. mydomain.com/.well-known/protostub/MyProtostub\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getStubDescriptor',\n value: function getStubDescriptor(stubURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(stubURL, this.createStub, getFull, constraints);\n }\n\n /**\n * Get RuntimeDescriptor\n * @param runtimeURL - e.g. mydomain.com/.well-known/runtime/MyRuntime\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getRuntimeDescriptor',\n value: function getRuntimeDescriptor(runtimeURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(runtimeURL, this.createRuntimeDescriptor, getFull, constraints);\n }\n\n /**\n * Get DataSchemaDescriptor\n * @param dataSchemaURL - e.g. mydomain.com/.well-known/dataschema/MyDataSchema\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getDataSchemaDescriptor',\n value: function getDataSchemaDescriptor(dataSchemaURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(dataSchemaURL, this.createDataSchema, getFull, constraints);\n }\n\n /**\n * Get IDPProxyDescriptor\n * @param idpProxyURL - e.g. mydomain.com/.well-known/idp-proxy/MyProxy\n * @param {boolean} [getFull] - boolean to decide to get the descriptor with the sourcePackage or (potentially) without\n * @param {JSON} constraints - constraints object\n * @returns {Promise}\n */\n\n }, {\n key: 'getIdpProxyDescriptor',\n value: function getIdpProxyDescriptor(idpProxyURL) {\n var getFull = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n var constraints = arguments[2];\n\n return this.getDescriptor(idpProxyURL, this.createIdpProxy, getFull, constraints);\n }\n\n /**\n * Create HypertyDescriptor based on raw object that contains its attributes\n * @param {JSON} rawHyperty\n * @returns {HypertyDescriptor}\n */\n\n }, {\n key: 'createHyperty',\n value: function createHyperty(rawHyperty) {\n //log.log(\"createHyperty:\", rawHyperty);\n // create the descriptor\n var hyperty = this._factory.createHypertyDescriptorObject(rawHyperty['cguid'], rawHyperty['version'], rawHyperty['objectName'], rawHyperty['description'], rawHyperty['language'], rawHyperty['sourcePackageURL'], rawHyperty['type'] || rawHyperty['hypertyType'], rawHyperty['dataObjects']);\n\n //log.log(\"factory returned:\", hyperty);\n\n // optional fields\n hyperty.configuration = rawHyperty['configuration'];\n hyperty.constraints = rawHyperty['constraints'];\n hyperty.messageSchema = rawHyperty['messageSchema'];\n hyperty.policies = rawHyperty['policies'];\n hyperty.signature = rawHyperty['signature'];\n\n // parse and attach sourcePackage\n var sourcePackage = rawHyperty['sourcePackage'];\n if (sourcePackage) {\n hyperty.sourcePackage = this.createSourcePackage(sourcePackage);\n }\n\n return hyperty;\n }\n\n /**\n * Create ProtocolStubDescriptor based on raw object that contains its attributes\n * @param rawStub\n * @returns {ProtocolStubDescriptor}\n */\n\n }, {\n key: 'createStub',\n value: function createStub(rawStub) {\n // log.log(\"creating stub descriptor based on: \", rawStub);\n\n // create the descriptor\n var stub = this._factory.createProtoStubDescriptorObject(rawStub['cguid'], rawStub['version'], rawStub['objectName'], rawStub['description'], rawStub['language'], rawStub['sourcePackageURL'], rawStub['messageSchemas'], rawStub['configuration'], rawStub['constraints'], rawStub['hypertyType'], rawStub['dataObjects'], rawStub['interworking'], rawStub['idpProxy'], rawStub['mutualAuthentication']);\n\n // optional fields\n stub.signature = rawStub['signature'];\n\n // parse and attach the sourcePackage\n var sourcePackage = rawStub['sourcePackage'];\n if (sourcePackage) {\n stub.sourcePackage = this.createSourcePackage(sourcePackage);\n }\n\n return stub;\n }\n\n /**\n * Create HypertyRuntimeDescriptor based on raw object that contains its attributes\n * @param rawRuntime\n * @returns {HypertyRuntimeDescriptor}\n */\n\n }, {\n key: 'createRuntimeDescriptor',\n value: function createRuntimeDescriptor(rawRuntime) {\n // parse capabilities first\n try {\n rawRuntime['hypertyCapabilities'] = JSON.parse(rawRuntime['hypertyCapabilities']);\n rawRuntime['protocolCapabilities'] = JSON.parse(rawRuntime['protocolCapabilities']);\n } catch (e) {}\n // already json object\n\n\n //log.log(\"creating runtime descriptor based on: \", rawRuntime);\n\n\n // create the descriptor\n var runtime = this._factory.createHypertyRuntimeDescriptorObject(rawRuntime['cguid'], rawRuntime['version'], rawRuntime['objectName'], rawRuntime['description'], rawRuntime['language'], rawRuntime['sourcePackageURL'], rawRuntime['type'] || rawRuntime['runtimeType'], rawRuntime['hypertyCapabilities'], rawRuntime['protocolCapabilities'], rawRuntime['p2pHandlerStub'], rawRuntime['p2pRequesterStub']);\n\n // optional fields\n runtime.signature = rawRuntime['signature'];\n\n // parse and attach sourcePackage\n var sourcePackage = rawRuntime['sourcePackage'];\n if (sourcePackage) {\n // log.log(\"runtime has sourcePackage:\", sourcePackage);\n runtime.sourcePackage = this.createSourcePackage(sourcePackage);\n }\n return runtime;\n }\n\n /**\n * Create DataObjectSchema based on raw object that contains its attributes\n * @param rawSchema\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: 'createDataSchema',\n value: function createDataSchema(rawSchema) {\n //log.log(\"creating dataSchema based on: \", rawSchema);\n\n var dataSchema = void 0;\n\n //log.log('1. createMessageDataObjectSchema: ', rawSchema[\"accessControlPolicy\"]);\n //log.log('2. createMessageDataObjectSchema: ', rawSchema[\"scheme\"]);\n if (rawSchema['accessControlPolicy'] && rawSchema['scheme']) {\n dataSchema = this._factory.createHypertyDataObjectSchema(rawSchema['cguid'], rawSchema['version'], rawSchema['objectName'], rawSchema['description'], rawSchema['language'], rawSchema['sourcePackageURL'], rawSchema['accessControlPolicy'], rawSchema['scheme']);\n } else {\n //log.log('3. createMessageDataObjectSchema: ', rawSchema);\n dataSchema = this._factory.createMessageDataObjectSchema(rawSchema['cguid'], rawSchema['version'], rawSchema['objectName'], rawSchema['description'], rawSchema['language'], rawSchema['sourcePackageURL']);\n }\n\n // optional fields\n dataSchema.signature = rawSchema['signature'];\n\n // parse and attach sourcePackage\n var sourcePackage = rawSchema['sourcePackage'];\n if (sourcePackage) {\n //log.log(\"dataSchema has sourcePackage:\", sourcePackage);\n dataSchema.sourcePackage = this.createSourcePackage(sourcePackage);\n\n try {\n dataSchema.sourcePackage.sourceCode = JSON.parse(dataSchema.sourcePackage.sourceCode);\n } catch (e) {\n log.log('DataSchema Source code is already parsed');\n }\n\n return dataSchema;\n }\n\n //log.log(\"created dataSchema descriptor object:\", dataSchema);\n return dataSchema;\n }\n\n /**\n * Create ProtocolStubDescriptor based on raw object that contains its attributes\n * @param rawProxy\n * @returns {ProtocolStubDescriptor}\n */\n\n }, {\n key: 'createIdpProxy',\n value: function createIdpProxy(rawProxy) {\n // log.log(\"creating idpproxy descriptor based on: \", rawProxy);\n\n // create the descriptor\n var idpproxy = this._factory.createProtoStubDescriptorObject(rawProxy['cguid'], rawProxy['version'], rawProxy['objectName'], rawProxy['description'], rawProxy['language'], rawProxy['sourcePackageURL'], rawProxy['messageSchemas'], rawProxy['configuration'], rawProxy['constraints'], rawProxy['hypertyType'], rawProxy['dataObjects'], rawProxy['interworking'], rawProxy['idpProxy'], rawProxy['mutualAuthentication']);\n\n // optional fields\n idpproxy.signature = rawProxy['signature'];\n\n // parse and attach the sourcePackage\n var sourcePackage = rawProxy['sourcePackage'];\n if (sourcePackage) {\n sourcePackage = this.createSourcePackage(sourcePackage);\n idpproxy.sourcePackage = sourcePackage;\n }\n\n return idpproxy;\n }\n }, {\n key: 'createSourcePackage',\n value: function createSourcePackage(sp) {\n //log.log(\"createSourcePackage:\", sp);\n\n // check encoding\n if (sp['encoding'] === 'base64') {\n sp['sourceCode'] = this.atob(sp['sourceCode']);\n sp['encoding'] = 'utf-8';\n }\n\n var sourcePackage = this._factory.createSourcePackage(sp['sourceCodeClassname'], sp['sourceCode']);\n if (sp['encoding']) sourcePackage.encoding = sp['encoding'];\n\n if (sp['signature']) sourcePackage.signature = sp['signature'];\n\n return sourcePackage;\n }\n\n /**\n * Get source Package from a URL\n * @param sourcePackageURL - e.g. mydomain.com/.well-known/hyperty/MyHyperty/sourcePackage\n * @returns {Promise}\n */\n\n }, {\n key: 'getSourcePackageFromURL',\n value: function getSourcePackageFromURL(sourcePackageURL) {\n var _this3 = this;\n\n log.log('getting sourcePackage from:', sourcePackageURL);\n\n return new _promise2.default(function (resolve, reject) {\n _this3.httpRequest.get(sourcePackageURL).then(function (result) {\n //log.log(\"got raw sourcePackage:\", result);\n if (result['ERROR']) {\n // TODO handle error properly\n reject(result);\n } else {\n result = JSON.parse(result);\n var sourcePackage = _this3.createSourcePackage(result);\n resolve(sourcePackage);\n }\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n\n /**\n * Returns the sourceCode of a given descriptor\n * @param {CatalogueDataObject} descriptor - Catalogue Object that was retrieved using e.g. getHypertyDescriptor()\n * @returns {Promise}\n */\n\n }, {\n key: 'getSourceCodeFromDescriptor',\n value: function getSourceCodeFromDescriptor(descriptor) {\n var _this4 = this;\n\n return new _promise2.default(function (resolve, reject) {\n if (descriptor.sourcePackage) {\n //log.log(\"descriptor has sourcePackage\");\n //log.log(\"returning sourceCode:\", descriptor.sourcePackage.sourceCode);\n resolve(descriptor.sourcePackage.sourceCode);\n } else {\n _this4.storageManager.getVersion(descriptor.sourcePackageURL + '/sourceCode').then(function (dbVersion) {\n if (dbVersion >= descriptor.version) {\n log.log('returning cached version from storageManager');\n _this4.storageManager.get(descriptor.sourcePackageURL + '/sourceCode').then(function (sourceCode) {\n resolve(sourceCode);\n }).catch(function (reason) {\n reject(reason);\n });\n } else {\n _this4.httpRequest.get(descriptor.sourcePackageURL + '/sourceCode').then(function (sourceCode) {\n if (sourceCode['ERROR']) {\n // TODO handle error properly\n reject(sourceCode);\n } else {\n _this4.storageManager.set(descriptor.sourcePackageURL + '/sourceCode', descriptor.version, sourceCode);\n resolve(sourceCode);\n }\n }).catch(function (reason) {\n reject(reason);\n });\n }\n }).catch(function (reason) {\n reject(reason);\n });\n }\n });\n }\n\n /**\n * Returns the list of available catalogue objects for the given \"type URL\",\n * i.e. a catalogue URL that specifies a type, but no catalogue object name.\n * @param typeURL - URL pointing to the catalogue object type you want a list of available objects for,\n * e.g. hyperty-catalogue://catalogue.fokus.fraunhofer.de/.well-known/idp-proxy\n * @param {JSON} constraints - constraints object\n * @returns {Promise} typeListPromise - Promise that fulfills with the list of available catalogue object names for the requested type,\n * rejects on HTTP error or if the HTTP response is not in JSON.\n * If constraints were provided, then the list only contains those objects that meet the constraints\n */\n\n }, {\n key: 'getTypeList',\n value: function getTypeList(typeURL, constraints) {\n var _this5 = this;\n\n return new _promise2.default(function (resolve, reject) {\n var requestPromise = constraints != undefined ? _this5.httpRequest.post(typeURL, { body: (0, _stringify2.default)(constraints) }) : _this5.httpRequest.get(typeURL);\n requestPromise.then(function (typeList) {\n typeList = JSON.parse(typeList);\n resolve(typeList);\n }).catch(function (reason) {\n reject(reason);\n });\n });\n }\n }, {\n key: 'deleteFromPM',\n value: function deleteFromPM(url) {\n return this.storageManager.delete(url);\n }\n }, {\n key: 'runtimeURL',\n set: function set(runtimeURL) {\n this._runtimeURL = runtimeURL;\n },\n get: function get() {\n return this._runtimeURL;\n }\n }]);\n return RuntimeCatalogue;\n}();\n\nexports.default = RuntimeCatalogue;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9SdW50aW1lQ2F0YWxvZ3VlLmpzPzU2NWUiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gTG9nIFN5c3RlbVxuaW1wb3J0ICogYXMgbG9nZ2VyIGZyb20gJ2xvZ2xldmVsJztcbmxldCBsb2cgPSBsb2dnZXIuZ2V0TG9nZ2VyKCdSdW50aW1lQ2F0YWxvZ3VlJyk7XG5cbmltcG9ydCBDYXRhbG9ndWVGYWN0b3J5IGZyb20gJy4vQ2F0YWxvZ3VlRGF0YU9iamVjdEZhY3RvcnknO1xuXG5jb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V0KGRlc2NyaXB0b3JVUkwpO1xuICAgICAgICAgIHJldHVybiByZXRyaWV2ZVByb21pc2UudGhlbigoZGVzY3JpcHRvcikgPT4ge1xuICAgICAgICAgICAgZGVzY3JpcHRvciA9IEpTT04ucGFyc2UoZGVzY3JpcHRvcik7XG5cbiAgICAgICAgICAgIC8vbG9nLmxvZyhcImdvdCBkZXNjcmlwdG9yOlwiLCBKU09OLnN0cmluZ2lmeShkZXNjcmlwdG9yLCBudWxsLCAyKSk7XG4gICAgICAgICAgICBpZiAoZGVzY3JpcHRvclsnRVJST1InXSkge1xuICAgICAgICAgICAgICAvLyBUT0RPIGhhbmRsZSBlcnJvciBwcm9wZXJseVxuICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoZGVzY3JpcHRvcik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICByZXR1cm4gZGVzY3JpcHRvcjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgfSlcbiAgICB9KS5jYXRjaCgoZXJyb3IpID0+IHtcbiAgICAgIGxldCBlcnJvclN0cmluZyA9ICdVbmFibGUgdG8gZ2V0IGRlc2NyaXB0b3IgZm9yICcgKyBkZXNjcmlwdG9yVVJMICsgKGNvbnN0cmFpbnRzICE9IHVuZGVmaW5lZCA/ICcgd2l0aCBjb25zdHJhaW50cyAnICsgY29uc3RyYWludHMgOiAnJykgKyAnOiAnICsgZXJyb3I7XG4gICAgICBsb2cuZXJyb3IoZXJyb3JTdHJpbmcpO1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGVycm9yU3RyaW5nKTtcbiAgICB9KTtcblxuICAgIGxldCByZXR1cm5Qcm9taXNlID0gZGVzY3JpcHRvclByb21pc2U7XG5cbiAgICAvLyBpZiBnZXRGdWxsLCBhdHRhY2ggc291cmNlUGFja2FnZVxuICAgIGlmIChnZXRGdWxsKSB7XG4gICAgICBsb2cubG9nKCdhZGRpbmcgcHJvbWlz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tBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBVUE7QUFDQTtBQUNBOzs7QUFWQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7Ozs7O0FBUUE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///550\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nexports.__esModule = true;\n\nvar _isIterable2 = __webpack_require__(552);\n\nvar _isIterable3 = _interopRequireDefault(_isIterable2);\n\nvar _getIterator2 = __webpack_require__(555);\n\nvar _getIterator3 = _interopRequireDefault(_getIterator2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = (0, _getIterator3.default)(arr), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i["return"]) _i["return"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if ((0, _isIterable3.default)(Object(arr))) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError("Invalid attempt to destructure non-iterable instance");\n }\n };\n}();//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvaGVscGVycy9zbGljZWRUb0FycmF5LmpzPzc3YjEiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmV4cG9ydHMuX19lc01vZHVsZSA9IHRydWU7XG5c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QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///551\n')},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(553), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9pcy1pdGVyYWJsZS5qcz9iYWNmIl0sInNvdXJjZXNDb250ZW50IjpbIm1vZHVsZS5leHBvcnRzID0geyBcImRlZmF1bHRcIjogcmVxdWlyZShcImNvcmUtanMvbGlicmFyeS9mbi9pcy1pdGVyYWJsZVwiKSwgX19lc01vZHVsZTogdHJ1ZSB9O1xuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9pcy1pdGVyYWJsZS5qc1xuLy8gbW9kdWxlIGlkID0gNTUyXG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///552\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(101);\n__webpack_require__(80);\nmodule.exports = __webpack_require__(554);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTUzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9pcy1pdGVyYWJsZS5qcz81ZGRkIl0sInNvdXJjZXNDb250ZW50IjpbInJlcXVpcmUoJy4uL21vZHVsZXMvd2ViLmRvbS5pdGVyYWJsZScpO1xucmVxdWlyZSgnLi4vbW9kdWxlcy9lczYuc3RyaW5nLml0ZXJhdG9yJyk7XG5tb2R1bGUuZXhwb3J0cyA9IHJlcXVpcmUoJy4uL21vZHVsZXMvY29yZS5pcy1pdGVyYWJsZScpO1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L2ZuL2lzLWl0ZXJhYmxlLmpzXG4vLyBtb2R1bGUgaWQgPSA1NTNcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///553\n")},function(module,exports,__webpack_require__){eval("var classof = __webpack_require__(142);\nvar ITERATOR = __webpack_require__(22)('iterator');\nvar Iterators = __webpack_require__(71);\nmodule.exports = __webpack_require__(11).isIterable = function (it) {\n var O = Object(it);\n return O[ITERATOR] !== undefined\n || '@@iterator' in O\n // eslint-disable-next-line no-prototype-builtins\n || Iterators.hasOwnProperty(classof(O));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuaXMtaXRlcmFibGUuanM/ZTRmOSJdLCJzb3VyY2VzQ29udGVudCI6WyJ2YXIgY2xhc3NvZiA9IHJlcXVpcmUoJy4vX2NsYXNzb2YnKTtcbnZhciBJVEVSQVRPUiA9IHJlcXVpcmUoJy4vX3drcycpKCdpdGVyYXRvcicpO1xudmFyIEl0ZXJhdG9ycyA9IHJlcXVpcmUoJy4vX2l0ZXJhdG9ycycpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuL19jb3JlJykuaXNJdGVyYWJsZSA9IGZ1bmN0aW9uIChpdCkge1xuICB2YXIgTyA9IE9iamVjdChpdCk7XG4gIHJldHVybiBPW0lURVJBVE9SXSAhPT0gdW5kZWZpbmVkXG4gICAgfHwgJ0BAaXRlcmF0b3InIGluIE9cbiAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tcHJvdG90eXBlLWJ1aWx0aW5zXG4gICAgfHwgSXRlcmF0b3JzLmhhc093blByb3BlcnR5KGNsYXNzb2YoTykpO1xufTtcblxuXG5cbi8vLy8vLy8vLy8vLy8vLy8vL1xuLy8gV0VCUEFDSyBGT09URVJcbi8vIC4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuaXMtaXRlcmFibGUuanNcbi8vIG1vZHVsZSBpZCA9IDU1NFxuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///554\n")},function(module,exports,__webpack_require__){eval('module.exports = { "default": __webpack_require__(556), __esModule: true };//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2JhYmVsLXJ1bnRpbWUvY29yZS1qcy9nZXQtaXRlcmF0b3IuanM/MDRlZCJdLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IHsgXCJkZWZhdWx0XCI6IHJlcXVpcmUoXCJjb3JlLWpzL2xpYnJhcnkvZm4vZ2V0LWl0ZXJhdG9yXCIpLCBfX2VzTW9kdWxlOiB0cnVlIH07XG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvYmFiZWwtcnVudGltZS9jb3JlLWpzL2dldC1pdGVyYXRvci5qc1xuLy8gbW9kdWxlIGlkID0gNTU1XG4vLyBtb2R1bGUgY2h1bmtzID0gMCJdLCJtYXBwaW5ncyI6IkFBQUEiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///555\n')},function(module,exports,__webpack_require__){eval("__webpack_require__(101);\n__webpack_require__(80);\nmodule.exports = __webpack_require__(557);\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9mbi9nZXQtaXRlcmF0b3IuanM/N2YxNCJdLCJzb3VyY2VzQ29udGVudCI6WyJyZXF1aXJlKCcuLi9tb2R1bGVzL3dlYi5kb20uaXRlcmFibGUnKTtcbnJlcXVpcmUoJy4uL21vZHVsZXMvZXM2LnN0cmluZy5pdGVyYXRvcicpO1xubW9kdWxlLmV4cG9ydHMgPSByZXF1aXJlKCcuLi9tb2R1bGVzL2NvcmUuZ2V0LWl0ZXJhdG9yJyk7XG5cblxuXG4vLy8vLy8vLy8vLy8vLy8vLy9cbi8vIFdFQlBBQ0sgRk9PVEVSXG4vLyAuL25vZGVfbW9kdWxlcy9jb3JlLWpzL2xpYnJhcnkvZm4vZ2V0LWl0ZXJhdG9yLmpzXG4vLyBtb2R1bGUgaWQgPSA1NTZcbi8vIG1vZHVsZSBjaHVua3MgPSAwIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7Iiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///556\n")},function(module,exports,__webpack_require__){eval("var anObject = __webpack_require__(41);\nvar get = __webpack_require__(143);\nmodule.exports = __webpack_require__(11).getIterator = function (it) {\n var iterFn = get(it);\n if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');\n return anObject(iterFn.call(it));\n};\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU3LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL2NvcmUtanMvbGlicmFyeS9tb2R1bGVzL2NvcmUuZ2V0LWl0ZXJhdG9yLmpzPzgzYzUiXSwic291cmNlc0NvbnRlbnQiOlsidmFyIGFuT2JqZWN0ID0gcmVxdWlyZSgnLi9fYW4tb2JqZWN0Jyk7XG52YXIgZ2V0ID0gcmVxdWlyZSgnLi9jb3JlLmdldC1pdGVyYXRvci1tZXRob2QnKTtcbm1vZHVsZS5leHBvcnRzID0gcmVxdWlyZSgnLi9fY29yZScpLmdldEl0ZXJhdG9yID0gZnVuY3Rpb24gKGl0KSB7XG4gIHZhciBpdGVyRm4gPSBnZXQoaXQpO1xuICBpZiAodHlwZW9mIGl0ZXJGbiAhPSAnZnVuY3Rpb24nKSB0aHJvdyBUeXBlRXJyb3IoaXQgKyAnIGlzIG5vdCBpdGVyYWJsZSEnKTtcbiAgcmV0dXJuIGFuT2JqZWN0KGl0ZXJGbi5jYWxsKGl0KSk7XG59O1xuXG5cblxuLy8vLy8vLy8vLy8vLy8vLy8vXG4vLyBXRUJQQUNLIEZPT1RFUlxuLy8gLi9ub2RlX21vZHVsZXMvY29yZS1qcy9saWJyYXJ5L21vZHVsZXMvY29yZS5nZXQtaXRlcmF0b3IuanNcbi8vIG1vZHVsZSBpZCA9IDU1N1xuLy8gbW9kdWxlIGNodW5rcyA9IDAiXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOyIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///557\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _CatalogueDataObject = __webpack_require__(72);\n\nvar _CatalogueDataObject2 = _interopRequireDefault(_CatalogueDataObject);\n\nvar _SourcePackage = __webpack_require__(561);\n\nvar _SourcePackage2 = _interopRequireDefault(_SourcePackage);\n\nvar _HypertyDescriptor = __webpack_require__(562);\n\nvar _HypertyDescriptor2 = _interopRequireDefault(_HypertyDescriptor);\n\nvar _ProtocolStubDescriptor = __webpack_require__(563);\n\nvar _ProtocolStubDescriptor2 = _interopRequireDefault(_ProtocolStubDescriptor);\n\nvar _HypertyRuntimeDescriptor = __webpack_require__(564);\n\nvar _HypertyRuntimeDescriptor2 = _interopRequireDefault(_HypertyRuntimeDescriptor);\n\nvar _HypertyInterceptorDescriptor = __webpack_require__(565);\n\nvar _HypertyInterceptorDescriptor2 = _interopRequireDefault(_HypertyInterceptorDescriptor);\n\nvar _DataObjectSchema = __webpack_require__(566);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar CatalogueDataObjectFactory = function () {\n function CatalogueDataObjectFactory() {\n (0, _classCallCheck3.default)(this, CatalogueDataObjectFactory);\n }\n\n (0, _createClass3.default)(CatalogueDataObjectFactory, [{\n key: "createCatalogueDataObject",\n\n\n /**\n * Create CatalogueDataObject\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {CatalogueObjectType} type - Indicates the type of Catalogue Data Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @returns {CatalogueDataObject}\n */\n value: function createCatalogueDataObject(guid, type, version, objectName, description, language, sourcePackageURL) {\n if (typeof guid === "undefined" || typeof type === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n return new _CatalogueDataObject2.default(guid, type, version, objectName, description, language, sourcePackageURL);\n }\n\n /**\n * Create HypertyDescriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object\n * can be downloaded.\n * @param {HypertyResourceType[]} hypertyType - An array of HypertyResourceType that identifies what type of hyperty\n * resources are handled by the object.\n * @param {URL.URLList} dataObjects - Defines the Data Object Schemas supported by the Hyperty through a list of Catalogue URLs from where these schemas can be reached.\n * @returns {HypertyDescriptor}\n */\n\n }, {\n key: "createHypertyDescriptorObject",\n value: function createHypertyDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, hypertyType, dataObjects) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof hypertyType === "undefined" || typeof dataObjects === "undefined") throw new Error("Invalid parameters!");\n return new _HypertyDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY, version, objectName, description, language, sourcePackageURL, hypertyType, dataObjects);\n }\n\n /**\n * Create ProtocolStubDescriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param {URL.URL} messageSchemas - Defines the Schema describing the Message Data Model used by the Hyperty through the Catalogue URL from where the Message schema can be reached. If not defined, by default it is assumed the standard Message Model is used.\n * @param configuration - Data required to configure the ProtocolStub\n * @param constraints - Describes capabilities required from the Hyperty Runtime in order to be able to execute the ProtocolStub\n * @param hypertyType\n * @param dataObjects\n * @param interworking\n * @param idpProxy\n * @param mutualAuthentication\n * @returns {ProtocolStubDescriptor}\n */\n\n }, {\n key: "createProtoStubDescriptorObject",\n value: function createProtoStubDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, messageSchemas, configuration, constraints, hypertyType, dataObjects, interworking, idpProxy, mutualAuthentication) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof messageSchemas === "undefined" || typeof configuration === "undefined" || typeof constraints === "undefined") throw new Error("Invalid parameters!");\n return new _ProtocolStubDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.PROTOSTUB, version, objectName, description, language, sourcePackageURL, messageSchemas, configuration, constraints, hypertyType, dataObjects, interworking, idpProxy, mutualAuthentication);\n }\n\n /**\n * Create HypertyRuntimeDescriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param {RuntimeType}runtimeType\n * @param {RuntimeHypertyCapabilities} hypertyCapabilities - Supported capabilities to execute Hyperties\n * @param {RuntimeProtocolCapabilities} protocolCapabilities - Supported capabilities to execute Protocol Stubs\n * @param p2pHandlerStub\n * @param p2pRequesterStub\n * @returns {HypertyRuntimeDescriptor} the data object of the Hyperty Runtime Descriptor\n */\n\n }, {\n key: "createHypertyRuntimeDescriptorObject",\n value: function createHypertyRuntimeDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, runtimeType, hypertyCapabilities, protocolCapabilities, p2pHandlerStub, p2pRequesterStub) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof runtimeType === "undefined") throw new Error("Invalid parameters!");\n\n return new _HypertyRuntimeDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_RUNTIME, version, objectName, description, language, sourcePackageURL, runtimeType, hypertyCapabilities, protocolCapabilities, p2pHandlerStub, p2pRequesterStub);\n }\n\n /**\n * Create Hyperty Interceptor Descriptor\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param configuration\n * @param policies\n * @returns {PolicyEnforcerDescriptor}\n */\n\n }, {\n key: "createHypertyInterceptorDescriptorObject",\n value: function createHypertyInterceptorDescriptorObject(guid, version, objectName, description, language, sourcePackageURL, configuration, policies) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n\n return new _HypertyInterceptorDescriptor2.default(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_INTERCEPTOR, version, objectName, description, language, sourcePackageURL, configuration, policies);\n }\n\n /**\n * Create DataObjectSchema which in effect is the MessageDataObjectSchema\n * @deprecated Use either createMessageDataObjectSchema or createHypertyDataObjectSchema instead\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: "createDataObjectSchema",\n value: function createDataObjectSchema(guid, version, objectName, description, language, sourcePackageURL) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n\n return new _DataObjectSchema.DataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL);\n }\n\n /**\n * Create DataObjectSchema which in effect is the MessageDataObjectSchema\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: "createMessageDataObjectSchema",\n value: function createMessageDataObjectSchema(guid, version, objectName, description, language, sourcePackageURL) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined") throw new Error("Invalid parameters!");\n\n return new _DataObjectSchema.DataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL);\n }\n\n /**\n * Create HypertyDataObjectSchema\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object\n * @param {string} version - Indicates the version of Catalogue Data\n * @param {string} objectName - Human-understandable name of the catalogue object\n * @param {string} description\n * @param {DataObjectSourceLanguage} language - Programming language used in the SourcePackage\n * @param {string} sourcePackageURL - URL from where the source code package of the corresponding catalogue object can be downloaded.\n * @param {string} accessControlPolicy - policy rule to access object (see Reporter-Observer Comm pattern)\n * @param {DataUrlScheme} scheme - identifies the data scheme (COMM, CONNECTION, CTXT or IDENTITY)\n * @returns {DataObjectSchema}\n */\n\n }, {\n key: "createHypertyDataObjectSchema",\n value: function createHypertyDataObjectSchema(guid, version, objectName, description, language, sourcePackageURL, accessControlPolicy, scheme) {\n if (typeof guid === "undefined" || typeof version === "undefined" || typeof objectName === "undefined" || typeof description === "undefined" || typeof language === "undefined" || typeof sourcePackageURL === "undefined" || typeof scheme === "undefined" || typeof accessControlPolicy === "undefined") throw new Error("Invalid parameters!");\n\n if (scheme === _DataObjectSchema.DataUrlScheme.COMM) return new _DataObjectSchema.CommunicationDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);else if (scheme === _DataObjectSchema.DataUrlScheme.CONNECTION) return new _DataObjectSchema.ConnectionDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);else if (scheme === _DataObjectSchema.DataUrlScheme.CTXT) return new _DataObjectSchema.ContextDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);else if (scheme === _DataObjectSchema.DataUrlScheme.IDENTITY) return new _DataObjectSchema.IdentityDataObjectSchema(guid, _CatalogueDataObject.CatalogueObjectType.HYPERTY_DATA_OBJECT, version, objectName, description, language, sourcePackageURL, scheme, accessControlPolicy);\n }\n\n /**\n * Create SourcePackage\n * @param sourceCodeClassname - The Class-name of the SourceCode\n * @param sourceCode - The source code of the catalogue object\n * @returns {SourcePackage}\n */\n\n }, {\n key: "createSourcePackage",\n value: function createSourcePackage(sourceCodeClassname, sourceCode) {\n if (typeof sourceCode === "undefined" || typeof sourceCodeClassname === "undefined") throw new Error("Invalid parameters!");\n\n return new _SourcePackage2.default(sourceCodeClassname, sourceCode);\n }\n }]);\n return CatalogueDataObjectFactory;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\nexports.default = CatalogueDataObjectFactory;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU4LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9DYXRhbG9ndWVEYXRhT2JqZWN0RmFjdG9yeS5qcz8yZWQxIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IDIwMTYgUFQgSW5vdmHDp8OjbyBlIFNpc3RlbWFzIFNBXG4gKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuICogQ29weXJpZ2h0IDIwMTYgUVVPQklTIE5FVFdPUktTIFNMXG4gKiBDb3B5cmlnaHQgMjAxNiBGUkFVTkhPRkVSLUdFU0VMTFNDSEFGVCBaVVIgRk9FUkRFUlVORyBERVIgQU5HRVdBTkRURU4gRk9SU0NIVU5HIEUuVlxuICogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4gKiBDb3B5cmlnaHQgMjAxNiBEZXV0c2NoZSBUZWxla29tIEFHXG4gKiBDb3B5cmlnaHQgMjAxNiBBcG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7QUF1QkE7QUFDQTs7O0FBQUE7QUFDQTs7O0FBQUE7QUFDQTs7O0FBQUE7QUFDQTs7O0FBQUE7QUFDQTs7O0FBQUE7QUFDQTs7O0FBQUE7QUFDQTs7O0FBUUE7Ozs7Ozs7OztBQUVBOzs7Ozs7Ozs7OztBQVdBO0FBQ0E7QUFVQTtBQUNBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFjQTtBQUVBO0FBV0E7QUFFQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWtCQTtBQUVBO0FBWUE7QUFFQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWVBO0FBRUE7QUFDQTtBQVVBO0FBRUE7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7Ozs7QUFZQTtBQUVBO0FBQ0E7QUFTQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7Ozs7QUFXQTtBQUNBO0FBQ0E7QUFTQTtBQUVBO0FBQ0E7QUFDQTs7Ozs7Ozs7Ozs7OztBQVVBO0FBQ0E7QUFDQTtBQVNBO0FBRUE7QUFDQTtBQUNBOzs7Ozs7Ozs7Ozs7Ozs7QUFZQTtBQUVBO0FBQ0E7QUFXQTtBQVlBO0FBQ0E7QUFDQTs7Ozs7Ozs7O0FBTUE7QUFDQTtBQUNBO0FBS0E7QUFFQTs7O0FBMVNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTRTQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///558\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\nexports.RethinkObject = undefined;\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _tv = __webpack_require__(560);\n\nvar _tv2 = _interopRequireDefault(_tv);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar RethinkObject = exports.RethinkObject = function () {\n function RethinkObject() {\n (0, _classCallCheck3.default)(this, RethinkObject);\n }\n\n (0, _createClass3.default)(RethinkObject, [{\n key: "validate",\n\n\n /**\n * Validates this RethinkObject against the provided schema.\n *\n * LIMITATIONS: The provided schema cannot contain references to other schemas, since they can\'t be resolved.\n * @param schema - schema to validate against\n * @returns {boolean} true if valid, false otherwise\n */\n value: function validate(schema) {\n // add schema itself so local references work\n _tv2.default.addSchema(schema.id, schema);\n\n // JSON stringify -> parse needed to have proper validation\n var result = _tv2.default.validateMultiple(JSON.parse((0, _stringify2.default)(this)), schema);\n\n // delete error stacks to improve logging\n result.errors.forEach(function (error) {\n delete error.stack;\n });\n\n // print more details about validation if it fails or schema contains $refs\n if (!result.valid || result.missing.length > 0) {\n console.warn("Object validation " + (result.valid ? "succeeded, but schema contained references:" : "failed:"), (0, _stringify2.default)(result, null, 2));\n console.log("Object:", (0, _stringify2.default)(this, null, 2));\n }\n return result.valid;\n }\n }]);\n return RethinkObject;\n}(); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n\nexports.default = RethinkObject;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTU5LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9SZXRoaW5rT2JqZWN0LmpzP2YyOTIiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiAqIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4gKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiAqIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4gKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiAqIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiAqIENvcHlyaWdodCAyMDE2IEFwaXplZVxuICogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJTSVRBVCBCRVJMSU5cbiAqXG4gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgXCJMaWNlbnNlXCIpO1xuICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLlxuICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0XG4gKlxuICogICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0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y9cbi8vIHNyYy9ydW50aW1lLWNhdGFsb2d1ZS9SZXRoaW5rT2JqZWN0LmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBc0JBO0FBQ0E7Ozs7O0FBQ0E7Ozs7Ozs7OztBQUVBOzs7Ozs7O0FBT0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7OztBQW5EQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBdURBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///559\n')},function(module,exports,__webpack_require__){eval('var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\r\nAuthor: Geraint Luff and others\r\nYear: 2013\r\n\r\nThis code is released into the "public domain" by its author(s). Anybody may use, alter and distribute the code without restriction. The author makes no guarantees, and takes no liability of any kind for use of this code.\r\n\r\nIf you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.\r\n*/\r\n(function (global, factory) {\r\n if (true) {\r\n // AMD. Register as an anonymous module.\r\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === \'function\' ?\n\t\t\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\r\n } else if (typeof module !== \'undefined\' && module.exports){\r\n // CommonJS. Define export.\r\n module.exports = factory();\r\n } else {\r\n // Browser globals\r\n global.tv4 = factory();\r\n }\r\n}(this, function () {\r\n\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys\r\nif (!Object.keys) {\r\n\tObject.keys = (function () {\r\n\t\tvar hasOwnProperty = Object.prototype.hasOwnProperty,\r\n\t\t\thasDontEnumBug = !({toString: null}).propertyIsEnumerable(\'toString\'),\r\n\t\t\tdontEnums = [\r\n\t\t\t\t\'toString\',\r\n\t\t\t\t\'toLocaleString\',\r\n\t\t\t\t\'valueOf\',\r\n\t\t\t\t\'hasOwnProperty\',\r\n\t\t\t\t\'isPrototypeOf\',\r\n\t\t\t\t\'propertyIsEnumerable\',\r\n\t\t\t\t\'constructor\'\r\n\t\t\t],\r\n\t\t\tdontEnumsLength = dontEnums.length;\r\n\r\n\t\treturn function (obj) {\r\n\t\t\tif (typeof obj !== \'object\' && typeof obj !== \'function\' || obj === null) {\r\n\t\t\t\tthrow new TypeError(\'Object.keys called on non-object\');\r\n\t\t\t}\r\n\r\n\t\t\tvar result = [];\r\n\r\n\t\t\tfor (var prop in obj) {\r\n\t\t\t\tif (hasOwnProperty.call(obj, prop)) {\r\n\t\t\t\t\tresult.push(prop);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (hasDontEnumBug) {\r\n\t\t\t\tfor (var i=0; i < dontEnumsLength; i++) {\r\n\t\t\t\t\tif (hasOwnProperty.call(obj, dontEnums[i])) {\r\n\t\t\t\t\t\tresult.push(dontEnums[i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t};\r\n\t})();\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create\r\nif (!Object.create) {\r\n\tObject.create = (function(){\r\n\t\tfunction F(){}\r\n\r\n\t\treturn function(o){\r\n\t\t\tif (arguments.length !== 1) {\r\n\t\t\t\tthrow new Error(\'Object.create implementation only accepts one parameter.\');\r\n\t\t\t}\r\n\t\t\tF.prototype = o;\r\n\t\t\treturn new F();\r\n\t\t};\r\n\t})();\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray\r\nif(!Array.isArray) {\r\n\tArray.isArray = function (vArg) {\r\n\t\treturn Object.prototype.toString.call(vArg) === "[object Array]";\r\n\t};\r\n}\r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf\r\nif (!Array.prototype.indexOf) {\r\n\tArray.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\r\n\t\tif (this === null) {\r\n\t\t\tthrow new TypeError();\r\n\t\t}\r\n\t\tvar t = Object(this);\r\n\t\tvar len = t.length >>> 0;\r\n\r\n\t\tif (len === 0) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tvar n = 0;\r\n\t\tif (arguments.length > 1) {\r\n\t\t\tn = Number(arguments[1]);\r\n\t\t\tif (n !== n) { // shortcut for verifying if it\'s NaN\r\n\t\t\t\tn = 0;\r\n\t\t\t} else if (n !== 0 && n !== Infinity && n !== -Infinity) {\r\n\t\t\t\tn = (n > 0 || -1) * Math.floor(Math.abs(n));\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (n >= len) {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\tvar k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\r\n\t\tfor (; k < len; k++) {\r\n\t\t\tif (k in t && t[k] === searchElement) {\r\n\t\t\t\treturn k;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t};\r\n}\r\n\r\n// Grungey Object.isFrozen hack\r\nif (!Object.isFrozen) {\r\n\tObject.isFrozen = function (obj) {\r\n\t\tvar key = "tv4_test_frozen_key";\r\n\t\twhile (obj.hasOwnProperty(key)) {\r\n\t\t\tkey += Math.random();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tobj[key] = true;\r\n\t\t\tdelete obj[key];\r\n\t\t\treturn false;\r\n\t\t} catch (e) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t};\r\n}\r\n// Based on: https://github.com/geraintluff/uri-templates, but with all the de-substitution stuff removed\r\n\r\nvar uriTemplateGlobalModifiers = {\r\n\t"+": true,\r\n\t"#": true,\r\n\t".": true,\r\n\t"/": true,\r\n\t";": true,\r\n\t"?": true,\r\n\t"&": true\r\n};\r\nvar uriTemplateSuffices = {\r\n\t"*": true\r\n};\r\n\r\nfunction notReallyPercentEncode(string) {\r\n\treturn encodeURI(string).replace(/%25[0-9][0-9]/g, function (doubleEncoded) {\r\n\t\treturn "%" + doubleEncoded.substring(3);\r\n\t});\r\n}\r\n\r\nfunction uriTemplateSubstitution(spec) {\r\n\tvar modifier = "";\r\n\tif (uriTemplateGlobalModifiers[spec.charAt(0)]) {\r\n\t\tmodifier = spec.charAt(0);\r\n\t\tspec = spec.substring(1);\r\n\t}\r\n\tvar separator = "";\r\n\tvar prefix = "";\r\n\tvar shouldEscape = true;\r\n\tvar showVariables = false;\r\n\tvar trimEmptyString = false;\r\n\tif (modifier === \'+\') {\r\n\t\tshouldEscape = false;\r\n\t} else if (modifier === ".") {\r\n\t\tprefix = ".";\r\n\t\tseparator = ".";\r\n\t} else if (modifier === "/") {\r\n\t\tprefix = "/";\r\n\t\tseparator = "/";\r\n\t} else if (modifier === \'#\') {\r\n\t\tprefix = "#";\r\n\t\tshouldEscape = false;\r\n\t} else if (modifier === \';\') {\r\n\t\tprefix = ";";\r\n\t\tseparator = ";";\r\n\t\tshowVariables = true;\r\n\t\ttrimEmptyString = true;\r\n\t} else if (modifier === \'?\') {\r\n\t\tprefix = "?";\r\n\t\tseparator = "&";\r\n\t\tshowVariables = true;\r\n\t} else if (modifier === \'&\') {\r\n\t\tprefix = "&";\r\n\t\tseparator = "&";\r\n\t\tshowVariables = true;\r\n\t}\r\n\r\n\tvar varNames = [];\r\n\tvar varList = spec.split(",");\r\n\tvar varSpecs = [];\r\n\tvar varSpecMap = {};\r\n\tfor (var i = 0; i < varList.length; i++) {\r\n\t\tvar varName = varList[i];\r\n\t\tvar truncate = null;\r\n\t\tif (varName.indexOf(":") !== -1) {\r\n\t\t\tvar parts = varName.split(":");\r\n\t\t\tvarName = parts[0];\r\n\t\t\ttruncate = parseInt(parts[1], 10);\r\n\t\t}\r\n\t\tvar suffices = {};\r\n\t\twhile (uriTemplateSuffices[varName.charAt(varName.length - 1)]) {\r\n\t\t\tsuffices[varName.charAt(varName.length - 1)] = true;\r\n\t\t\tvarName = varName.substring(0, varName.length - 1);\r\n\t\t}\r\n\t\tvar varSpec = {\r\n\t\t\ttruncate: truncate,\r\n\t\t\tname: varName,\r\n\t\t\tsuffices: suffices\r\n\t\t};\r\n\t\tvarSpecs.push(varSpec);\r\n\t\tvarSpecMap[varName] = varSpec;\r\n\t\tvarNames.push(varName);\r\n\t}\r\n\tvar subFunction = function (valueFunction) {\r\n\t\tvar result = "";\r\n\t\tvar startIndex = 0;\r\n\t\tfor (var i = 0; i < varSpecs.length; i++) {\r\n\t\t\tvar varSpec = varSpecs[i];\r\n\t\t\tvar value = valueFunction(varSpec.name);\r\n\t\t\tif (value === null || value === undefined || (Array.isArray(value) && value.length === 0) || (typeof value === \'object\' && Object.keys(value).length === 0)) {\r\n\t\t\t\tstartIndex++;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif (i === startIndex) {\r\n\t\t\t\tresult += prefix;\r\n\t\t\t} else {\r\n\t\t\t\tresult += (separator || ",");\r\n\t\t\t}\r\n\t\t\tif (Array.isArray(value)) {\r\n\t\t\t\tif (showVariables) {\r\n\t\t\t\t\tresult += varSpec.name + "=";\r\n\t\t\t\t}\r\n\t\t\t\tfor (var j = 0; j < value.length; j++) {\r\n\t\t\t\t\tif (j > 0) {\r\n\t\t\t\t\t\tresult += varSpec.suffices[\'*\'] ? (separator || ",") : ",";\r\n\t\t\t\t\t\tif (varSpec.suffices[\'*\'] && showVariables) {\r\n\t\t\t\t\t\t\tresult += varSpec.name + "=";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(value[j]).replace(/!/g, "%21") : notReallyPercentEncode(value[j]);\r\n\t\t\t\t}\r\n\t\t\t} else if (typeof value === "object") {\r\n\t\t\t\tif (showVariables && !varSpec.suffices[\'*\']) {\r\n\t\t\t\t\tresult += varSpec.name + "=";\r\n\t\t\t\t}\r\n\t\t\t\tvar first = true;\r\n\t\t\t\tfor (var key in value) {\r\n\t\t\t\t\tif (!first) {\r\n\t\t\t\t\t\tresult += varSpec.suffices[\'*\'] ? (separator || ",") : ",";\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfirst = false;\r\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(key).replace(/!/g, "%21") : notReallyPercentEncode(key);\r\n\t\t\t\t\tresult += varSpec.suffices[\'*\'] ? \'=\' : ",";\r\n\t\t\t\t\tresult += shouldEscape ? encodeURIComponent(value[key]).replace(/!/g, "%21") : notReallyPercentEncode(value[key]);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (showVariables) {\r\n\t\t\t\t\tresult += varSpec.name;\r\n\t\t\t\t\tif (!trimEmptyString || value !== "") {\r\n\t\t\t\t\t\tresult += "=";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (varSpec.truncate != null) {\r\n\t\t\t\t\tvalue = value.substring(0, varSpec.truncate);\r\n\t\t\t\t}\r\n\t\t\t\tresult += shouldEscape ? encodeURIComponent(value).replace(/!/g, "%21"): notReallyPercentEncode(value);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\tsubFunction.varNames = varNames;\r\n\treturn {\r\n\t\tprefix: prefix,\r\n\t\tsubstitution: subFunction\r\n\t};\r\n}\r\n\r\nfunction UriTemplate(template) {\r\n\tif (!(this instanceof UriTemplate)) {\r\n\t\treturn new UriTemplate(template);\r\n\t}\r\n\tvar parts = template.split("{");\r\n\tvar textParts = [parts.shift()];\r\n\tvar prefixes = [];\r\n\tvar substitutions = [];\r\n\tvar varNames = [];\r\n\twhile (parts.length > 0) {\r\n\t\tvar part = parts.shift();\r\n\t\tvar spec = part.split("}")[0];\r\n\t\tvar remainder = part.substring(spec.length + 1);\r\n\t\tvar funcs = uriTemplateSubstitution(spec);\r\n\t\tsubstitutions.push(funcs.substitution);\r\n\t\tprefixes.push(funcs.prefix);\r\n\t\ttextParts.push(remainder);\r\n\t\tvarNames = varNames.concat(funcs.substitution.varNames);\r\n\t}\r\n\tthis.fill = function (valueFunction) {\r\n\t\tvar result = textParts[0];\r\n\t\tfor (var i = 0; i < substitutions.length; i++) {\r\n\t\t\tvar substitution = substitutions[i];\r\n\t\t\tresult += substitution(valueFunction);\r\n\t\t\tresult += textParts[i + 1];\r\n\t\t}\r\n\t\treturn result;\r\n\t};\r\n\tthis.varNames = varNames;\r\n\tthis.template = template;\r\n}\r\nUriTemplate.prototype = {\r\n\ttoString: function () {\r\n\t\treturn this.template;\r\n\t},\r\n\tfillFromObject: function (obj) {\r\n\t\treturn this.fill(function (varName) {\r\n\t\t\treturn obj[varName];\r\n\t\t});\r\n\t}\r\n};\r\nvar ValidatorContext = function ValidatorContext(parent, collectMultiple, errorReporter, checkRecursive, trackUnknownProperties) {\r\n\tthis.missing = [];\r\n\tthis.missingMap = {};\r\n\tthis.formatValidators = parent ? Object.create(parent.formatValidators) : {};\r\n\tthis.schemas = parent ? Object.create(parent.schemas) : {};\r\n\tthis.collectMultiple = collectMultiple;\r\n\tthis.errors = [];\r\n\tthis.handleError = collectMultiple ? this.collectError : this.returnError;\r\n\tif (checkRecursive) {\r\n\t\tthis.checkRecursive = true;\r\n\t\tthis.scanned = [];\r\n\t\tthis.scannedFrozen = [];\r\n\t\tthis.scannedFrozenSchemas = [];\r\n\t\tthis.scannedFrozenValidationErrors = [];\r\n\t\tthis.validatedSchemasKey = \'tv4_validation_id\';\r\n\t\tthis.validationErrorsKey = \'tv4_validation_errors_id\';\r\n\t}\r\n\tif (trackUnknownProperties) {\r\n\t\tthis.trackUnknownProperties = true;\r\n\t\tthis.knownPropertyPaths = {};\r\n\t\tthis.unknownPropertyPaths = {};\r\n\t}\r\n\tthis.errorReporter = errorReporter || defaultErrorReporter(\'en\');\r\n\tif (typeof this.errorReporter === \'string\') {\r\n\t\tthrow new Error(\'debug\');\r\n\t}\r\n\tthis.definedKeywords = {};\r\n\tif (parent) {\r\n\t\tfor (var key in parent.definedKeywords) {\r\n\t\t\tthis.definedKeywords[key] = parent.definedKeywords[key].slice(0);\r\n\t\t}\r\n\t}\r\n};\r\nValidatorContext.prototype.defineKeyword = function (keyword, keywordFunction) {\r\n\tthis.definedKeywords[keyword] = this.definedKeywords[keyword] || [];\r\n\tthis.definedKeywords[keyword].push(keywordFunction);\r\n};\r\nValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors, data, schema) {\r\n\tvar error = new ValidationError(code, messageParams, dataPath, schemaPath, subErrors);\r\n\terror.message = this.errorReporter(error, data, schema);\r\n\treturn error;\r\n};\r\nValidatorContext.prototype.returnError = function (error) {\r\n\treturn error;\r\n};\r\nValidatorContext.prototype.collectError = function (error) {\r\n\tif (error) {\r\n\t\tthis.errors.push(error);\r\n\t}\r\n\treturn null;\r\n};\r\nValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) {\r\n\tfor (var i = startIndex; i < this.errors.length; i++) {\r\n\t\tthis.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath);\r\n\t}\r\n\treturn this;\r\n};\r\nValidatorContext.prototype.banUnknownProperties = function (data, schema) {\r\n\tfor (var unknownPath in this.unknownPropertyPaths) {\r\n\t\tvar error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, "", null, data, schema);\r\n\t\tvar result = this.handleError(error);\r\n\t\tif (result) {\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.addFormat = function (format, validator) {\r\n\tif (typeof format === \'object\') {\r\n\t\tfor (var key in format) {\r\n\t\t\tthis.addFormat(key, format[key]);\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n\tthis.formatValidators[format] = validator;\r\n};\r\nValidatorContext.prototype.resolveRefs = function (schema, urlHistory) {\r\n\tif (schema[\'$ref\'] !== undefined) {\r\n\t\turlHistory = urlHistory || {};\r\n\t\tif (urlHistory[schema[\'$ref\']]) {\r\n\t\t\treturn this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(\', \')}, \'\', \'\', null, undefined, schema);\r\n\t\t}\r\n\t\turlHistory[schema[\'$ref\']] = true;\r\n\t\tschema = this.getSchema(schema[\'$ref\'], urlHistory);\r\n\t}\r\n\treturn schema;\r\n};\r\nValidatorContext.prototype.getSchema = function (url, urlHistory) {\r\n\tvar schema;\r\n\tif (this.schemas[url] !== undefined) {\r\n\t\tschema = this.schemas[url];\r\n\t\treturn this.resolveRefs(schema, urlHistory);\r\n\t}\r\n\tvar baseUrl = url;\r\n\tvar fragment = "";\r\n\tif (url.indexOf(\'#\') !== -1) {\r\n\t\tfragment = url.substring(url.indexOf("#") + 1);\r\n\t\tbaseUrl = url.substring(0, url.indexOf("#"));\r\n\t}\r\n\tif (typeof this.schemas[baseUrl] === \'object\') {\r\n\t\tschema = this.schemas[baseUrl];\r\n\t\tvar pointerPath = decodeURIComponent(fragment);\r\n\t\tif (pointerPath === "") {\r\n\t\t\treturn this.resolveRefs(schema, urlHistory);\r\n\t\t} else if (pointerPath.charAt(0) !== "/") {\r\n\t\t\treturn undefined;\r\n\t\t}\r\n\t\tvar parts = pointerPath.split("/").slice(1);\r\n\t\tfor (var i = 0; i < parts.length; i++) {\r\n\t\t\tvar component = parts[i].replace(/~1/g, "/").replace(/~0/g, "~");\r\n\t\t\tif (schema[component] === undefined) {\r\n\t\t\t\tschema = undefined;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tschema = schema[component];\r\n\t\t}\r\n\t\tif (schema !== undefined) {\r\n\t\t\treturn this.resolveRefs(schema, urlHistory);\r\n\t\t}\r\n\t}\r\n\tif (this.missing[baseUrl] === undefined) {\r\n\t\tthis.missing.push(baseUrl);\r\n\t\tthis.missing[baseUrl] = baseUrl;\r\n\t\tthis.missingMap[baseUrl] = baseUrl;\r\n\t}\r\n};\r\nValidatorContext.prototype.searchSchemas = function (schema, url) {\r\n\tif (Array.isArray(schema)) {\r\n\t\tfor (var i = 0; i < schema.length; i++) {\r\n\t\t\tthis.searchSchemas(schema[i], url);\r\n\t\t}\r\n\t} else if (schema && typeof schema === "object") {\r\n\t\tif (typeof schema.id === "string") {\r\n\t\t\tif (isTrustedUrl(url, schema.id)) {\r\n\t\t\t\tif (this.schemas[schema.id] === undefined) {\r\n\t\t\t\t\tthis.schemas[schema.id] = schema;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (var key in schema) {\r\n\t\t\tif (key !== "enum") {\r\n\t\t\t\tif (typeof schema[key] === "object") {\r\n\t\t\t\t\tthis.searchSchemas(schema[key], url);\r\n\t\t\t\t} else if (key === "$ref") {\r\n\t\t\t\t\tvar uri = getDocumentUri(schema[key]);\r\n\t\t\t\t\tif (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) {\r\n\t\t\t\t\t\tthis.missingMap[uri] = uri;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\nValidatorContext.prototype.addSchema = function (url, schema) {\r\n\t//overload\r\n\tif (typeof url !== \'string\' || typeof schema === \'undefined\') {\r\n\t\tif (typeof url === \'object\' && typeof url.id === \'string\') {\r\n\t\t\tschema = url;\r\n\t\t\turl = schema.id;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\tif (url === getDocumentUri(url) + "#") {\r\n\t\t// Remove empty fragment\r\n\t\turl = getDocumentUri(url);\r\n\t}\r\n\tthis.schemas[url] = schema;\r\n\tdelete this.missingMap[url];\r\n\tnormSchema(schema, url);\r\n\tthis.searchSchemas(schema, url);\r\n};\r\n\r\nValidatorContext.prototype.getSchemaMap = function () {\r\n\tvar map = {};\r\n\tfor (var key in this.schemas) {\r\n\t\tmap[key] = this.schemas[key];\r\n\t}\r\n\treturn map;\r\n};\r\n\r\nValidatorContext.prototype.getSchemaUris = function (filterRegExp) {\r\n\tvar list = [];\r\n\tfor (var key in this.schemas) {\r\n\t\tif (!filterRegExp || filterRegExp.test(key)) {\r\n\t\t\tlist.push(key);\r\n\t\t}\r\n\t}\r\n\treturn list;\r\n};\r\n\r\nValidatorContext.prototype.getMissingUris = function (filterRegExp) {\r\n\tvar list = [];\r\n\tfor (var key in this.missingMap) {\r\n\t\tif (!filterRegExp || filterRegExp.test(key)) {\r\n\t\t\tlist.push(key);\r\n\t\t}\r\n\t}\r\n\treturn list;\r\n};\r\n\r\nValidatorContext.prototype.dropSchemas = function () {\r\n\tthis.schemas = {};\r\n\tthis.reset();\r\n};\r\nValidatorContext.prototype.reset = function () {\r\n\tthis.missing = [];\r\n\tthis.missingMap = {};\r\n\tthis.errors = [];\r\n};\r\n\r\nValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) {\r\n\tvar topLevel;\r\n\tschema = this.resolveRefs(schema);\r\n\tif (!schema) {\r\n\t\treturn null;\r\n\t} else if (schema instanceof ValidationError) {\r\n\t\tthis.errors.push(schema);\r\n\t\treturn schema;\r\n\t}\r\n\r\n\tvar startErrorCount = this.errors.length;\r\n\tvar frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null;\r\n\tif (this.checkRecursive && data && typeof data === \'object\') {\r\n\t\ttopLevel = !this.scanned.length;\r\n\t\tif (data[this.validatedSchemasKey]) {\r\n\t\t\tvar schemaIndex = data[this.validatedSchemasKey].indexOf(schema);\r\n\t\t\tif (schemaIndex !== -1) {\r\n\t\t\t\tthis.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (Object.isFrozen(data)) {\r\n\t\t\tfrozenIndex = this.scannedFrozen.indexOf(data);\r\n\t\t\tif (frozenIndex !== -1) {\r\n\t\t\t\tvar frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema);\r\n\t\t\t\tif (frozenSchemaIndex !== -1) {\r\n\t\t\t\t\tthis.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]);\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.scanned.push(data);\r\n\t\tif (Object.isFrozen(data)) {\r\n\t\t\tif (frozenIndex === -1) {\r\n\t\t\t\tfrozenIndex = this.scannedFrozen.length;\r\n\t\t\t\tthis.scannedFrozen.push(data);\r\n\t\t\t\tthis.scannedFrozenSchemas.push([]);\r\n\t\t\t}\r\n\t\t\tscannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length;\r\n\t\t\tthis.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema;\r\n\t\t\tthis.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = [];\r\n\t\t} else {\r\n\t\t\tif (!data[this.validatedSchemasKey]) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tObject.defineProperty(data, this.validatedSchemasKey, {\r\n\t\t\t\t\t\tvalue: [],\r\n\t\t\t\t\t\tconfigurable: true\r\n\t\t\t\t\t});\r\n\t\t\t\t\tObject.defineProperty(data, this.validationErrorsKey, {\r\n\t\t\t\t\t\tvalue: [],\r\n\t\t\t\t\t\tconfigurable: true\r\n\t\t\t\t\t});\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\t//IE 7/8 workaround\r\n\t\t\t\t\tdata[this.validatedSchemasKey] = [];\r\n\t\t\t\t\tdata[this.validationErrorsKey] = [];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tscannedSchemasIndex = data[this.validatedSchemasKey].length;\r\n\t\t\tdata[this.validatedSchemasKey][scannedSchemasIndex] = schema;\r\n\t\t\tdata[this.validationErrorsKey][scannedSchemasIndex] = [];\r\n\t\t}\r\n\t}\r\n\r\n\tvar errorCount = this.errors.length;\r\n\tvar error = this.validateBasic(data, schema, dataPointerPath)\r\n\t\t|| this.validateNumeric(data, schema, dataPointerPath)\r\n\t\t|| this.validateString(data, schema, dataPointerPath)\r\n\t\t|| this.validateArray(data, schema, dataPointerPath)\r\n\t\t|| this.validateObject(data, schema, dataPointerPath)\r\n\t\t|| this.validateCombinations(data, schema, dataPointerPath)\r\n\t\t|| this.validateHypermedia(data, schema, dataPointerPath)\r\n\t\t|| this.validateFormat(data, schema, dataPointerPath)\r\n\t\t|| this.validateDefinedKeywords(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n\r\n\tif (topLevel) {\r\n\t\twhile (this.scanned.length) {\r\n\t\t\tvar item = this.scanned.pop();\r\n\t\t\tdelete item[this.validatedSchemasKey];\r\n\t\t}\r\n\t\tthis.scannedFrozen = [];\r\n\t\tthis.scannedFrozenSchemas = [];\r\n\t}\r\n\r\n\tif (error || errorCount !== this.errors.length) {\r\n\t\twhile ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) {\r\n\t\t\tvar dataPart = (dataPathParts && dataPathParts.length) ? "" + dataPathParts.pop() : null;\r\n\t\t\tvar schemaPart = (schemaPathParts && schemaPathParts.length) ? "" + schemaPathParts.pop() : null;\r\n\t\t\tif (error) {\r\n\t\t\t\terror = error.prefixWith(dataPart, schemaPart);\r\n\t\t\t}\r\n\t\t\tthis.prefixErrors(errorCount, dataPart, schemaPart);\r\n\t\t}\r\n\t}\r\n\r\n\tif (scannedFrozenSchemaIndex !== null) {\r\n\t\tthis.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount);\r\n\t} else if (scannedSchemasIndex !== null) {\r\n\t\tdata[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount);\r\n\t}\r\n\r\n\treturn this.handleError(error);\r\n};\r\nValidatorContext.prototype.validateFormat = function (data, schema) {\r\n\tif (typeof schema.format !== \'string\' || !this.formatValidators[schema.format]) {\r\n\t\treturn null;\r\n\t}\r\n\tvar errorMessage = this.formatValidators[schema.format].call(null, data, schema);\r\n\tif (typeof errorMessage === \'string\' || typeof errorMessage === \'number\') {\r\n\t\treturn this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}, \'\', \'/format\', null, data, schema);\r\n\t} else if (errorMessage && typeof errorMessage === \'object\') {\r\n\t\treturn this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || "?"}, errorMessage.dataPath || \'\', errorMessage.schemaPath || "/format", null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\nValidatorContext.prototype.validateDefinedKeywords = function (data, schema, dataPointerPath) {\r\n\tfor (var key in this.definedKeywords) {\r\n\t\tif (typeof schema[key] === \'undefined\') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar validationFunctions = this.definedKeywords[key];\r\n\t\tfor (var i = 0; i < validationFunctions.length; i++) {\r\n\t\t\tvar func = validationFunctions[i];\r\n\t\t\tvar result = func(data, schema[key], schema, dataPointerPath);\r\n\t\t\tif (typeof result === \'string\' || typeof result === \'number\') {\r\n\t\t\t\treturn this.createError(ErrorCodes.KEYWORD_CUSTOM, {key: key, message: result}, \'\', \'\', null, data, schema).prefixWith(null, key);\r\n\t\t\t} else if (result && typeof result === \'object\') {\r\n\t\t\t\tvar code = result.code;\r\n\t\t\t\tif (typeof code === \'string\') {\r\n\t\t\t\t\tif (!ErrorCodes[code]) {\r\n\t\t\t\t\t\tthrow new Error(\'Undefined error code (use defineError): \' + code);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcode = ErrorCodes[code];\r\n\t\t\t\t} else if (typeof code !== \'number\') {\r\n\t\t\t\t\tcode = ErrorCodes.KEYWORD_CUSTOM;\r\n\t\t\t\t}\r\n\t\t\t\tvar messageParams = (typeof result.message === \'object\') ? result.message : {key: key, message: result.message || "?"};\r\n\t\t\t\tvar schemaPath = result.schemaPath || ("/" + key.replace(/~/g, \'~0\').replace(/\\//g, \'~1\'));\r\n\t\t\t\treturn this.createError(code, messageParams, result.dataPath || null, schemaPath, null, data, schema);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nfunction recursiveCompare(A, B) {\r\n\tif (A === B) {\r\n\t\treturn true;\r\n\t}\r\n\tif (A && B && typeof A === "object" && typeof B === "object") {\r\n\t\tif (Array.isArray(A) !== Array.isArray(B)) {\r\n\t\t\treturn false;\r\n\t\t} else if (Array.isArray(A)) {\r\n\t\t\tif (A.length !== B.length) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tfor (var i = 0; i < A.length; i++) {\r\n\t\t\t\tif (!recursiveCompare(A[i], B[i])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tvar key;\r\n\t\t\tfor (key in A) {\r\n\t\t\t\tif (B[key] === undefined && A[key] !== undefined) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (key in B) {\r\n\t\t\t\tif (A[key] === undefined && B[key] !== undefined) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (key in A) {\r\n\t\t\t\tif (!recursiveCompare(A[key], B[key])) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) {\r\n\tvar error;\r\n\tif (error = this.validateType(data, schema, dataPointerPath)) {\r\n\t\treturn error.prefixWith(null, "type");\r\n\t}\r\n\tif (error = this.validateEnum(data, schema, dataPointerPath)) {\r\n\t\treturn error.prefixWith(null, "type");\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateType = function validateType(data, schema) {\r\n\tif (schema.type === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar dataType = typeof data;\r\n\tif (data === null) {\r\n\t\tdataType = "null";\r\n\t} else if (Array.isArray(data)) {\r\n\t\tdataType = "array";\r\n\t}\r\n\tvar allowedTypes = schema.type;\r\n\tif (!Array.isArray(allowedTypes)) {\r\n\t\tallowedTypes = [allowedTypes];\r\n\t}\r\n\r\n\tfor (var i = 0; i < allowedTypes.length; i++) {\r\n\t\tvar type = allowedTypes[i];\r\n\t\tif (type === dataType || (type === "integer" && dataType === "number" && (data % 1 === 0))) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\treturn this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join("/")}, \'\', \'\', null, data, schema);\r\n};\r\n\r\nValidatorContext.prototype.validateEnum = function validateEnum(data, schema) {\r\n\tif (schema["enum"] === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tfor (var i = 0; i < schema["enum"].length; i++) {\r\n\t\tvar enumVal = schema["enum"][i];\r\n\t\tif (recursiveCompare(data, enumVal)) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n\treturn this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== \'undefined\') ? JSON.stringify(data) : data}, \'\', \'\', null, data, schema);\r\n};\r\n\r\nValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) {\r\n\treturn this.validateMultipleOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateMinMax(data, schema, dataPointerPath)\r\n\t\t|| this.validateNaN(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nvar CLOSE_ENOUGH_LOW = Math.pow(2, -51);\r\nvar CLOSE_ENOUGH_HIGH = 1 - CLOSE_ENOUGH_LOW;\r\nValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) {\r\n\tvar multipleOf = schema.multipleOf || schema.divisibleBy;\r\n\tif (multipleOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tif (typeof data === "number") {\r\n\t\tvar remainder = (data/multipleOf)%1;\r\n\t\tif (remainder >= CLOSE_ENOUGH_LOW && remainder < CLOSE_ENOUGH_HIGH) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf}, \'\', \'\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) {\r\n\tif (typeof data !== "number") {\r\n\t\treturn null;\r\n\t}\r\n\tif (schema.minimum !== undefined) {\r\n\t\tif (data < schema.minimum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}, \'\', \'/minimum\', null, data, schema);\r\n\t\t}\r\n\t\tif (schema.exclusiveMinimum && data === schema.minimum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}, \'\', \'/exclusiveMinimum\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\tif (schema.maximum !== undefined) {\r\n\t\tif (data > schema.maximum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}, \'\', \'/maximum\', null, data, schema);\r\n\t\t}\r\n\t\tif (schema.exclusiveMaximum && data === schema.maximum) {\r\n\t\t\treturn this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}, \'\', \'/exclusiveMaximum\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateNaN = function validateNaN(data, schema) {\r\n\tif (typeof data !== "number") {\r\n\t\treturn null;\r\n\t}\r\n\tif (isNaN(data) === true || data === Infinity || data === -Infinity) {\r\n\t\treturn this.createError(ErrorCodes.NUMBER_NOT_A_NUMBER, {value: data}, \'\', \'/type\', null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) {\r\n\treturn this.validateStringLength(data, schema, dataPointerPath)\r\n\t\t|| this.validateStringPattern(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) {\r\n\tif (typeof data !== "string") {\r\n\t\treturn null;\r\n\t}\r\n\tif (schema.minLength !== undefined) {\r\n\t\tif (data.length < schema.minLength) {\r\n\t\t\treturn this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}, \'\', \'/minLength\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\tif (schema.maxLength !== undefined) {\r\n\t\tif (data.length > schema.maxLength) {\r\n\t\t\treturn this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}, \'\', \'/maxLength\', null, data, schema);\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) {\r\n\tif (typeof data !== "string" || (typeof schema.pattern !== "string" && !(schema.pattern instanceof RegExp))) {\r\n\t\treturn null;\r\n\t}\r\n\tvar regexp;\r\n\tif (schema.pattern instanceof RegExp) {\r\n\t regexp = schema.pattern;\r\n\t}\r\n\telse {\r\n\t var body, flags = \'\';\r\n\t // Check for regular expression literals\r\n\t // @see http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.5\r\n\t var literal = schema.pattern.match(/^\\/(.+)\\/([img]*)$/);\r\n\t if (literal) {\r\n\t body = literal[1];\r\n\t flags = literal[2];\r\n\t }\r\n\t else {\r\n\t body = schema.pattern;\r\n\t }\r\n\t regexp = new RegExp(body, flags);\r\n\t}\r\n\tif (!regexp.test(data)) {\r\n\t\treturn this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}, \'\', \'/pattern\', null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) {\r\n\tif (!Array.isArray(data)) {\r\n\t\treturn null;\r\n\t}\r\n\treturn this.validateArrayLength(data, schema, dataPointerPath)\r\n\t\t|| this.validateArrayUniqueItems(data, schema, dataPointerPath)\r\n\t\t|| this.validateArrayItems(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) {\r\n\tvar error;\r\n\tif (schema.minItems !== undefined) {\r\n\t\tif (data.length < schema.minItems) {\r\n\t\t\terror = this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems}, \'\', \'/minItems\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (schema.maxItems !== undefined) {\r\n\t\tif (data.length > schema.maxItems) {\r\n\t\t\terror = this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems}, \'\', \'/maxItems\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) {\r\n\tif (schema.uniqueItems) {\r\n\t\tfor (var i = 0; i < data.length; i++) {\r\n\t\t\tfor (var j = i + 1; j < data.length; j++) {\r\n\t\t\t\tif (recursiveCompare(data[i], data[j])) {\r\n\t\t\t\t\tvar error = this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j}, \'\', \'/uniqueItems\', null, data, schema);\r\n\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) {\r\n\tif (schema.items === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar error, i;\r\n\tif (Array.isArray(schema.items)) {\r\n\t\tfor (i = 0; i < data.length; i++) {\r\n\t\t\tif (i < schema.items.length) {\r\n\t\t\t\tif (error = this.validateAll(data[i], schema.items[i], [i], ["items", i], dataPointerPath + "/" + i)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t} else if (schema.additionalItems !== undefined) {\r\n\t\t\t\tif (typeof schema.additionalItems === "boolean") {\r\n\t\t\t\t\tif (!schema.additionalItems) {\r\n\t\t\t\t\t\terror = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {}, \'/\' + i, \'/additionalItems\', null, data, schema));\r\n\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (error = this.validateAll(data[i], schema.additionalItems, [i], ["additionalItems"], dataPointerPath + "/" + i)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tfor (i = 0; i < data.length; i++) {\r\n\t\t\tif (error = this.validateAll(data[i], schema.items, [i], ["items"], dataPointerPath + "/" + i)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) {\r\n\tif (typeof data !== "object" || data === null || Array.isArray(data)) {\r\n\t\treturn null;\r\n\t}\r\n\treturn this.validateObjectMinMaxProperties(data, schema, dataPointerPath)\r\n\t\t|| this.validateObjectRequiredProperties(data, schema, dataPointerPath)\r\n\t\t|| this.validateObjectProperties(data, schema, dataPointerPath)\r\n\t\t|| this.validateObjectDependencies(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) {\r\n\tvar keys = Object.keys(data);\r\n\tvar error;\r\n\tif (schema.minProperties !== undefined) {\r\n\t\tif (keys.length < schema.minProperties) {\r\n\t\t\terror = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}, \'\', \'/minProperties\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tif (schema.maxProperties !== undefined) {\r\n\t\tif (keys.length > schema.maxProperties) {\r\n\t\t\terror = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}, \'\', \'/maxProperties\', null, data, schema);\r\n\t\t\tif (this.handleError(error)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) {\r\n\tif (schema.required !== undefined) {\r\n\t\tfor (var i = 0; i < schema.required.length; i++) {\r\n\t\t\tvar key = schema.required[i];\r\n\t\t\tif (data[key] === undefined) {\r\n\t\t\t\tvar error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}, \'\', \'/required/\' + i, null, data, schema);\r\n\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) {\r\n\tvar error;\r\n\tfor (var key in data) {\r\n\t\tvar keyPointerPath = dataPointerPath + "/" + key.replace(/~/g, \'~0\').replace(/\\//g, \'~1\');\r\n\t\tvar foundMatch = false;\r\n\t\tif (schema.properties !== undefined && schema.properties[key] !== undefined) {\r\n\t\t\tfoundMatch = true;\r\n\t\t\tif (error = this.validateAll(data[key], schema.properties[key], [key], ["properties", key], keyPointerPath)) {\r\n\t\t\t\treturn error;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (schema.patternProperties !== undefined) {\r\n\t\t\tfor (var patternKey in schema.patternProperties) {\r\n\t\t\t\tvar regexp = new RegExp(patternKey);\r\n\t\t\t\tif (regexp.test(key)) {\r\n\t\t\t\t\tfoundMatch = true;\r\n\t\t\t\t\tif (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], ["patternProperties", patternKey], keyPointerPath)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (!foundMatch) {\r\n\t\t\tif (schema.additionalProperties !== undefined) {\r\n\t\t\t\tif (this.trackUnknownProperties) {\r\n\t\t\t\t\tthis.knownPropertyPaths[keyPointerPath] = true;\r\n\t\t\t\t\tdelete this.unknownPropertyPaths[keyPointerPath];\r\n\t\t\t\t}\r\n\t\t\t\tif (typeof schema.additionalProperties === "boolean") {\r\n\t\t\t\t\tif (!schema.additionalProperties) {\r\n\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {key: key}, \'\', \'/additionalProperties\', null, data, schema).prefixWith(key, null);\r\n\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (error = this.validateAll(data[key], schema.additionalProperties, [key], ["additionalProperties"], keyPointerPath)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) {\r\n\t\t\t\tthis.unknownPropertyPaths[keyPointerPath] = true;\r\n\t\t\t}\r\n\t\t} else if (this.trackUnknownProperties) {\r\n\t\t\tthis.knownPropertyPaths[keyPointerPath] = true;\r\n\t\t\tdelete this.unknownPropertyPaths[keyPointerPath];\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) {\r\n\tvar error;\r\n\tif (schema.dependencies !== undefined) {\r\n\t\tfor (var depKey in schema.dependencies) {\r\n\t\t\tif (data[depKey] !== undefined) {\r\n\t\t\t\tvar dep = schema.dependencies[depKey];\r\n\t\t\t\tif (typeof dep === "string") {\r\n\t\t\t\t\tif (data[dep] === undefined) {\r\n\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}, \'\', \'\', null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies");\r\n\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else if (Array.isArray(dep)) {\r\n\t\t\t\t\tfor (var i = 0; i < dep.length; i++) {\r\n\t\t\t\t\t\tvar requiredKey = dep[i];\r\n\t\t\t\t\t\tif (data[requiredKey] === undefined) {\r\n\t\t\t\t\t\t\terror = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}, \'\', \'/\' + i, null, data, schema).prefixWith(null, depKey).prefixWith(null, "dependencies");\r\n\t\t\t\t\t\t\tif (this.handleError(error)) {\r\n\t\t\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (error = this.validateAll(data, dep, [], ["dependencies", depKey], dataPointerPath)) {\r\n\t\t\t\t\t\treturn error;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) {\r\n\treturn this.validateAllOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateAnyOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateOneOf(data, schema, dataPointerPath)\r\n\t\t|| this.validateNot(data, schema, dataPointerPath)\r\n\t\t|| null;\r\n};\r\n\r\nValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) {\r\n\tif (schema.allOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar error;\r\n\tfor (var i = 0; i < schema.allOf.length; i++) {\r\n\t\tvar subSchema = schema.allOf[i];\r\n\t\tif (error = this.validateAll(data, subSchema, [], ["allOf", i], dataPointerPath)) {\r\n\t\t\treturn error;\r\n\t\t}\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) {\r\n\tif (schema.anyOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar errors = [];\r\n\tvar startErrorCount = this.errors.length;\r\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\r\n\tif (this.trackUnknownProperties) {\r\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\r\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\r\n\t}\r\n\tvar errorAtEnd = true;\r\n\tfor (var i = 0; i < schema.anyOf.length; i++) {\r\n\t\tif (this.trackUnknownProperties) {\r\n\t\t\tthis.unknownPropertyPaths = {};\r\n\t\t\tthis.knownPropertyPaths = {};\r\n\t\t}\r\n\t\tvar subSchema = schema.anyOf[i];\r\n\r\n\t\tvar errorCount = this.errors.length;\r\n\t\tvar error = this.validateAll(data, subSchema, [], ["anyOf", i], dataPointerPath);\r\n\r\n\t\tif (error === null && errorCount === this.errors.length) {\r\n\t\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\r\n\t\t\tif (this.trackUnknownProperties) {\r\n\t\t\t\tfor (var knownKey in this.knownPropertyPaths) {\r\n\t\t\t\t\toldKnownPropertyPaths[knownKey] = true;\r\n\t\t\t\t\tdelete oldUnknownPropertyPaths[knownKey];\r\n\t\t\t\t}\r\n\t\t\t\tfor (var unknownKey in this.unknownPropertyPaths) {\r\n\t\t\t\t\tif (!oldKnownPropertyPaths[unknownKey]) {\r\n\t\t\t\t\t\toldUnknownPropertyPaths[unknownKey] = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// We need to continue looping so we catch all the property definitions, but we don\'t want to return an error\r\n\t\t\t\terrorAtEnd = false;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tif (error) {\r\n\t\t\terrors.push(error.prefixWith(null, "" + i).prefixWith(null, "anyOf"));\r\n\t\t}\r\n\t}\r\n\tif (this.trackUnknownProperties) {\r\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\r\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\r\n\t}\r\n\tif (errorAtEnd) {\r\n\t\terrors = errors.concat(this.errors.slice(startErrorCount));\r\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t\treturn this.createError(ErrorCodes.ANY_OF_MISSING, {}, "", "/anyOf", errors, data, schema);\r\n\t}\r\n};\r\n\r\nValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) {\r\n\tif (schema.oneOf === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar validIndex = null;\r\n\tvar errors = [];\r\n\tvar startErrorCount = this.errors.length;\r\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\r\n\tif (this.trackUnknownProperties) {\r\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\r\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\r\n\t}\r\n\tfor (var i = 0; i < schema.oneOf.length; i++) {\r\n\t\tif (this.trackUnknownProperties) {\r\n\t\t\tthis.unknownPropertyPaths = {};\r\n\t\t\tthis.knownPropertyPaths = {};\r\n\t\t}\r\n\t\tvar subSchema = schema.oneOf[i];\r\n\r\n\t\tvar errorCount = this.errors.length;\r\n\t\tvar error = this.validateAll(data, subSchema, [], ["oneOf", i], dataPointerPath);\r\n\r\n\t\tif (error === null && errorCount === this.errors.length) {\r\n\t\t\tif (validIndex === null) {\r\n\t\t\t\tvalidIndex = i;\r\n\t\t\t} else {\r\n\t\t\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t\t\t\treturn this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, "", "/oneOf", null, data, schema);\r\n\t\t\t}\r\n\t\t\tif (this.trackUnknownProperties) {\r\n\t\t\t\tfor (var knownKey in this.knownPropertyPaths) {\r\n\t\t\t\t\toldKnownPropertyPaths[knownKey] = true;\r\n\t\t\t\t\tdelete oldUnknownPropertyPaths[knownKey];\r\n\t\t\t\t}\r\n\t\t\t\tfor (var unknownKey in this.unknownPropertyPaths) {\r\n\t\t\t\t\tif (!oldKnownPropertyPaths[unknownKey]) {\r\n\t\t\t\t\t\toldUnknownPropertyPaths[unknownKey] = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else if (error) {\r\n\t\t\terrors.push(error);\r\n\t\t}\r\n\t}\r\n\tif (this.trackUnknownProperties) {\r\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\r\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\r\n\t}\r\n\tif (validIndex === null) {\r\n\t\terrors = errors.concat(this.errors.slice(startErrorCount));\r\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t\treturn this.createError(ErrorCodes.ONE_OF_MISSING, {}, "", "/oneOf", errors, data, schema);\r\n\t} else {\r\n\t\tthis.errors = this.errors.slice(0, startErrorCount);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) {\r\n\tif (schema.not === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\tvar oldErrorCount = this.errors.length;\r\n\tvar oldUnknownPropertyPaths, oldKnownPropertyPaths;\r\n\tif (this.trackUnknownProperties) {\r\n\t\toldUnknownPropertyPaths = this.unknownPropertyPaths;\r\n\t\toldKnownPropertyPaths = this.knownPropertyPaths;\r\n\t\tthis.unknownPropertyPaths = {};\r\n\t\tthis.knownPropertyPaths = {};\r\n\t}\r\n\tvar error = this.validateAll(data, schema.not, null, null, dataPointerPath);\r\n\tvar notErrors = this.errors.slice(oldErrorCount);\r\n\tthis.errors = this.errors.slice(0, oldErrorCount);\r\n\tif (this.trackUnknownProperties) {\r\n\t\tthis.unknownPropertyPaths = oldUnknownPropertyPaths;\r\n\t\tthis.knownPropertyPaths = oldKnownPropertyPaths;\r\n\t}\r\n\tif (error === null && notErrors.length === 0) {\r\n\t\treturn this.createError(ErrorCodes.NOT_PASSED, {}, "", "/not", null, data, schema);\r\n\t}\r\n\treturn null;\r\n};\r\n\r\nValidatorContext.prototype.validateHypermedia = function validateCombinations(data, schema, dataPointerPath) {\r\n\tif (!schema.links) {\r\n\t\treturn null;\r\n\t}\r\n\tvar error;\r\n\tfor (var i = 0; i < schema.links.length; i++) {\r\n\t\tvar ldo = schema.links[i];\r\n\t\tif (ldo.rel === "describedby") {\r\n\t\t\tvar template = new UriTemplate(ldo.href);\r\n\t\t\tvar allPresent = true;\r\n\t\t\tfor (var j = 0; j < template.varNames.length; j++) {\r\n\t\t\t\tif (!(template.varNames[j] in data)) {\r\n\t\t\t\t\tallPresent = false;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (allPresent) {\r\n\t\t\t\tvar schemaUrl = template.fillFromObject(data);\r\n\t\t\t\tvar subSchema = {"$ref": schemaUrl};\r\n\t\t\t\tif (error = this.validateAll(data, subSchema, [], ["links", i], dataPointerPath)) {\r\n\t\t\t\t\treturn error;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n};\r\n\r\n// parseURI() and resolveUrl() are from https://gist.github.com/1088850\r\n// - released as public domain by author ("Yaffle") - see comments on gist\r\n\r\nfunction parseURI(url) {\r\n\tvar m = String(url).replace(/^\\s+|\\s+$/g, \'\').match(/^([^:\\/?#]+:)?(\\/\\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\\/?#]*)(?::(\\d*))?))?([^?#]*)(\\?[^#]*)?(#[\\s\\S]*)?/);\r\n\t// authority = \'//\' + user + \':\' + pass \'@\' + hostname + \':\' port\r\n\treturn (m ? {\r\n\t\thref : m[0] || \'\',\r\n\t\tprotocol : m[1] || \'\',\r\n\t\tauthority: m[2] || \'\',\r\n\t\thost : m[3] || \'\',\r\n\t\thostname : m[4] || \'\',\r\n\t\tport : m[5] || \'\',\r\n\t\tpathname : m[6] || \'\',\r\n\t\tsearch : m[7] || \'\',\r\n\t\thash : m[8] || \'\'\r\n\t} : null);\r\n}\r\n\r\nfunction resolveUrl(base, href) {// RFC 3986\r\n\r\n\tfunction removeDotSegments(input) {\r\n\t\tvar output = [];\r\n\t\tinput.replace(/^(\\.\\.?(\\/|$))+/, \'\')\r\n\t\t\t.replace(/\\/(\\.(\\/|$))+/g, \'/\')\r\n\t\t\t.replace(/\\/\\.\\.$/, \'/../\')\r\n\t\t\t.replace(/\\/?[^\\/]*/g, function (p) {\r\n\t\t\t\tif (p === \'/..\') {\r\n\t\t\t\t\toutput.pop();\r\n\t\t\t\t} else {\r\n\t\t\t\t\toutput.push(p);\r\n\t\t\t\t}\r\n\t\t});\r\n\t\treturn output.join(\'\').replace(/^\\//, input.charAt(0) === \'/\' ? \'/\' : \'\');\r\n\t}\r\n\r\n\thref = parseURI(href || \'\');\r\n\tbase = parseURI(base || \'\');\r\n\r\n\treturn !href || !base ? null : (href.protocol || base.protocol) +\r\n\t\t(href.protocol || href.authority ? href.authority : base.authority) +\r\n\t\tremoveDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === \'/\' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? \'/\' : \'\') + base.pathname.slice(0, base.pathname.lastIndexOf(\'/\') + 1) + href.pathname) : base.pathname)) +\r\n\t\t(href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) +\r\n\t\thref.hash;\r\n}\r\n\r\nfunction getDocumentUri(uri) {\r\n\treturn uri.split(\'#\')[0];\r\n}\r\nfunction normSchema(schema, baseUri) {\r\n\tif (schema && typeof schema === "object") {\r\n\t\tif (baseUri === undefined) {\r\n\t\t\tbaseUri = schema.id;\r\n\t\t} else if (typeof schema.id === "string") {\r\n\t\t\tbaseUri = resolveUrl(baseUri, schema.id);\r\n\t\t\tschema.id = baseUri;\r\n\t\t}\r\n\t\tif (Array.isArray(schema)) {\r\n\t\t\tfor (var i = 0; i < schema.length; i++) {\r\n\t\t\t\tnormSchema(schema[i], baseUri);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (typeof schema[\'$ref\'] === "string") {\r\n\t\t\t\tschema[\'$ref\'] = resolveUrl(baseUri, schema[\'$ref\']);\r\n\t\t\t}\r\n\t\t\tfor (var key in schema) {\r\n\t\t\t\tif (key !== "enum") {\r\n\t\t\t\t\tnormSchema(schema[key], baseUri);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}\r\n\r\nfunction defaultErrorReporter(language) {\r\n\tlanguage = language || \'en\';\r\n\r\n\tvar errorMessages = languages[language];\r\n\r\n\treturn function (error) {\r\n\t\tvar messageTemplate = errorMessages[error.code] || ErrorMessagesDefault[error.code];\r\n\t\tif (typeof messageTemplate !== \'string\') {\r\n\t\t\treturn "Unknown error code " + error.code + ": " + JSON.stringify(error.messageParams);\r\n\t\t}\r\n\t\tvar messageParams = error.params;\r\n\t\t// Adapted from Crockford\'s supplant()\r\n\t\treturn messageTemplate.replace(/\\{([^{}]*)\\}/g, function (whole, varName) {\r\n\t\t\tvar subValue = messageParams[varName];\r\n\t\t\treturn typeof subValue === \'string\' || typeof subValue === \'number\' ? subValue : whole;\r\n\t\t});\r\n\t};\r\n}\r\n\r\nvar ErrorCodes = {\r\n\tINVALID_TYPE: 0,\r\n\tENUM_MISMATCH: 1,\r\n\tANY_OF_MISSING: 10,\r\n\tONE_OF_MISSING: 11,\r\n\tONE_OF_MULTIPLE: 12,\r\n\tNOT_PASSED: 13,\r\n\t// Numeric errors\r\n\tNUMBER_MULTIPLE_OF: 100,\r\n\tNUMBER_MINIMUM: 101,\r\n\tNUMBER_MINIMUM_EXCLUSIVE: 102,\r\n\tNUMBER_MAXIMUM: 103,\r\n\tNUMBER_MAXIMUM_EXCLUSIVE: 104,\r\n\tNUMBER_NOT_A_NUMBER: 105,\r\n\t// String errors\r\n\tSTRING_LENGTH_SHORT: 200,\r\n\tSTRING_LENGTH_LONG: 201,\r\n\tSTRING_PATTERN: 202,\r\n\t// Object errors\r\n\tOBJECT_PROPERTIES_MINIMUM: 300,\r\n\tOBJECT_PROPERTIES_MAXIMUM: 301,\r\n\tOBJECT_REQUIRED: 302,\r\n\tOBJECT_ADDITIONAL_PROPERTIES: 303,\r\n\tOBJECT_DEPENDENCY_KEY: 304,\r\n\t// Array errors\r\n\tARRAY_LENGTH_SHORT: 400,\r\n\tARRAY_LENGTH_LONG: 401,\r\n\tARRAY_UNIQUE: 402,\r\n\tARRAY_ADDITIONAL_ITEMS: 403,\r\n\t// Custom/user-defined errors\r\n\tFORMAT_CUSTOM: 500,\r\n\tKEYWORD_CUSTOM: 501,\r\n\t// Schema structure\r\n\tCIRCULAR_REFERENCE: 600,\r\n\t// Non-standard validation options\r\n\tUNKNOWN_PROPERTY: 1000\r\n};\r\nvar ErrorCodeLookup = {};\r\nfor (var key in ErrorCodes) {\r\n\tErrorCodeLookup[ErrorCodes[key]] = key;\r\n}\r\nvar ErrorMessagesDefault = {\r\n\tINVALID_TYPE: "Invalid type: {type} (expected {expected})",\r\n\tENUM_MISMATCH: "No enum match for: {value}",\r\n\tANY_OF_MISSING: "Data does not match any schemas from \\"anyOf\\"",\r\n\tONE_OF_MISSING: "Data does not match any schemas from \\"oneOf\\"",\r\n\tONE_OF_MULTIPLE: "Data is valid against more than one schema from \\"oneOf\\": indices {index1} and {index2}",\r\n\tNOT_PASSED: "Data matches schema from \\"not\\"",\r\n\t// Numeric errors\r\n\tNUMBER_MULTIPLE_OF: "Value {value} is not a multiple of {multipleOf}",\r\n\tNUMBER_MINIMUM: "Value {value} is less than minimum {minimum}",\r\n\tNUMBER_MINIMUM_EXCLUSIVE: "Value {value} is equal to exclusive minimum {minimum}",\r\n\tNUMBER_MAXIMUM: "Value {value} is greater than maximum {maximum}",\r\n\tNUMBER_MAXIMUM_EXCLUSIVE: "Value {value} is equal to exclusive maximum {maximum}",\r\n\tNUMBER_NOT_A_NUMBER: "Value {value} is not a valid number",\r\n\t// String errors\r\n\tSTRING_LENGTH_SHORT: "String is too short ({length} chars), minimum {minimum}",\r\n\tSTRING_LENGTH_LONG: "String is too long ({length} chars), maximum {maximum}",\r\n\tSTRING_PATTERN: "String does not match pattern: {pattern}",\r\n\t// Object errors\r\n\tOBJECT_PROPERTIES_MINIMUM: "Too few properties defined ({propertyCount}), minimum {minimum}",\r\n\tOBJECT_PROPERTIES_MAXIMUM: "Too many properties defined ({propertyCount}), maximum {maximum}",\r\n\tOBJECT_REQUIRED: "Missing required property: {key}",\r\n\tOBJECT_ADDITIONAL_PROPERTIES: "Additional properties not allowed",\r\n\tOBJECT_DEPENDENCY_KEY: "Dependency failed - key must exist: {missing} (due to key: {key})",\r\n\t// Array errors\r\n\tARRAY_LENGTH_SHORT: "Array is too short ({length}), minimum {minimum}",\r\n\tARRAY_LENGTH_LONG: "Array is too long ({length}), maximum {maximum}",\r\n\tARRAY_UNIQUE: "Array items are not unique (indices {match1} and {match2})",\r\n\tARRAY_ADDITIONAL_ITEMS: "Additional items not allowed",\r\n\t// Format errors\r\n\tFORMAT_CUSTOM: "Format validation failed ({message})",\r\n\tKEYWORD_CUSTOM: "Keyword failed: {key} ({message})",\r\n\t// Schema structure\r\n\tCIRCULAR_REFERENCE: "Circular $refs: {urls}",\r\n\t// Non-standard validation options\r\n\tUNKNOWN_PROPERTY: "Unknown property (not in schema)"\r\n};\r\n\r\nfunction ValidationError(code, params, dataPath, schemaPath, subErrors) {\r\n\tError.call(this);\r\n\tif (code === undefined) {\r\n\t\tthrow new Error ("No error code supplied: " + schemaPath);\r\n\t}\r\n\tthis.message = \'\';\r\n\tthis.params = params;\r\n\tthis.code = code;\r\n\tthis.dataPath = dataPath || "";\r\n\tthis.schemaPath = schemaPath || "";\r\n\tthis.subErrors = subErrors || null;\r\n\r\n\tvar err = new Error(this.message);\r\n\tthis.stack = err.stack || err.stacktrace;\r\n\tif (!this.stack) {\r\n\t\ttry {\r\n\t\t\tthrow err;\r\n\t\t}\r\n\t\tcatch(err) {\r\n\t\t\tthis.stack = err.stack || err.stacktrace;\r\n\t\t}\r\n\t}\r\n}\r\nValidationError.prototype = Object.create(Error.prototype);\r\nValidationError.prototype.constructor = ValidationError;\r\nValidationError.prototype.name = \'ValidationError\';\r\n\r\nValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) {\r\n\tif (dataPrefix !== null) {\r\n\t\tdataPrefix = dataPrefix.replace(/~/g, "~0").replace(/\\//g, "~1");\r\n\t\tthis.dataPath = "/" + dataPrefix + this.dataPath;\r\n\t}\r\n\tif (schemaPrefix !== null) {\r\n\t\tschemaPrefix = schemaPrefix.replace(/~/g, "~0").replace(/\\//g, "~1");\r\n\t\tthis.schemaPath = "/" + schemaPrefix + this.schemaPath;\r\n\t}\r\n\tif (this.subErrors !== null) {\r\n\t\tfor (var i = 0; i < this.subErrors.length; i++) {\r\n\t\t\tthis.subErrors[i].prefixWith(dataPrefix, schemaPrefix);\r\n\t\t}\r\n\t}\r\n\treturn this;\r\n};\r\n\r\nfunction isTrustedUrl(baseUrl, testUrl) {\r\n\tif(testUrl.substring(0, baseUrl.length) === baseUrl){\r\n\t\tvar remainder = testUrl.substring(baseUrl.length);\r\n\t\tif ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === "/")\r\n\t\t\t|| remainder.charAt(0) === "#"\r\n\t\t\t|| remainder.charAt(0) === "?") {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\nvar languages = {};\r\nfunction createApi(language) {\r\n\tvar globalContext = new ValidatorContext();\r\n\tvar currentLanguage;\r\n\tvar customErrorReporter;\r\n\tvar api = {\r\n\t\tsetErrorReporter: function (reporter) {\r\n\t\t\tif (typeof reporter === \'string\') {\r\n\t\t\t\treturn this.language(reporter);\r\n\t\t\t}\r\n\t\t\tcustomErrorReporter = reporter;\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\taddFormat: function () {\r\n\t\t\tglobalContext.addFormat.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tlanguage: function (code) {\r\n\t\t\tif (!code) {\r\n\t\t\t\treturn currentLanguage;\r\n\t\t\t}\r\n\t\t\tif (!languages[code]) {\r\n\t\t\t\tcode = code.split(\'-\')[0]; // fall back to base language\r\n\t\t\t}\r\n\t\t\tif (languages[code]) {\r\n\t\t\t\tcurrentLanguage = code;\r\n\t\t\t\treturn code; // so you can tell if fall-back has happened\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\taddLanguage: function (code, messageMap) {\r\n\t\t\tvar key;\r\n\t\t\tfor (key in ErrorCodes) {\r\n\t\t\t\tif (messageMap[key] && !messageMap[ErrorCodes[key]]) {\r\n\t\t\t\t\tmessageMap[ErrorCodes[key]] = messageMap[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar rootCode = code.split(\'-\')[0];\r\n\t\t\tif (!languages[rootCode]) { // use for base language if not yet defined\r\n\t\t\t\tlanguages[code] = messageMap;\r\n\t\t\t\tlanguages[rootCode] = messageMap;\r\n\t\t\t} else {\r\n\t\t\t\tlanguages[code] = Object.create(languages[rootCode]);\r\n\t\t\t\tfor (key in messageMap) {\r\n\t\t\t\t\tif (typeof languages[rootCode][key] === \'undefined\') {\r\n\t\t\t\t\t\tlanguages[rootCode][key] = messageMap[key];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlanguages[code][key] = messageMap[key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t},\r\n\t\tfreshApi: function (language) {\r\n\t\t\tvar result = createApi();\r\n\t\t\tif (language) {\r\n\t\t\t\tresult.language(language);\r\n\t\t\t}\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tvalidate: function (data, schema, checkRecursive, banUnknownProperties) {\r\n\t\t\tvar def = defaultErrorReporter(currentLanguage);\r\n\t\t\tvar errorReporter = customErrorReporter ? function (error, data, schema) {\r\n\t\t\t\treturn customErrorReporter(error, data, schema) || def(error, data, schema);\r\n\t\t\t} : def;\r\n\t\t\tvar context = new ValidatorContext(globalContext, false, errorReporter, checkRecursive, banUnknownProperties);\r\n\t\t\tif (typeof schema === "string") {\r\n\t\t\t\tschema = {"$ref": schema};\r\n\t\t\t}\r\n\t\t\tcontext.addSchema("", schema);\r\n\t\t\tvar error = context.validateAll(data, schema, null, null, "");\r\n\t\t\tif (!error && banUnknownProperties) {\r\n\t\t\t\terror = context.banUnknownProperties(data, schema);\r\n\t\t\t}\r\n\t\t\tthis.error = error;\r\n\t\t\tthis.missing = context.missing;\r\n\t\t\tthis.valid = (error === null);\r\n\t\t\treturn this.valid;\r\n\t\t},\r\n\t\tvalidateResult: function () {\r\n\t\t\tvar result = {toString: function () {\r\n\t\t\t\treturn this.valid ? \'valid\' : this.error.message;\r\n\t\t\t}};\r\n\t\t\tthis.validate.apply(result, arguments);\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\tvalidateMultiple: function (data, schema, checkRecursive, banUnknownProperties) {\r\n\t\t\tvar def = defaultErrorReporter(currentLanguage);\r\n\t\t\tvar errorReporter = customErrorReporter ? function (error, data, schema) {\r\n\t\t\t\treturn customErrorReporter(error, data, schema) || def(error, data, schema);\r\n\t\t\t} : def;\r\n\t\t\tvar context = new ValidatorContext(globalContext, true, errorReporter, checkRecursive, banUnknownProperties);\r\n\t\t\tif (typeof schema === "string") {\r\n\t\t\t\tschema = {"$ref": schema};\r\n\t\t\t}\r\n\t\t\tcontext.addSchema("", schema);\r\n\t\t\tcontext.validateAll(data, schema, null, null, "");\r\n\t\t\tif (banUnknownProperties) {\r\n\t\t\t\tcontext.banUnknownProperties(data, schema);\r\n\t\t\t}\r\n\t\t\tvar result = {toString: function () {\r\n\t\t\t\treturn this.valid ? \'valid\' : this.error.message;\r\n\t\t\t}};\r\n\t\t\tresult.errors = context.errors;\r\n\t\t\tresult.missing = context.missing;\r\n\t\t\tresult.valid = (result.errors.length === 0);\r\n\t\t\treturn result;\r\n\t\t},\r\n\t\taddSchema: function () {\r\n\t\t\treturn globalContext.addSchema.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetSchema: function () {\r\n\t\t\treturn globalContext.getSchema.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetSchemaMap: function () {\r\n\t\t\treturn globalContext.getSchemaMap.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetSchemaUris: function () {\r\n\t\t\treturn globalContext.getSchemaUris.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tgetMissingUris: function () {\r\n\t\t\treturn globalContext.getMissingUris.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tdropSchemas: function () {\r\n\t\t\tglobalContext.dropSchemas.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tdefineKeyword: function () {\r\n\t\t\tglobalContext.defineKeyword.apply(globalContext, arguments);\r\n\t\t},\r\n\t\tdefineError: function (codeName, codeNumber, defaultMessage) {\r\n\t\t\tif (typeof codeName !== \'string\' || !/^[A-Z]+(_[A-Z]+)*$/.test(codeName)) {\r\n\t\t\t\tthrow new Error(\'Code name must be a string in UPPER_CASE_WITH_UNDERSCORES\');\r\n\t\t\t}\r\n\t\t\tif (typeof codeNumber !== \'number\' || codeNumber%1 !== 0 || codeNumber < 10000) {\r\n\t\t\t\tthrow new Error(\'Code number must be an integer > 10000\');\r\n\t\t\t}\r\n\t\t\tif (typeof ErrorCodes[codeName] !== \'undefined\') {\r\n\t\t\t\tthrow new Error(\'Error already defined: \' + codeName + \' as \' + ErrorCodes[codeName]);\r\n\t\t\t}\r\n\t\t\tif (typeof ErrorCodeLookup[codeNumber] !== \'undefined\') {\r\n\t\t\t\tthrow new Error(\'Error code already used: \' + ErrorCodeLookup[codeNumber] + \' as \' + codeNumber);\r\n\t\t\t}\r\n\t\t\tErrorCodes[codeName] = codeNumber;\r\n\t\t\tErrorCodeLookup[codeNumber] = codeName;\r\n\t\t\tErrorMessagesDefault[codeName] = ErrorMessagesDefault[codeNumber] = defaultMessage;\r\n\t\t\tfor (var langCode in languages) {\r\n\t\t\t\tvar language = languages[langCode];\r\n\t\t\t\tif (language[codeName]) {\r\n\t\t\t\t\tlanguage[codeNumber] = language[codeNumber] || language[codeName];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\treset: function () {\r\n\t\t\tglobalContext.reset();\r\n\t\t\tthis.error = null;\r\n\t\t\tthis.missing = [];\r\n\t\t\tthis.valid = true;\r\n\t\t},\r\n\t\tmissing: [],\r\n\t\terror: null,\r\n\t\tvalid: true,\r\n\t\tnormSchema: normSchema,\r\n\t\tresolveUrl: resolveUrl,\r\n\t\tgetDocumentUri: getDocumentUri,\r\n\t\terrorCodes: ErrorCodes\r\n\t};\r\n\tapi.language(language || \'en\');\r\n\treturn api;\r\n}\r\n\r\nvar tv4 = createApi();\r\ntv4.addLanguage(\'en-gb\', ErrorMessagesDefault);\r\n\r\n//legacy property\r\ntv4.tv4 = tv4;\r\n\r\nreturn tv4; // used by _header.js to globalise.\r\n\r\n}));//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYwLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vLy4vbm9kZV9tb2R1bGVzL3R2NC90djQuanM/NGRjMyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKlxyXG5BdXRob3I6IEdlcmFpbnQgTHVmZiBhbmQgb3RoZXJzXHJcblllYXI6IDIwMTNcclxuXHJcblRoaXMgY29kZSBpcyByZWxlYXNlZCBpbnRvIHRoZSBcInB1YmxpYyBkb21haW5cIiBieSBpdHMgYXV0aG9yKHMpLiAgQW55Ym9keSBtYXkgdXNlLCBhbHRlciBhbmQgZGlzdHJpYnV0ZSB0aGUgY29kZSB3aXRob3V0IHJlc3RyaWN0aW9uLiAgVGhlIGF1dGhvciBtYWtlcyBubyBndWFyYW50ZWVzLCBhbmQgdGFrZXMgbm8gbGlhYmlsaXR5IG9mIGFueSBraW5kIGZvciB1c2Ugb2YgdGhpcyBjb2RlLlxyXG5cclxuSWYgeW91IGZpbmQgYSBidWcgb3IgbWFrZSBhbiBpbXByb3ZlbWVudCwgaXQgd291bGQgYmUgY291cnRlb3VzIHRvIGxldCB0aGUgYXV0aG9yIGtub3csIGJ1dCBpdCBpcyBub3QgY29tcHVsc29yeS5cclxuKi9cclxuKGZ1bmN0aW9uIChnbG9iYWwsIGZhY3RvcnkpIHtcclxuICBpZiAodHlwZW9mIGRlZmluZSA9PT0gJ2Z1bmN0aW9uJyAmJiBkZWZpbmUuYW1kKSB7XHJcbiAgICAvLyBBTUQuIFJlZ2lzdGVyIGFzIGFuIGFub255bW91cyBtb2R1bGUuXHJcbiAgICBkZWZpbmUoW10sIGZhY3RvcnkpO1xyXG4gIH0gZWxzZSBpZiAodHlwZW9mIG1vZHVsZSAhPT0gJ3VuZGVmaW5lZCcgJiYgbW9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BQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EiLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///560\n')},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the "License");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an "AS IS" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n * Created by amo on 14/11/2015.\n */\nvar SourcePackage = function () {\n function SourcePackage(sourceCodeClassname, sourceCode) {\n (0, _classCallCheck3.default)(this, SourcePackage);\n\n this._sourceCode = sourceCode;\n this._sourceCodeClassname = sourceCodeClassname;\n\n this._encoding = null;\n this._signature = null;\n }\n\n (0, _createClass3.default)(SourcePackage, [{\n key: "sourceCode",\n get: function get() {\n return this._sourceCode;\n },\n set: function set(sourceCode) {\n if (sourceCode) this._sourceCode = sourceCode;\n }\n }, {\n key: "sourceCodeClassname",\n get: function get() {\n return this._sourceCodeClassname;\n },\n set: function set(sourceCodeClassname) {\n if (sourceCodeClassname) this._sourceCodeClassname = sourceCodeClassname;\n }\n }, {\n key: "encoding",\n get: function get() {\n return this._encoding;\n },\n set: function set(encoding) {\n if (encoding) this._encoding = encoding;\n }\n }, {\n key: "signature",\n get: function get() {\n return this._signature;\n },\n set: function set(sign) {\n if (sign) this._signature = sign;\n }\n }]);\n return SourcePackage;\n}();\n\nexports.default = SourcePackage;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYxLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9Tb3VyY2VQYWNrYWdlLmpzP2I0MzUiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiogQ29weXJpZ2h0IDIwMTYgT1JBTkdFIFNBXG4qIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4qIENvcHlyaWdodCAyMDE2IFRFQ0hOSVNDSEUgVU5JVkVSU0lUQVQgQkVSTElOXG4qXG4qIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5z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LyBzcmMvcnVudGltZS1jYXRhbG9ndWUvU291cmNlUGFja2FnZS5qcyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQXVCQTs7O0FBR0E7QUFDQTtBQUFBO0FBQ0E7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBd0JBO0FBQ0E7QUFFQTs7O0FBekJBO0FBQ0E7QUFDQTtBQXlCQTtBQUNBO0FBRUE7OztBQTFCQTtBQUNBO0FBQ0E7QUFNQTtBQUNBO0FBRUE7OztBQVBBO0FBQ0E7QUFDQTtBQU9BO0FBQ0E7QUFFQTs7Ozs7QUFhQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///561\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.HypertyResourceType = exports.HypertyType = exports.RuntimeHypertyCapabilityType = undefined;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HypertyDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(HypertyDescriptor, _CatalogueDataObject);\n\n /**\n *\n * @param {string} guid - Catalogue Global Unique identifier of the Catalogue Object enabling the same object to be\n * stored and discovered in different Catalogues. Guid corresponds to per BNF of Resource Path.\n * @param {CatalogueObjectType} catalogueType - \tIndicates the type of Catalogue Data Object\n * @param {string} version\n * @param {string} objectName\n * @param {string} description\n * @param {string} language\n * @param {string} sourcePackageURL\n * @param {HypertyResourceType[]} hypertyType A tag that identifies what type of hyperty is described in the object.\n * @param {URL.HypertyCatalogueURLList} dataObjectUrls - It defines the Data Object Schemas supported by the Hyperty\n * through a list of Catalogue URLs from where these schemas can be reached\n */\n function HypertyDescriptor(guid, catalogueType, version, objectName, description, language, sourcePackageURL, hypertyType, dataObjectUrls) {\n (0, _classCallCheck3.default)(this, HypertyDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (HypertyDescriptor.__proto__ || (0, _getPrototypeOf2.default)(HypertyDescriptor)).call(this, guid, catalogueType, version, objectName, description, language, sourcePackageURL));\n\n _this._configuration = {};\n _this._constraints = {};\n _this._policies = {};\n _this._messageSchema = null;\n\n _this._hypertyType = hypertyType;\n _this._dataObjects = dataObjectUrls;\n return _this;\n }\n\n (0, _createClass3.default)(HypertyDescriptor, [{\n key: 'hypertyType',\n get: function get() {\n return this._hypertyType;\n },\n set: function set(hType) {\n if (hType) this._hypertyType = hType;\n }\n }, {\n key: 'dataObjects',\n get: function get() {\n return this._dataObjects;\n },\n set: function set(dataObjects) {\n if (dataObjects) this._dataObjects = dataObjects;\n }\n }, {\n key: 'configuration',\n get: function get() {\n return this._configuration;\n },\n set: function set(configuration) {\n if (configuration) this._configuration = configuration;\n }\n }, {\n key: 'constraints',\n get: function get() {\n return this._constraints;\n },\n set: function set(constraints) {\n if (constraints) this._constraints = constraints;\n }\n }, {\n key: 'messageSchema',\n get: function get() {\n return this._messageSchema;\n },\n set: function set(messageSchema) {\n if (messageSchema) this._messageSchema = messageSchema;\n }\n }, {\n key: 'policies',\n get: function get() {\n return this._policies;\n },\n set: function set(policies) {\n if (policies) this._policies = policies;\n }\n }]);\n return HypertyDescriptor;\n}(_CatalogueDataObject3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by amo on 14/11/2015.\n */\n\n\nvar RuntimeHypertyCapabilityType = exports.RuntimeHypertyCapabilityType = {};\nvar HypertyType = exports.HypertyType = { COMMUNICATOR: 'communicator', IDENTITY: 'identity', CONTEXT: 'context' };\nvar HypertyResourceType = exports.HypertyResourceType = { chat: 'CHAT', audio: 'Audio', video: 'Video', av: 'AV', screen: 'SCREEN',\n file: 'FILe', midi: 'MIDI' };\nexports.default = HypertyDescriptor;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYyLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9IeXBlcnR5RGVzY3JpcHRvci5qcz9kZjJkIl0sInNvdXJjZXNDb250ZW50IjpbIi8qKlxuKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiogQ29weXJ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AgIH1cblxuICAgIGdldCBkYXRhT2JqZWN0cygpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX2RhdGFPYmplY3RzO1xuICAgIH1cblxuICAgIGdldCBjb25maWd1cmF0aW9uKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fY29uZmlndXJhdGlvbjtcbiAgICB9XG5cbiAgICBnZXQgY29uc3RyYWludHMoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLl9jb25zdHJhaW50cztcbiAgICB9XG5cbiAgICBnZXQgbWVzc2FnZVNjaGVtYSgpIHtcbiAgICAgICAgcmV0dXJuIHRoaXMuX21lc3NhZ2VTY2hlbWE7XG4gICAgfVxuXG4gICAgZ2V0IHBvbGljaWVzKCkge1xuICAgICAgICByZXR1cm4gdGhpcy5fcG9saWNpZXM7XG4gICAgfVxuXG4gICAgc2V0IGh5cGVydHlUeXBlKGhUeXBlKSB7XG4gICAgICAgIGlmIChoVHlwZSlcbiAgICAgICAgICAgIHRoaXMuX2h5cGVydHlUeXBlID0gaFR5cGU7XG4gICAgfVxuXG4gICAgc2V0IGRhdGFPYmplY3RzKGRhdGFPYmplY3RzKSB7XG4gICAgICAgIGlmIChkYXRhT2JqZWN0cylcbiAgICAgICAgICAgIHRoaXMuX2RhdGFPYmplY3RzID0gZGF0YU9iamVjdHM7XG4gICAgfVxuXG4gICAgc2V0IGNvbmZpZ3VyYXRpb24oY29uZmlndXJhdGlvbikge1xuICAgICAgICBpZiAoY29uZmlndXJhdGlvbilcbiAgICAgICAgICAgIHRoaXMuX2NvbmZpZ3VyYXRpb24gPSBjb25maWd1cmF0aW9uO1xuICAgIH1cblxuICAgIHNldCBjb25zdHJhaW50cyhjb25zdHJhaW50cykge1xuICAgICAgICBpZiAoY29uc3RyYWludHMpXG4gICAgICAgICAgICB0aGlzLl9jb25zdHJhaW50cyA9IGNvbnN0cmFpbnRzO1xuICAgIH1cblxuICAgIHNldCBtZXNzYWdlU2NoZW1hKG1lc3NhZ2VTY2hlbWEpI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kE7QUFDQTtBQUNBO0FBdUJBO0FBQ0E7QUFFQTs7O0FBeEJBO0FBQ0E7QUFDQTtBQXdCQTtBQUNBO0FBRUE7OztBQXpCQTtBQUNBO0FBQ0E7QUF5QkE7QUFDQTtBQUVBOzs7QUExQkE7QUFDQTtBQUNBO0FBMEJBO0FBQ0E7QUFFQTs7O0FBM0JBO0FBQ0E7QUFDQTtBQTJCQTtBQUNBO0FBRUE7OztBQWhGQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFMQTs7Ozs7QUEwRkE7QUFDQTtBQUNBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///562\n")},function(module,exports,__webpack_require__){"use strict";eval('\n\nObject.defineProperty(exports, "__esModule", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar ProtocolStubDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(ProtocolStubDescriptor, _CatalogueDataObject);\n\n function ProtocolStubDescriptor(guid, type, version, objectName, description, language, sourcePackageURL, messageSchemas, configuration, constraints, hypertyType, dataObjects, interworking, idpProxy, mutualAuthentication) {\n (0, _classCallCheck3.default)(this, ProtocolStubDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (ProtocolStubDescriptor.__proto__ || (0, _getPrototypeOf2.default)(ProtocolStubDescriptor)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n\n _this._messageSchemas = messageSchemas;\n\n if (configuration) _this._configuration = configuration;else _this._configuration = {};\n\n if (constraints) _this._constraints = constraints;else _this._constraints = {};\n\n _this._hypertyType = hypertyType;\n\n if (dataObjects) _this._dataObjects = dataObjects;else _this._dataObjects = [];\n\n _this._interworking = interworking;\n _this._idpProxy = idpProxy;\n _this._mutualAuthentication = mutualAuthentication;\n\n return _this;\n }\n\n (0, _createClass3.default)(ProtocolStubDescriptor, [{\n key: "messageSchemas",\n get: function get() {\n return this._messageSchemas;\n },\n set: function set(messageSchemas) {\n if (messageSchemas) this._messageSchemas = messageSchemas;\n }\n }, {\n key: "constraints",\n get: function get() {\n return this._constraints;\n },\n set: function set(constraints) {\n if (constraints) this._constraints = constraints;\n }\n }, {\n key: "configuration",\n get: function get() {\n return this._configuration;\n },\n set: function set(configuration) {\n if (configuration) this._configuration = configuration;\n }\n }, {\n key: "hypertyType",\n get: function get() {\n return this._hypertyType;\n },\n set: function set(value) {\n this._hypertyType = value;\n }\n }, {\n key: "dataObjects",\n get: function get() {\n return this._dataObjects;\n },\n set: function set(value) {\n this._dataObjects = value;\n }\n }, {\n key: "interworking",\n get: function get() {\n return this._interworking;\n },\n set: function set(value) {\n this._interworking = value;\n }\n }, {\n key: "idpProxy",\n get: function get() {\n return this._idpProxy;\n },\n set: function set(value) {\n this._idpProxy = value;\n }\n }, {\n key: "mutualAuthentication",\n get: function get() {\n return this._mutualAuthentication;\n },\n set: function set(value) {\n this._mutualAuthentication = value;\n }\n }]);\n return ProtocolStubDescriptor;\n}(_CatalogueDataObject3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the "License");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by amo on 14/11/2015.\n */\n\nexports.default = ProtocolStubDescriptor;\nmodule.exports = exports["default"];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTYzLmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9Qcm90b2NvbFN0dWJEZXNjcmlwdG9yLmpzP2I2NTIiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgMjAxNiBQVCBJbm92YcOnw6NvIGUgU2lzdGVtYXMgU0FcbiAqIENvcHlyaWdodCAyMDE2IElORVNDLUlEXG4gKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiAqIENvcHlyaWdodCAyMDE2IEZSQVVOSE9GRVItR0VTRUxMU0NIQUZUIFpVUiBGT0VSREVSVU5HIERFUiBBTkdFV0FORFRFTiBGT1JTQ0hVTkcgRS5WXG4gKiBDb3B5cmlnaHQgMjAxNiBPUkFOR0UgU0FcbiAqIENvcHlyaWdodCAyMDE2IERldXRzY2hlIFRlbGVrb20gQUdcbiAqIENvcHlyaWdodCAyMDE2IEFwaXplZVxuICogQ29weXJpZ2h0IDIwMTYgVEVDSE5JU0NIRSBVTklWRVJ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SUE7QUFDQTtBQUlBO0FBQ0E7QUFDQTtBQUNBO0FBSUE7QUFDQTtBQUNBO0FBQ0E7QUF6QkE7QUEwQkE7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBVUE7QUFDQTtBQUVBOzs7QUFYQTtBQUNBO0FBQ0E7QUFXQTtBQUNBO0FBRUE7OztBQVpBO0FBQ0E7QUFDQTtBQVlBO0FBQ0E7QUFFQTs7O0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTtBQUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBO0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQS9GQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFOQTs7OztBQXdHQTtBIiwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///563\n')},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.RuntimeType = exports.RuntimeProtocolCapability = exports.RuntimeHypertyCapability = undefined;\n\nvar _stringify = __webpack_require__(31);\n\nvar _stringify2 = _interopRequireDefault(_stringify);\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar HypertyRuntimeDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(HypertyRuntimeDescriptor, _CatalogueDataObject);\n\n function HypertyRuntimeDescriptor(guid, catalogueType, version, objectName, description, language, sourcePackageURL, runtimeType, hypertyCapabilities, protocolCapabilities, p2pHandlerStub, p2pRequesterStub) {\n (0, _classCallCheck3.default)(this, HypertyRuntimeDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (HypertyRuntimeDescriptor.__proto__ || (0, _getPrototypeOf2.default)(HypertyRuntimeDescriptor)).call(this, guid, catalogueType, version, objectName, description, language, sourcePackageURL));\n\n _this._runtimeType = runtimeType;\n\n if (hypertyCapabilities) _this._hypertyCapabilities = hypertyCapabilities;else _this._hypertyCapabilities = new RuntimeHypertyCapability(true, false, false, false, false);\n if (protocolCapabilities) _this._protocolCapabilities = protocolCapabilities;else _this._protocolCapabilities = new RuntimeProtocolCapability(true, false, true, false, false, false);\n\n _this._p2pHandlerStub = p2pHandlerStub;\n _this._p2pRequesterStub = p2pRequesterStub;\n return _this;\n }\n\n (0, _createClass3.default)(HypertyRuntimeDescriptor, [{\n key: 'runtimeType',\n get: function get() {\n return this._runtimeType;\n },\n set: function set(runtimeType) {\n if (runtimeType) this._runtimeType = runtimeType;\n }\n }, {\n key: 'hypertyCapabilities',\n get: function get() {\n return this._hypertyCapabilities;\n },\n set: function set(hypertyCapabilities) {\n if (hypertyCapabilities) this._hypertyCapabilities = hypertyCapabilities;\n }\n }, {\n key: 'protocolCapabilities',\n get: function get() {\n return this._hypertyCapabilities;\n },\n set: function set(protocolCapabilities) {\n if (protocolCapabilities) this._protocolCapabilities = protocolCapabilities;\n }\n }, {\n key: 'p2pHandlerStub',\n get: function get() {\n return this._p2pHandlerStub;\n },\n set: function set(value) {\n this._p2pHandlerStub = value;\n }\n }, {\n key: 'p2pRequesterStub',\n get: function get() {\n return this._p2pRequesterStub;\n },\n set: function set(value) {\n this._p2pRequesterStub = value;\n }\n }]);\n return HypertyRuntimeDescriptor;\n}(_CatalogueDataObject3.default);\n\n/**\n * A class representation of the capability set of the Runtime Hyperty\n */\n/**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by amo on 14/11/2015.\n */\n\nvar RuntimeHypertyCapability = exports.RuntimeHypertyCapability = function () {\n /**\n * Creates an object of the Runtime Hyperty capability set\n * @param {boolean} isWebRTCSupported\n * @param {boolean} isMicSupported\n * @param {boolean} isCameraSupported\n * @param {boolean} isSensorSupported\n * @param {boolean} isORTCSupported\n */\n function RuntimeHypertyCapability(isWebRTCSupported, isMicSupported, isCameraSupported, isSensorSupported, isORTCSupported) {\n (0, _classCallCheck3.default)(this, RuntimeHypertyCapability);\n\n this._isWebRTC = isWebRTCSupported;\n this._isMic = isMicSupported;\n this._isCamera = isCameraSupported;\n this._isSensor = isSensorSupported;\n this._isORTC = isORTCSupported;\n }\n\n (0, _createClass3.default)(RuntimeHypertyCapability, [{\n key: 'getCapabilitySet',\n value: function getCapabilitySet() {\n return (0, _stringify2.default)(this);\n }\n }, {\n key: 'isMic',\n get: function get() {\n return this._isMic;\n }\n }, {\n key: 'isCamera',\n get: function get() {\n return this._isCamera;\n }\n }, {\n key: 'isSensor',\n get: function get() {\n return this._isSensor;\n }\n }, {\n key: 'isWebRTC',\n get: function get() {\n return this._isWebRTC;\n }\n }, {\n key: 'isORTCS',\n get: function get() {\n return this._isORTC;\n }\n }]);\n return RuntimeHypertyCapability;\n}();\n\n/**\n * A class representation of the protocol capability set of the Runtime Hyperty\n */\n\n\nvar RuntimeProtocolCapability = exports.RuntimeProtocolCapability = function () {\n\n /**\n * Creates an object of the runtime protocol capability\n * @param {boolean} isHttp\n * @param {boolean} isHttps\n * @param {boolean} isWS\n * @param {boolean} isWSS\n * @param {boolean} isCoap\n * @param {boolean} isDataChannel\n */\n function RuntimeProtocolCapability(isHttp, isHttps, isWS, isWSS, isCoap, isDataChannel) {\n (0, _classCallCheck3.default)(this, RuntimeProtocolCapability);\n\n this._isHttp = isHttp;\n this._isHttps = isHttps;\n this._isWS = isWS;\n this._isWSS = isWSS;\n this._isCoap = isCoap;\n this._isDataChannel = isDataChannel;\n }\n\n (0, _createClass3.default)(RuntimeProtocolCapability, [{\n key: 'isHttp',\n value: function isHttp() {\n return this._isHttp;\n }\n }, {\n key: 'isHttps',\n value: function isHttps() {\n return this._isHttps;\n }\n }, {\n key: 'isWS',\n value: function isWS() {\n return this._isWS;\n }\n }, {\n key: 'isSensorSupported',\n value: function isSensorSupported() {\n return this._isSensor;\n }\n }, {\n key: 'isWSS',\n value: function isWSS() {\n return this._isWSS;\n }\n }, {\n key: 'isCoap',\n value: function isCoap() {\n return this._isCoap;\n }\n }, {\n key: 'isDataChannel',\n value: function isDataChannel() {\n return this._isDataChannel;\n }\n }, {\n key: 'getCapabilitySet',\n value: function getCapabilitySet() {\n return (0, _stringify2.default)(this);\n }\n }]);\n return RuntimeProtocolCapability;\n}();\n\nvar RuntimeType = exports.RuntimeType = { BROWSER: 'browser', STANDALONE: 'standalone', SERVER: 'server', GATEWAY: 'gateway' };\n\nexports.default = HypertyRuntimeDescriptor;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTY0LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9IeXBlcnR5UnVudGltZURlc2NyaXB0b3IuanM/ZDdkNCJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuICogQ29weXJpZ2h0IDIwMTYgSU5FU0MtSURcbiAqIENvcHlyaWdodCAyMDE2IFFVT0JJUyBORVRXT1JLUyBTTFxuICogQ29weXJpZ2h0IDIwMTYgRlJBVU5IT0ZFUi1HRVNFTExTQ0hBRlQgWlVSIEZPRVJERVJVTkcgREVSIEFOR0VXQU5EVEVOIEZPUlNDSFVORyBFLlZcbiAqIENvcHlyaWdodCAyMDE2IE9SQU5HRSBTQVxuICogQ29weXJpZ2h0IDIwMTYgRGV1dHNjaGUgVGVsZWtvbSBBR1xuICogQ29weXJpZ2h0IDIwMTYgQXBpemVlXG4gKiBDb3B5cmlnaHQgMjAxNiBURUNITklTQ0hFIFVOSVZFUlNJVEFUIEJFUkxJTlxuICpcbiAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSBcIkxpY2Vuc2VcIik7XG4gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuXG4gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXRcbiAqXG4gKiAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMFxuICpcbiAqIF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QUVBO0FBQ0E7QUFDQTs7O0FBRUE7QUFDQTtBQUNBOzs7QUFFQTtBQUNBO0FBQ0E7OztBQUVBO0FBQ0E7QUFDQTs7O0FBR0E7QUFDQTtBQUNBOzs7OztBQUdBO0FBQ0E7QUFDQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///564\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _createClass2 = __webpack_require__(2);\n\nvar _createClass3 = _interopRequireDefault(_createClass2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PolicyEnforcerDescriptor = function (_CatalogueDataObject) {\n (0, _inherits3.default)(PolicyEnforcerDescriptor, _CatalogueDataObject);\n\n function PolicyEnforcerDescriptor(guid, type, version, objectName, description, language, sourcePackageURL, configuration, policies) {\n (0, _classCallCheck3.default)(this, PolicyEnforcerDescriptor);\n\n var _this = (0, _possibleConstructorReturn3.default)(this, (PolicyEnforcerDescriptor.__proto__ || (0, _getPrototypeOf2.default)(PolicyEnforcerDescriptor)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n\n _this._configuration = configuration;\n _this._policies = policies;\n return _this;\n }\n\n (0, _createClass3.default)(PolicyEnforcerDescriptor, [{\n key: 'configuration',\n get: function get() {\n return this._configuration;\n },\n set: function set(configuration) {\n this._configuration = configuration;\n }\n }, {\n key: 'policies',\n get: function get() {\n return this._policies;\n },\n set: function set(policies) {\n this._policies = policies;\n }\n }]);\n return PolicyEnforcerDescriptor;\n}(_CatalogueDataObject3.default); /**\n * Copyright 2016 PT Inovação e Sistemas SA\n * Copyright 2016 INESC-ID\n * Copyright 2016 QUOBIS NETWORKS SL\n * Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n * Copyright 2016 ORANGE SA\n * Copyright 2016 Deutsche Telekom AG\n * Copyright 2016 Apizee\n * Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n **/\n\n/**\n * Created by pzu on 19.11.15.\n */\n\n\nexports.default = PolicyEnforcerDescriptor;\nmodule.exports = exports['default'];//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTY1LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9IeXBlcnR5SW50ZXJjZXB0b3JEZXNjcmlwdG9yLmpzP2NiMDIiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5cmlnaHQgMjAxNiBJTkVTQy1JRFxuKiBDb3B5cmlnaHQgMjAxNiBRVU9CSVMgTkVUV09SS1MgU0xcbiogQ29weXJpZ2h0IDIwMTYgRlJBV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9cbi8vIHNyYy9ydW50aW1lLWNhdGFsb2d1ZS9IeXBlcnR5SW50ZXJjZXB0b3JEZXNjcmlwdG9yLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTBCQTtBQUNBOzs7OztBQUNBOzs7QUFDQTtBQUFBO0FBQ0E7QUFEQTtBQUNBO0FBRUE7QUFDQTtBQUpBO0FBS0E7QUFDQTs7O0FBQ0E7QUFDQTtBQUNBO0FBVUE7QUFDQTtBQUNBOzs7QUFWQTtBQUNBO0FBQ0E7QUFFQTtBQUNBO0FBQ0E7OztBQWxCQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFMQTs7Ozs7QUE4QkE7QSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///565\n")},function(module,exports,__webpack_require__){"use strict";eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DataUrlScheme = exports.ContextDataObjectSchema = exports.IdentityDataObjectSchema = exports.ConnectionDataObjectSchema = exports.CommunicationDataObjectSchema = exports.HypertyDataObjectSchema = exports.MessageDataObjectSchema = exports.DataObjectSchema = undefined;\n\nvar _getPrototypeOf = __webpack_require__(15);\n\nvar _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);\n\nvar _classCallCheck2 = __webpack_require__(1);\n\nvar _classCallCheck3 = _interopRequireDefault(_classCallCheck2);\n\nvar _possibleConstructorReturn2 = __webpack_require__(17);\n\nvar _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);\n\nvar _inherits2 = __webpack_require__(18);\n\nvar _inherits3 = _interopRequireDefault(_inherits2);\n\nvar _CatalogueDataObject2 = __webpack_require__(72);\n\nvar _CatalogueDataObject3 = _interopRequireDefault(_CatalogueDataObject2);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar DataObjectSchema = exports.DataObjectSchema = function (_CatalogueDataObject) {\n (0, _inherits3.default)(DataObjectSchema, _CatalogueDataObject);\n\n function DataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL) {\n (0, _classCallCheck3.default)(this, DataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (DataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(DataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n }\n\n return DataObjectSchema;\n}(_CatalogueDataObject3.default);\n\n//Children\n/**\n* Copyright 2016 PT Inovação e Sistemas SA\n* Copyright 2016 INESC-ID\n* Copyright 2016 QUOBIS NETWORKS SL\n* Copyright 2016 FRAUNHOFER-GESELLSCHAFT ZUR FOERDERUNG DER ANGEWANDTEN FORSCHUNG E.V\n* Copyright 2016 ORANGE SA\n* Copyright 2016 Deutsche Telekom AG\n* Copyright 2016 Apizee\n* Copyright 2016 TECHNISCHE UNIVERSITAT BERLIN\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n**/\n\n/**\n * Created by pzu on 19.11.15.\n */\n\nvar MessageDataObjectSchema = exports.MessageDataObjectSchema = function (_DataObjectSchema) {\n (0, _inherits3.default)(MessageDataObjectSchema, _DataObjectSchema);\n\n function MessageDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL) {\n (0, _classCallCheck3.default)(this, MessageDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (MessageDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(MessageDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n }\n\n return MessageDataObjectSchema;\n}(DataObjectSchema);\n\nvar HypertyDataObjectSchema = exports.HypertyDataObjectSchema = function (_DataObjectSchema2) {\n (0, _inherits3.default)(HypertyDataObjectSchema, _DataObjectSchema2);\n\n function HypertyDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy, dataUrlScheme) {\n (0, _classCallCheck3.default)(this, HypertyDataObjectSchema);\n\n var _this3 = (0, _possibleConstructorReturn3.default)(this, (HypertyDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(HypertyDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL));\n\n _this3._accessControlPolicy = accessControlPolicy;\n _this3._scheme = dataUrlScheme;\n return _this3;\n }\n\n return HypertyDataObjectSchema;\n}(DataObjectSchema);\n\n//Children\n\n\nvar CommunicationDataObjectSchema = exports.CommunicationDataObjectSchema = function (_HypertyDataObjectSch) {\n (0, _inherits3.default)(CommunicationDataObjectSchema, _HypertyDataObjectSch);\n\n function CommunicationDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, CommunicationDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (CommunicationDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(CommunicationDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return CommunicationDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar ConnectionDataObjectSchema = exports.ConnectionDataObjectSchema = function (_HypertyDataObjectSch2) {\n (0, _inherits3.default)(ConnectionDataObjectSchema, _HypertyDataObjectSch2);\n\n function ConnectionDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, ConnectionDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (ConnectionDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(ConnectionDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return ConnectionDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar IdentityDataObjectSchema = exports.IdentityDataObjectSchema = function (_HypertyDataObjectSch3) {\n (0, _inherits3.default)(IdentityDataObjectSchema, _HypertyDataObjectSch3);\n\n function IdentityDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, IdentityDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (IdentityDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(IdentityDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return IdentityDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar ContextDataObjectSchema = exports.ContextDataObjectSchema = function (_HypertyDataObjectSch4) {\n (0, _inherits3.default)(ContextDataObjectSchema, _HypertyDataObjectSch4);\n\n function ContextDataObjectSchema(guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy) {\n (0, _classCallCheck3.default)(this, ContextDataObjectSchema);\n return (0, _possibleConstructorReturn3.default)(this, (ContextDataObjectSchema.__proto__ || (0, _getPrototypeOf2.default)(ContextDataObjectSchema)).call(this, guid, type, version, objectName, description, language, sourcePackageURL, accessControlPolicy));\n }\n\n return ContextDataObjectSchema;\n}(HypertyDataObjectSchema);\n\nvar DataUrlScheme = exports.DataUrlScheme = {\n COMM: 'COMM', CONNECTION: 'CONNECTION', CTXT: 'CTXT', IDENTITY: 'IDENTITY'\n};\n\nexports.default = DataObjectSchema;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNTY2LmpzIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vL3NyYy9ydW50aW1lLWNhdGFsb2d1ZS9EYXRhT2JqZWN0U2NoZW1hLmpzPzk3OWIiXSwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4qIENvcHlyaWdodCAyMDE2IFBUIElub3Zhw6fDo28gZSBTaXN0ZW1hcyBTQVxuKiBDb3B5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0NPTU0nLCBDT05ORUNUSU9OOiAnQ09OTkVDVElPTicsIENUWFQ6ICdDVFhUJywgSURFTlRJVFk6ICdJREVOVElUWSdcbn07XG5cbmV4cG9ydCBkZWZhdWx0IERhdGFPYmplY3RTY2hlbWE7XG5cblxuLy8gV0VCUEFDSyBGT09URVIgLy9cbi8vIHNyYy9ydW50aW1lLWNhdGFsb2d1ZS9EYXRhT2JqZWN0U2NoZW1hLmpzIl0sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQTJCQTtBQUNBOzs7OztBQUNBOzs7QUFDQTtBQUFBO0FBQUE7QUFFQTtBQUNBOztBQUpBO0FBQ0E7QUFPQTtBQXJDQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUF1QkE7Ozs7QUFlQTs7O0FBQ0E7QUFBQTtBQUFBO0FBRUE7QUFDQTs7QUFKQTtBQUNBO0FBS0E7OztBQUNBO0FBQUE7QUFDQTtBQURBO0FBQ0E7QUFDQTtBQUNBO0FBSEE7QUFJQTtBQUNBOztBQU5BO0FBQ0E7QUFPQTtBQUNBO0FBQ0E7QUFEQTs7O0FBQ0E7QUFBQTtBQUFBO0FBRUE7QUFDQTs7QUFKQTtBQUNBO0FBS0E7OztBQUNBO0FBQUE7QUFBQTtBQUVBO0FBQ0E7O0FBSkE7QUFDQTtBQUtBOzs7QUFDQTtBQUFBO0FBQUE7QUFFQTtBQUNBOztBQUpBO0FBQ0E7QUFLQTs7O0FBQ0E7QUFBQTtBQUFBO0FBRUE7QUFDQTs7QUFKQTtBQUNBO0FBS0E7QUFDQTtBQURBO0FBQ0E7QUFHQSIsInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///566\n")}])}); \ No newline at end of file diff --git a/dist/Runtime.min.js b/dist/Runtime.min.js index 2bbe14db..51edc8a3 100644 --- a/dist/Runtime.min.js +++ b/dist/Runtime.min.js @@ -1,5 +1,5 @@ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -25,8 +25,8 @@ **/ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:36:17 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:57 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -52,8 +52,8 @@ **/ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:34:45 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:09 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -79,8 +79,8 @@ **/ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:34:45 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:49:09 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -106,8 +106,8 @@ **/ -// version: 0.14.0 -// date: Wed Oct 24 2018 16:34:15 GMT+0100 (Western European Summer Time) +// version: 0.15.0 +// date: Wed Nov 28 2018 17:48:14 GMT+0000 (Western European Standard Time) // licence: /** * Copyright 2016 PT Inovação e Sistemas SA @@ -133,4 +133,4 @@ **/ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("Runtime",[],t):"object"==typeof exports?exports.Runtime=t():e.Runtime=t()}("undefined"!=typeof self?self:this,function(){return function(e){function __webpack_require__(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}var t={};return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=222)}([function(e,t,r){var n=r(7),o=r(31),i=r(23),a=r(24),s=r(32),u=function(e,t,r){var c,l,f,d,p=e&u.F,y=e&u.G,h=e&u.S,v=e&u.P,g=e&u.B,b=y?n:h?n[t]||(n[t]={}):(n[t]||{}).prototype,_=y?o:o[t]||(o[t]={}),m=_.prototype||(_.prototype={});y&&(r=t);for(c in r)l=!p&&b&&void 0!==b[c],f=(l?b:r)[c],d=g&&l?s(f,n):v&&"function"==typeof f?s(Function.call,f):f,b&&a(b,c,f,e&u.U),_[c]!=f&&i(_,c,d),v&&m[c]!=f&&(m[c]=f)};n.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,r){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";t.__esModule=!0;var n=r(204),o=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(){function defineProperties(e,t){for(var r=0;r=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(i=r,!1!==n&&persistLevelIfPossible(r),replaceLoggingMethods.call(a,r,e),typeof console===t&&r0)}function secondsSinceEpoch(){return Math.floor(Date.now()/1e3)}function deepClone(e){if(e)return JSON.parse((0,o.default)(e))}function removePathFromURL(e){var t=e.split("/");return t[0]+"//"+t[2]+"/"+t[3]}function getUserURLFromEmail(e){var t=e.indexOf("@");return"user://"+e.substring(t+1,e.length)+"/"+e.substring(0,t)}function getUserEmailFromURL(e){var t=divideURL(e);return t.identity.replace("/","")+"@"+t.domain}function convertToUserURL(e){if("user://"===e.substring(0,7)){var t=divideURL(e);if(t.domain&&t.identity)return e;throw"userURL with wrong format"}return getUserURLFromEmail(e)}function isDataObjectURL(e){var t=["domain-idp","runtime","domain","hyperty"],r=e.split("://"),n=r[0];return-1===t.indexOf(n)}function isLegacy(e){return e.split("@").length>1}function isURL(e){return e.split("/").length>=3}function isUserURL(e){return"user"===divideURL(e).type}function isHypertyURL(e){return"hyperty"===divideURL(e).type}function getConfigurationResources(e,t,r){return e[t][r]}function buildURL(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=e[t],s=void 0;if(!a.hasOwnProperty(r))throw Error("The configuration "+(0,o.default)(a,"",2)+" don't have the "+r+" resource you are looking for");var u=a[r];return n?(s=u.prefix+e.domain+u.suffix+n,u.hasOwnProperty("fallback")&&i&&(s=u.fallback.indexOf("%domain%")?u.fallback.replace(/(%domain%)/g,e.domain)+n:u.fallback+n)):s=u.prefix+e.domain+u.suffix,s}function generateGUID(){function s4(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return s4()+s4()+"-"+s4()+"-"+s4()+"-"+s4()+"-"+s4()+s4()+s4()}function getUserIdentityDomain(e){var t=divideURL(e),r=t.domain.split("."),n=r.length;return 1==n?r[n-1]:r[n-2]+"."+r[n-1]}function isBackendServiceURL(e){var t=divideURL(e),r=t.domain.split("."),n=["domain","global","domain-idp"],o=["registry","msg-node"],i=void 0;return r.length>1&&(i=r.filter(function(e){return-1!==o.indexOf(e)})[0]),!(!i||-1===o.indexOf(i))||!!t.type&&-1!==n.indexOf(t.type)}function divideEmail(e){var t=e.indexOf("@");return{username:e.substring(0,t),domain:e.substring(t+1,e.length)}}function assign(e,t,r){e||(e={}),"string"==typeof t&&(t=parseAttributes(t));for(var n=t.length-1,o=0;o0?o(n(e),9007199254740991):0}},function(e,t,r){e.exports={default:r(466),__esModule:!0}},function(e,t,r){e.exports={default:r(426),__esModule:!0}},function(e,t,r){"use strict";t.__esModule=!0;var n=r(82),o=function(e){return e&&e.__esModule?e:{default:e}}(n);t.default=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==(void 0===t?"undefined":(0,o.default)(t))&&"function"!=typeof t?e:t}},function(e,t,r){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(468),o=_interopRequireDefault(n),i=r(472),a=_interopRequireDefault(i),s=r(82),u=_interopRequireDefault(s);t.default=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+(void 0===t?"undefined":(0,u.default)(t)));e.prototype=(0,a.default)(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(o.default?(0,o.default)(e,t):e.__proto__=t)}},function(e,t,r){var n=r(37);e.exports=function(e){return Object(n(e))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){var n=r(136)("wks"),o=r(98),i=r(21).Symbol,a="function"==typeof i;(e.exports=function(e){return n[e]||(n[e]=a&&i[e]||(a?i:o)("Symbol."+e))}).store=n},function(e,t,r){var n=r(13),o=r(52);e.exports=r(12)?function(e,t,r){return n.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(7),o=r(23),i=r(27),a=r(53)("src"),s=Function.toString,u=(""+s).split("toString");r(31).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,r,s){var c="function"==typeof r;c&&(i(r,"name")||o(r,"name",t)),e[t]!==r&&(c&&(i(r,a)||o(r,a,e[t]?""+e[t]:u.join(String(t)))),e===n?e[t]=r:s?e[t]?e[t]=r:o(e,t,r):(delete e[t],o(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,r){var n=r(0),o=r(8),i=r(37),a=/"/g,s=function(e,t,r,n){var o=String(i(e)),s="<"+t;return""!==r&&(s+=" "+r+'="'+String(n).replace(a,""")+'"'),s+">"+o+""};e.exports=function(e,t){var r={};r[e]=t(s),n(n.P+n.F*o(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",r)}},function(e,t,r){var n=r(21),o=r(11),i=r(69),a=r(63),s=r(62),u=function(e,t,r){var c,l,f,d=e&u.F,p=e&u.G,y=e&u.S,h=e&u.P,v=e&u.B,g=e&u.W,b=p?o:o[t]||(o[t]={}),_=b.prototype,m=p?n:y?n[t]:(n[t]||{}).prototype;p&&(r=t);for(c in r)(l=!d&&m&&void 0!==m[c])&&s(b,c)||(f=l?m[c]:r[c],b[c]=p&&"function"!=typeof m[c]?r[c]:v&&l?i(f,n):g&&m[c]==f?function(e){var t=function(t,r,n){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,r)}return new e(t,r,n)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(f):h&&"function"==typeof f?i(Function.call,f):f,h&&((b.virtual||(b.virtual={}))[c]=f,e&u.R&&_&&!_[c]&&a(_,c,f)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(73),o=r(37);e.exports=function(e){return n(o(e))}},function(e,t,r){var n=r(74),o=r(52),i=r(28),a=r(36),s=r(27),u=r(155),c=Object.getOwnPropertyDescriptor;t.f=r(12)?c:function(e,t){if(e=i(e),t=a(t,!0),u)try{return c(e,t)}catch(e){}if(s(e,t))return o(!n.f.call(e,t),e[t])}},function(e,t,r){var n=r(27),o=r(19),i=r(108)("IE_PROTO"),a=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=o(e),n(e,i)?e[i]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?a:null}},function(e,t){var r=e.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},function(e,t,r){var n=r(20);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){"use strict";var n=r(8);e.exports=function(e,t){return!!e&&n(function(){t?e.call(null,function(){},1):e.call(null)})}},function(e,t,r){e.exports={default:r(478),__esModule:!0}},function(e,t,r){var n=r(9);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(0),o=r(31),i=r(8);e.exports=function(e,t){var r=(o.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*i(function(){r(1)}),"Object",a)}},function(e,t,r){var n=r(32),o=r(73),i=r(19),a=r(14),s=r(125);e.exports=function(e,t){var r=1==e,u=2==e,c=3==e,l=4==e,f=6==e,d=5==e||f,p=t||s;return function(t,s,y){for(var h,v,g=i(t),b=o(g),_=n(s,y,3),m=a(b.length),R=0,O=r?p(t,m):u?p(t,0):void 0;m>R;R++)if((d||R in b)&&(h=b[R],v=_(h,R,g),e))if(r)O[R]=v;else if(v)switch(e){case 3:return!0;case 5:return h;case 6:return R;case 2:O.push(h)}else if(l)return!1;return f?-1:c||l?l:O}}},function(e,t,r){var n=r(45);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){"use strict";if(r(12)){var n=r(48),o=r(7),i=r(8),a=r(0),s=r(94),u=r(131),c=r(32),l=r(59),f=r(52),d=r(23),p=r(61),y=r(38),h=r(14),v=r(181),g=r(55),b=r(36),_=r(27),m=r(75),R=r(9),O=r(19),w=r(122),k=r(56),S=r(30),P=r(57).f,D=r(124),M=r(53),L=r(10),j=r(40),U=r(84),E=r(91),x=r(127),A=r(66),I=r(88),C=r(58),T=r(126),q=r(171),H=r(13),N=r(29),F=H.f,B=N.f,G=o.RangeError,K=o.TypeError,V=o.Uint8Array,W=Array.prototype,Y=u.ArrayBuffer,J=u.DataView,z=j(0),X=j(2),$=j(3),Q=j(4),Z=j(5),ee=j(6),te=U(!0),re=U(!1),ne=x.values,oe=x.keys,ie=x.entries,ae=W.lastIndexOf,se=W.reduce,ue=W.reduceRight,ce=W.join,le=W.sort,fe=W.slice,de=W.toString,pe=W.toLocaleString,ye=L("iterator"),he=L("toStringTag"),ve=M("typed_constructor"),ge=M("def_constructor"),be=s.CONSTR,_e=s.TYPED,me=s.VIEW,Re=j(1,function(e,t){return Pe(E(e,e[ge]),t)}),Oe=i(function(){return 1===new V(new Uint16Array([1]).buffer)[0]}),we=!!V&&!!V.prototype.set&&i(function(){new V(1).set({})}),ke=function(e,t){var r=y(e);if(r<0||r%t)throw G("Wrong offset!");return r},Se=function(e){if(R(e)&&_e in e)return e;throw K(e+" is not a typed array!")},Pe=function(e,t){if(!(R(e)&&ve in e))throw K("It is not a typed array constructor!");return new e(t)},De=function(e,t){return Me(E(e,e[ge]),t)},Me=function(e,t){for(var r=0,n=t.length,o=Pe(e,n);n>r;)o[r]=t[r++];return o},Le=function(e,t,r){F(e,t,{get:function(){return this._d[r]}})},je=function(e){var t,r,n,o,i,a,s=O(e),u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,d=D(s);if(void 0!=d&&!w(d)){for(a=d.call(s),n=[],t=0;!(i=a.next()).done;t++)n.push(i.value);s=n}for(f&&u>2&&(l=c(l,arguments[2],2)),t=0,r=h(s.length),o=Pe(this,r);r>t;t++)o[t]=f?l(s[t],t):s[t];return o},Ue=function(){for(var e=0,t=arguments.length,r=Pe(this,t);t>e;)r[e]=arguments[e++];return r},Ee=!!V&&i(function(){pe.call(new V(1))}),xe=function(){return pe.apply(Ee?fe.call(Se(this)):Se(this),arguments)},Ae={copyWithin:function(e,t){return q.call(Se(this),e,t,arguments.length>2?arguments[2]:void 0)},every:function(e){return Q(Se(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return T.apply(Se(this),arguments)},filter:function(e){return De(this,X(Se(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Z(Se(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Se(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){z(Se(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return re(Se(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return te(Se(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return ce.apply(Se(this),arguments)},lastIndexOf:function(e){return ae.apply(Se(this),arguments)},map:function(e){return Re(Se(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return se.apply(Se(this),arguments)},reduceRight:function(e){return ue.apply(Se(this),arguments)},reverse:function(){for(var e,t=this,r=Se(t).length,n=Math.floor(r/2),o=0;o1?arguments[1]:void 0)},sort:function(e){return le.call(Se(this),e)},subarray:function(e,t){var r=Se(this),n=r.length,o=g(e,n);return new(E(r,r[ge]))(r.buffer,r.byteOffset+o*r.BYTES_PER_ELEMENT,h((void 0===t?n:g(t,n))-o))}},Ie=function(e,t){return De(this,fe.call(Se(this),e,t))},Ce=function(e){Se(this);var t=ke(arguments[1],1),r=this.length,n=O(e),o=h(n.length),i=0;if(o+t>r)throw G("Wrong length!");for(;i255?255:255&n),o.v[p](r*t+o.o,n,Oe)},L=function(e,t){F(e,t,{get:function(){return D(this,t)},set:function(e){return M(this,t,e)},enumerable:!0})};_?(y=r(function(e,r,n,o){l(e,y,c,"_d");var i,a,s,u,f=0,p=0;if(R(r)){if(!(r instanceof Y||"ArrayBuffer"==(u=m(r))||"SharedArrayBuffer"==u))return _e in r?Me(y,r):je.call(y,r);i=r,p=ke(n,t);var g=r.byteLength;if(void 0===o){if(g%t)throw G("Wrong length!");if((a=g-p)<0)throw G("Wrong length!")}else if((a=h(o)*t)+p>g)throw G("Wrong length!");s=a/t}else s=v(r),a=s*t,i=new Y(a);for(d(e,"_d",{b:i,o:p,l:a,e:s,v:new J(i)});fdocument.F=Object<\/script>"),e.close(),u=e.F;n--;)delete u.prototype[i[n]];return u()};e.exports=Object.create||function(e,t){var r;return null!==e?(s.prototype=n(e),r=new s,s.prototype=null,r[a]=e):r=u(),void 0===t?r:o(r,t)}},function(e,t,r){var n=r(157),o=r(109).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},function(e,t,r){"use strict";var n=r(7),o=r(13),i=r(12),a=r(10)("species");e.exports=function(e){var t=n[e];i&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t){e.exports=function(e,t,r,n){if(!(e instanceof t)||void 0!==n&&n in e)throw TypeError(r+": incorrect invocation!");return e}},function(e,t,r){var n=r(32),o=r(169),i=r(122),a=r(5),s=r(14),u=r(124),c={},l={},t=e.exports=function(e,t,r,f,d){var p,y,h,v,g=d?function(){return e}:u(e),b=n(r,f,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(i(g)){for(p=s(e.length);p>_;_++)if((v=t?b(a(y=e[_])[0],y[1]):b(e[_]))===c||v===l)return v}else for(h=g.call(e);!(y=h.next()).done;)if((v=o(h,b,y.value,t))===c||v===l)return v};t.BREAK=c,t.RETURN=l},function(e,t,r){var n=r(24);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){var n=r(44),o=r(79);e.exports=r(51)?function(e,t,r){return n.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(13).f,o=r(27),i=r(10)("toStringTag");e.exports=function(e,t,r){e&&!o(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t,r){var n=r(0),o=r(37),i=r(8),a=r(112),s="["+a+"]",u="​…",c=RegExp("^"+s+s+"*"),l=RegExp(s+s+"*$"),f=function(e,t,r){var o={},s=i(function(){return!!a[e]()||u[e]()!=u}),c=o[e]=s?t(d):a[e];r&&(o[r]=c),n(n.P+n.F*s,"String",o)},d=f.trim=function(e,t){return e=String(o(e)),1&t&&(e=e.replace(c,"")),2&t&&(e=e.replace(l,"")),e};e.exports=f},function(e,t){e.exports={}},function(e,t,r){var n=r(9);e.exports=function(e,t){if(!n(e)||e._t!==t)throw TypeError("Incompatible receiver, "+t+" required!");return e}},function(e,t,r){var n=r(189),o=r(137);e.exports=Object.keys||function(e){return n(e,o)}},function(e,t,r){var n=r(99);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,o){return e.call(t,r,n,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){e.exports={}},function(e,t,r){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.DataObjectSourceLanguage=t.CatalogueObjectType=void 0;var n=r(15),o=_interopRequireDefault(n),i=r(1),a=_interopRequireDefault(i),s=r(2),u=_interopRequireDefault(s),c=r(17),l=_interopRequireDefault(c),f=r(18),d=_interopRequireDefault(f),p=r(557),y=_interopRequireDefault(p),h=function(e){function CatalogueDataObject(e,t,r,n,i,s,u){(0,a.default)(this,CatalogueDataObject);var c=(0,l.default)(this,(CatalogueDataObject.__proto__||(0,o.default)(CatalogueDataObject)).call(this));return c._guid=e,c._type=t,c._version=r,c._objectName=n,c._description=i,c._language=s,c._sourcePackageURL=u,c._signature=null,c._sourcePackage=null,c}return(0,d.default)(CatalogueDataObject,e),(0,u.default)(CatalogueDataObject,[{key:"guid",get:function(){return this._guid},set:function(e){e&&(this._guid=e)}},{key:"type",get:function(){return this._type},set:function(e){e&&(this._type=e)}},{key:"version",get:function(){return this._version},set:function(e){e&&(this._version=e)}},{key:"objectName",get:function(){return this._objectName},set:function(e){e&&(this._objectName=e)}},{key:"description",get:function(){return this._description},set:function(e){e&&(this._description=e)}},{key:"language",get:function(){return this._language},set:function(e){e&&(this._language=e)}},{key:"signature",get:function(){return this._signature},set:function(e){e&&(this._signature=e)}},{key:"sourcePackage",get:function(){return this._sourcePackage},set:function(e){e&&(this._sourcePackage=e)}},{key:"sourcePackageURL",get:function(){return this._sourcePackageURL},set:function(e){e&&(this._sourcePackageURL=e)}}]),CatalogueDataObject}(y.default);t.CatalogueObjectType={HYPERTY:"hyperty",PROTOSTUB:"protostub",HYPERTY_RUNTIME:"hyperty_runtime",HYPERTY_INTERCEPTOR:"hyperty_inspector",HYPERTY_DATA_OBJECT:"hyperty_data_object"},t.DataObjectSourceLanguage={JAVASCRIPT_ECMA6:"javascript_ecma6",JAVASCRIPT_ECMA5:"javascript_ecma5",JSON_SCHEMA_V4:"json_schema_v4",PYTHON:"python",TYPESCRIPT:"typescript"};t.default=h},function(e,t,r){var n=r(33);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(33),o=r(10)("toStringTag"),i="Arguments"==n(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,r,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=a(t=Object(e),o))?r:i?n(t):"Object"==(s=n(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,r){var n=r(132);e.exports=function(e){return Object(n(e))}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){"use strict";var n=r(431)(!0);r(193)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,r=this._i;return r>=t.length?{value:void 0,done:!0}:(e=n(t,r),this._i+=e.length,{value:e,done:!1})})},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var n=r(454),o=_interopRequireDefault(n),i=r(456),a=_interopRequireDefault(i),s="function"==typeof a.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":typeof e};t.default="function"==typeof a.default&&"symbol"===s(o.default)?function(e){return void 0===e?"undefined":s(e)}:function(e){return e&&"function"==typeof a.default&&e.constructor===a.default&&e!==a.default.prototype?"symbol":void 0===e?"undefined":s(e)}},function(e,t,r){var n=r(31),o=r(7),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(48)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(28),o=r(14),i=r(55);e.exports=function(e){return function(t,r,a){var s,u=n(t),c=o(u.length),l=i(a,c);if(e&&r!=r){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((e||l in u)&&u[l]===r)return e||l||0;return!e&&-1}}},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(33);e.exports=Array.isArray||function(e){return"Array"==n(e)}},function(e,t,r){var n=r(9),o=r(33),i=r(10)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t,r){var n=r(10)("iterator"),o=!1;try{var i=[7][n]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!o)return!1;var r=!1;try{var i=[7],a=i[n]();a.next=function(){return{done:r=!0}},i[n]=function(){return a},e(i)}catch(e){}return r}},function(e,t,r){"use strict";var n=r(5);e.exports=function(){var e=n(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},function(e,t,r){"use strict";var n=r(23),o=r(24),i=r(8),a=r(37),s=r(10);e.exports=function(e,t,r){var u=s(e),c=r(a,u,""[e]),l=c[0],f=c[1];i(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(o(String.prototype,e,l),n(RegExp.prototype,u,2==t?function(e,t){return f.call(e,this,t)}:function(e){return f.call(e,this)}))}},function(e,t,r){var n=r(5),o=r(20),i=r(10)("species");e.exports=function(e,t){var r,a=n(e).constructor;return void 0===a||void 0==(r=n(a)[i])?t:o(r)}},function(e,t,r){var n=r(7),o=n.navigator;e.exports=o&&o.userAgent||""},function(e,t,r){"use strict";var n=r(7),o=r(0),i=r(24),a=r(61),s=r(47),u=r(60),c=r(59),l=r(9),f=r(8),d=r(88),p=r(64),y=r(113);e.exports=function(e,t,r,h,v,g){var b=n[e],_=b,m=v?"set":"add",R=_&&_.prototype,O={},w=function(e){var t=R[e];i(R,e,"delete"==e?function(e){return!(g&&!l(e))&&t.call(this,0===e?0:e)}:"has"==e?function(e){return!(g&&!l(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return g&&!l(e)?void 0:t.call(this,0===e?0:e)}:"add"==e?function(e){return t.call(this,0===e?0:e),this}:function(e,r){return t.call(this,0===e?0:e,r),this})};if("function"==typeof _&&(g||R.forEach&&!f(function(){(new _).entries().next()}))){var k=new _,S=k[m](g?{}:-0,1)!=k,P=f(function(){k.has(1)}),D=d(function(e){new _(e)}),M=!g&&f(function(){for(var e=new _,t=5;t--;)e[m](t,t);return!e.has(-0)});D||(_=t(function(t,r){c(t,_,e);var n=y(new b,t,_);return void 0!=r&&u(r,v,n[m],n),n}),_.prototype=R,R.constructor=_),(P||M)&&(w("delete"),w("has"),v&&w("get")),(M||S)&&w(m),g&&R.clear&&delete R.clear}else _=h.getConstructor(t,e,v,m),a(_.prototype,r),s.NEED=!0;return p(_,e),O[e]=_,o(o.G+o.W+o.F*(_!=b),O),g||h.setStrong(_,e,v),_}},function(e,t,r){for(var n,o=r(7),i=r(23),a=r(53),s=a("typed_array"),u=a("view"),c=!(!o.ArrayBuffer||!o.DataView),l=c,f=0,d="Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array".split(",");f<9;)(n=o[d[f++]])?(i(n.prototype,s,!0),i(n.prototype,u,!0)):l=!1;e.exports={ABV:c,CONSTR:l,TYPED:s,VIEW:u}},function(e,t,r){"use strict";e.exports=r(48)||!r(8)(function(){var e=Math.random();__defineSetter__.call(null,e,function(){}),delete r(7)[e]})},function(e,t,r){"use strict";var n=r(0);e.exports=function(e){n(n.S,e,{of:function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];return new this(t)}})}},function(e,t,r){"use strict";var n=r(0),o=r(20),i=r(32),a=r(60);e.exports=function(e){n(n.S,e,{from:function(e){var t,r,n,s,u=arguments[1];return o(this),t=void 0!==u,t&&o(u),void 0==e?new this:(r=[],t?(n=0,s=i(u,arguments[2],2),a(e,!1,function(e){r.push(s(e,n++))})):a(e,!1,r.push,r),new this(r))}})}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var n=r(44).f,o=r(62),i=r(22)("toStringTag");e.exports=function(e,t,r){e&&!o(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t,r){r(434);for(var n=r(21),o=r(63),i=r(71),a=r(22)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u"+e.to];if(d||(d=t._newChatCrypto(e,l),t.chatKeys[e.from+"<->"+e.to]=d,e.body.handshakePhase="startHandShake"),d.authenticated&&!o){var p=t.crypto.generateIV();t.crypto.encryptAES(d.keys.hypertyFromSessionKey,(0,f.stringify)(e.body.value),p).then(function(n){var o=t._filterMessageToHash(e,(0,f.stringify)(e.body.value)+(0,f.stringify)(p),d.hypertyFrom.messageInfo);t.crypto.hashHMAC(d.keys.hypertyFromHashKey,o).then(function(t){var o={iv:(0,f.encode)(p),value:(0,f.encode)(n),hash:(0,f.encode)(t)};e.body.value=(0,f.encode)(o),r(e)})})}else o?r(e):t._doHandShakePhase(e,d).then(function(r){t.chatKeys[e.from+"<->"+e.to]=r.chatKeys,t._messageBus.postMessage(r.message),n("encrypt handshake protocol phase ")})}else n("In encryptMessage: Hyperty owner URL was not found")}else u&&a&&t.storageManager.get("dataObjectSessionKeys").then(function(o){o=(0,f.chatkeysToArrayCloner)(o||{});var a=o?o[i]:null;t.dataObjectsStorage.getDataObject(i).then(function(o){if(!a&&o.reporter&&o.reporter===e.from){var s=t.crypto.generateRandom();t.dataObjectSessionKeys[i]={sessionKey:s,isToEncrypt:!0};var u=(0,f.chatkeysToStringCloner)(t.dataObjectSessionKeys);t.storageManager.set("dataObjectSessionKeys",0,u).catch(function(e){n("On encryptMessage from method storageManager.set error: "+e)}),a=t.dataObjectSessionKeys[i]}if(a)if(a.isToEncrypt){var c=t.crypto.generateIV(),l=(0,f.stringify)(c),d=(0,f.stringify)(e.body.value);t.crypto.encryptAES(a.sessionKey,d,c).then(function(n){delete e.body.identity.assertion,delete e.body.identity.expires;var o=t._filterMessageToHash(e,d+l);t.crypto.hashHMAC(a.sessionKey,o).then(function(t){var o={value:(0,f.encode)(n),iv:(0,f.encode)(c),hash:(0,f.encode)(t)};e.body.value=(0,f.stringify)(o),r(e)})})}else r(e);else n("Data object key could not be defined: Failed to decrypt message ")}).catch(function(e){n("On encryptMessage from method dataObjectsStorage.getDataObject error: "+e)})}).catch(function(e){n("On encryptMessage from method storageManager.get error: "+e)})})}},{key:"encryptDataObject",value:function(e,t){var r=this;return new o.default(function(n,o){y.info("dataObject value to encrypt: ",e);var i=(0,f.parseMessageURL)(t);r.storageManager.get("dataObjectSessionKeys").then(function(t){t=(0,f.chatkeysToArrayCloner)(t||{});var a=t?t[i]:null;if(!a)return o("No dataObjectKey for this dataObjectURL:",i);if(!a.isToEncrypt)return y.info("The dataObject is not encrypted"),n(e);var s=r.crypto.generateIV();r.crypto.encryptAES(a.sessionKey,(0,f.stringify)(e),s).then(function(e){var t={value:(0,f.encode)(e),iv:(0,f.encode)(s)};return n(t)}).catch(function(e){o("On encryptDataObject from method encryptAES error: "+e)})}).catch(function(e){o("On encryptDataObject from method storageManager.get error: "+e)})})}},{key:"decryptMessage",value:function(e){var t=this;return new o.default(function(r,n){var o="handshake"===e.type;t._isToDecrypt(e).then(function(i){if(!i)return r(e);var a=(0,f.parseMessageURL)(e.to),s=(0,f.isDataObjectURL)(a),u="hyperty"===(0,f.divideURL)(e.from).type,c="hyperty"===(0,f.divideURL)(e.to).type;if("update"===e.type)return r(e);if(u&&c){var l=t._registry.getHypertyOwner(e.to);if(l){var d=t.chatKeys[e.to+"<->"+e.from];if(d||(d=t._newChatCrypto(e,l,"decrypt"),t.chatKeys[e.to+"<->"+e.from]=d),d.authenticated&&!o){var p=(0,f.decode)(e.body.value),h=(0,f.decodeToUint8Array)(p.iv),v=(0,f.decodeToUint8Array)(p.value),g=(0,f.decodeToUint8Array)(p.hash);t.crypto.decryptAES(d.keys.hypertyToSessionKey,v,h).then(function(n){e.body.value=n;var o=t._filterMessageToHash(e,n+h);t.crypto.verifyHMAC(d.keys.hypertyToHashKey,o,g).then(function(t){e.body.assertedIdentity=!0,r(e)})})}else o?t._doHandShakePhase(e,d).then(function(r){"handShakeEnd"===r||(t.chatKeys[e.to+"<->"+e.from]=r.chatKeys,t._messageBus.postMessage(r.message))}):n("wrong message do decrypt")}else n("error on decrypt message")}else u&&s?t.storageManager.get("dataObjectSessionKeys").then(function(o){o=(0,f.chatkeysToArrayCloner)(o||{});var i=o?o[a]:null;if(i)if(i.isToEncrypt){var s=(0,f.parse)(e.body.value),u=(0,f.decodeToUint8Array)(s.iv),c=(0,f.decodeToUint8Array)(s.value),l=(0,f.decodeToUint8Array)(s.hash);t.crypto.decryptAES(i.sessionKey,c,u).then(function(o){var a=(0,f.parse)(o);e.body.value=a;var s=t._filterMessageToHash(e,(0,f.stringify)(a)+(0,f.stringify)(u));t.crypto.verifyHMAC(i.sessionKey,s,l).then(function(t){y.log("Received message HMAC result",t),e.body.assertedIdentity=!0,r(e)}).catch(function(e){n("Message HMAC is invalid: "+e)})})}else e.body.assertedIdentity=!0,r(e);else e.body.assertedIdentity=!0,r(e)}):n("wrong message to decrypt")})})}},{key:"decryptDataObject",value:function(e,t){var r=this;return new o.default(function(n,o){if(!r.isToUseEncryption)return n(e);var i=(0,f.parseMessageURL)(t);r.storageManager.get("dataObjectSessionKeys").then(function(t){t=(0,f.chatkeysToArrayCloner)(t);var a=t?t[i]:null;if(!a)return o("No dataObjectKey for this dataObjectURL:",i);if(!a.isToEncrypt)return n(e);var s=(0,f.decodeToUint8Array)(e.iv),u=(0,f.decodeToUint8Array)(e.value);r.crypto.decryptAES(a.sessionKey,u,s).then(function(e){var t=(0,f.parse)(e),r={value:t,iv:(0,f.encode)(s)};return n(r)}).catch(function(e){o("On decryptDataObject from method encryptAES error: "+e)})})})}},{key:"_doMutualAuthenticationPhase1",value:function(e){var t=this;return new o.default(function(r,n){var o=e.to.split("/");o.pop();var i=o[0]+"//"+o[2]+"/"+o[3];t._doMutualAuthenticationPhase2(i,e.body.subscriber).then(function(){t._registry.registerSubscriber(i,e.body.subscriber),r()},function(e){n(e)})})}},{key:"_doMutualAuthenticationPhase2",value:function(e,t){y.info("doMutualAuthentication:sender ",e),y.info("doMutualAuthentication:receiver ",t);var r=this;return new o.default(function(n,o){var i=void 0,a=r._registry.getReporterURLSynchonous(e);a&&(i=e,e=a);var s={to:t,from:e,callback:void 0,body:{handshakePhase:"startHandShake",ignore:"ignoreMessage"}};if(!e||!t)return o("sender or receiver missing on doMutualAuthentication");var u=r.chatKeys[e+"<->"+t],c=r._registry.getHypertyOwner(e);if(c){if(!u){var l=function(e){n(e)};s.callback=l,s.dataObjectURL=i,u=r._newChatCrypto(s,c),r.chatKeys[e+"<->"+t]=u}if(u.authenticated){var f={to:e,from:t};u.dataObjectURL=i,r._sendReporterSessionKey(f,u).then(function(e){r._messageBus.postMessage(e.message),n("exchange of chat sessionKey initiated")}).catch(function(e){o("On doMutualAuthentication from method _sendReporterSessionKey error: "+e)})}else r._doHandShakePhase(s,u)}else o("Mutual authentication error: Hyperty owner could not be resolved")})}},{key:"_sendReporterSessionKey",value:function(e,t){var r=this;return new o.default(function(n,o){var i=r.dataObjectSessionKeys[t.dataObjectURL],a=void 0,s=void 0,u=void 0,c=void 0,l={};if(i)u=i.sessionKey;else{u=r.crypto.generateRandom(),r.dataObjectSessionKeys[t.dataObjectURL]={sessionKey:u,isToEncrypt:!0};var d=(0,f.chatkeysToStringCloner)(r.dataObjectSessionKeys);r.storageManager.set("dataObjectSessionKeys",0,d).catch(function(e){o("On _sendReporterSessionKey from method storageManager.set(dataObjectSessionKeys...) error: "+e)})}try{s=(0,f.encode)({value:(0,f.encode)(u),dataObjectURL:t.dataObjectURL})}catch(e){return o("On _sendReporterSessionKey from method storageManager.set error valueToEncrypt: "+e)}c=r.crypto.generateIV(),l.iv=(0,f.encode)(c),r.crypto.encryptAES(t.keys.hypertyFromSessionKey,s,c).then(function(n){a={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"reporterSessionKey",value:(0,f.encode)(n)}};var o=r._filterMessageToHash(a,s+c,t.hypertyFrom.messageInfo);return r.crypto.hashHMAC(t.keys.hypertyFromHashKey,o)}).then(function(e){var r=(0,f.encode)({value:a.body.value,hash:(0,f.encode)(e),iv:l.iv});a.body.value=r,n({message:a,chatKeys:t})}).catch(function(e){o("On _sendReporterSessionKey from chained promises encryptAES error: "+e)})})}},{key:"_resolveDomain",value:function(e){return e?"domain-idp://"+e:"domain-idp://google.com"}},{key:"_doHandShakePhase",value:function(e,t){var r=this;return new o.default(function(n,o){var i=e.body.handshakePhase,a=void 0,s=void 0,u={},c=void 0,l=void 0;switch(y.info("handshake phase: ",i),i){case"startHandShake":t.keys.fromRandom=r.crypto.generateRandom();var d={type:"handshake",to:e.to,from:e.from,body:{handshakePhase:"senderHello",value:(0,f.encode)(t.keys.fromRandom)}};t.handshakeHistory.senderHello=r._filterMessageToHash(d,void 0,t.hypertyFrom.messageInfo),t.initialMessage?n({message:d,chatKeys:t}):(r.chatKeys[e.from+"<->"+e.to]=t,r._messageBus.postMessage(d));break;case"senderHello":y.log("senderHello"),t.handshakeHistory.senderHello=r._filterMessageToHash(e),t.keys.fromRandom=(0,f.decodeToUint8Array)(e.body.value),t.keys.toRandom=r.crypto.generateRandom();var p={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"receiverHello",value:(0,f.encode)(t.keys.toRandom)}};t.handshakeHistory.receiverHello=r._filterMessageToHash(p,void 0,t.hypertyFrom.messageInfo),n({message:p,chatKeys:t});break;case"receiverHello":y.log("receiverHello"),r.getMyPrivateKey().then(function(n){return l=n,t.handshakeHistory.receiverHello=r._filterMessageToHash(e),r._idm.validateAssertion(e.body.identity.assertion,void 0,e.body.identity.idp.domain)}).then(function(n){var o="string"==typeof n.contents?n.contents:n.contents.nonce,i=(0,f.parseToUint8Array)(o),a=r.crypto.generatePMS(),s=e.body.value;t.hypertyTo.assertion=e.body.identity.assertion,t.hypertyTo.publicKey=i,t.hypertyTo.userID=e.body.identity.userProfile.userURL,t.keys.toRandom=(0,f.decodeToUint8Array)(s),t.keys.premasterKey=a;var u=r.crypto.concatPMSwithRandoms(a,t.keys.toRandom,t.keys.fromRandom);return r.crypto.generateMasterSecret(u,"messageHistoric"+t.keys.toRandom+t.keys.fromRandom)}).then(function(e){return t.keys.masterKey=e,r.crypto.generateKeys(e,"key expansion"+t.keys.toRandom+t.keys.fromRandom)}).then(function(n){t.keys.hypertyToSessionKey=new Uint8Array(n[0]),t.keys.hypertyFromSessionKey=new Uint8Array(n[1]),t.keys.hypertyToHashKey=new Uint8Array(n[2]),t.keys.hypertyFromHashKey=new Uint8Array(n[3]),a=r.crypto.generateIV(),u.iv=(0,f.encode)(a);var o={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"senderCertificate"}};return c=r._filterMessageToHash(o,"ok"+a,t.hypertyFrom.messageInfo),r.crypto.hashHMAC(t.keys.hypertyFromHashKey,c)}).then(function(e){return u.hash=(0,f.encode)(e),r.crypto.encryptAES(t.keys.hypertyFromSessionKey,"ok",a)}).then(function(e){return u.symetricEncryption=(0,f.encode)(e),r.crypto.encryptRSA(t.hypertyTo.publicKey,t.keys.premasterKey)}).then(function(n){u.assymetricEncryption=(0,f.encode)(n);var o={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"senderCertificate"}},i=r._filterMessageToHash(o,t.keys.premasterKey,t.hypertyFrom.messageInfo);return r.crypto.signRSA(l,(0,f.encode)(t.handshakeHistory)+(0,f.encode)(i))}).then(function(o){u.signature=(0,f.encode)(o);var i={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"senderCertificate",value:(0,f.encode)(u)}};t.handshakeHistory.senderCertificate=r._filterMessageToHash(i,"ok"+a,t.hypertyFrom.messageInfo),n({message:i,chatKeys:t})},function(e){return o(e)});break;case"senderCertificate":y.log("senderCertificate");var h=(0,f.decode)(e.body.value);r.getMyPrivateKey().then(function(t){return l=t,r._idm.validateAssertion(e.body.identity.assertion,void 0,e.body.identity.idp.domain)}).then(function(n){var o=(0,f.decodeToUint8Array)(h.assymetricEncryption),i="string"==typeof n.contents?n.contents:n.contents.nonce,a=(0,f.parseToUint8Array)(i);return t.hypertyTo.assertion=e.body.identity.assertion,t.hypertyTo.publicKey=a,t.hypertyTo.userID=e.body.identity.userProfile.userURL,r.crypto.decryptRSA(l,o)},function(e){o("Error during authentication of identity: ",e.message)}).then(function(n){t.keys.premasterKey=new Uint8Array(n);var o=(0,f.decodeToUint8Array)(h.signature),i=r._filterMessageToHash(e,t.keys.premasterKey);return r.crypto.verifyRSA(t.hypertyTo.publicKey,(0,f.encode)(t.handshakeHistory)+(0,f.encode)(i),o)}).then(function(e){var n=r.crypto.concatPMSwithRandoms(t.keys.premasterKey,t.keys.toRandom,t.keys.fromRandom);return r.crypto.generateMasterSecret(n,"messageHistoric"+t.keys.toRandom+t.keys.fromRandom)}).then(function(e){return t.keys.masterKey=e,r.crypto.generateKeys(e,"key expansion"+t.keys.toRandom+t.keys.fromRandom)}).then(function(e){t.keys.hypertyFromSessionKey=new Uint8Array(e[0]),t.keys.hypertyToSessionKey=new Uint8Array(e[1]),t.keys.hypertyFromHashKey=new Uint8Array(e[2]),t.keys.hypertyToHashKey=new Uint8Array(e[3]),a=(0,f.decodeToUint8Array)(h.iv);var n=(0,f.decodeToUint8Array)(h.symetricEncryption);return r.crypto.decryptAES(t.keys.hypertyToSessionKey,n,a)}).then(function(n){t.handshakeHistory.senderCertificate=r._filterMessageToHash(e,n+a);var o=(0,f.decodeToUint8Array)(h.hash);return c=r._filterMessageToHash(e,n+a),r.crypto.verifyHMAC(t.keys.hypertyToHashKey,c,o)}).then(function(n){var o={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"receiverFinishedMessage"}};return a=r.crypto.generateIV(),u.iv=(0,f.encode)(a),c=r._filterMessageToHash(o,"ok!"+a,t.hypertyFrom.messageInfo),r.crypto.hashHMAC(t.keys.hypertyFromHashKey,c)}).then(function(e){return u.hash=(0,f.encode)(e),r.crypto.encryptAES(t.keys.hypertyFromSessionKey,"ok!",a)}).then(function(o){u.value=(0,f.encode)(o);var i={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"receiverFinishedMessage",value:(0,f.encode)(u)}};t.handshakeHistory.receiverFinishedMessage=r._filterMessageToHash(i,"ok!"+a,t.hypertyFrom.messageInfo),t.authenticated=!0,n({message:i,chatKeys:t})}).catch(function(e){o("On _doHandShakePhase from senderCertificate error: "+e)});break;case"receiverFinishedMessage":t.authenticated=!0,u=(0,f.decode)(e.body.value),a=(0,f.decodeToUint8Array)(u.iv);var v=(0,f.decodeToUint8Array)(u.value);s=(0,f.decodeToUint8Array)(u.hash),r.crypto.decryptAES(t.keys.hypertyToSessionKey,v,a).then(function(i){t.handshakeHistory.receiverFinishedMessage=r._filterMessageToHash(e,i+a);var u=r._filterMessageToHash(e,i+a);r.crypto.verifyHMAC(t.keys.hypertyToHashKey,u,s).then(function(i){if(t.initialMessage){var a={type:"create",to:e.from,from:e.to,body:{value:t.initialMessage.body.value}};n({message:a,chatKeys:t})}else r._sendReporterSessionKey(e,t).then(function(e){n(e)}).catch(function(e){o("On _doHandShakePhase from receiverFinishedMessage error: "+e)})})});break;case"reporterSessionKey":y.log("reporterSessionKey");var g=(0,f.decode)(e.body.value);s=(0,f.decodeToUint8Array)(g.hash),a=(0,f.decodeToUint8Array)(g.iv);var b=(0,f.decodeToUint8Array)(g.value),_=void 0,m=void 0,R=void 0,O=void 0;r.crypto.decryptAES(t.keys.hypertyToSessionKey,b,a).then(function(n){_=(0,f.decode)(n),m=(0,f.decodeToUint8Array)(_.value),R=_.dataObjectURL;var o=r._filterMessageToHash(e,n+a);return r.crypto.verifyHMAC(t.keys.hypertyToHashKey,o,s)}).then(function(e){r.dataObjectSessionKeys[R]={sessionKey:m,isToEncrypt:!0};var n=(0,f.chatkeysToStringCloner)(r.dataObjectSessionKeys);return r.storageManager.set("dataObjectSessionKeys",0,n).catch(function(e){o("On _sendReporterSessionKey from method reporterSessionKey error: "+e)}),a=r.crypto.generateIV(),u.iv=(0,f.encode)(a),r.crypto.encryptAES(t.keys.hypertyFromSessionKey,"ok!!",a)}).then(function(n){O={type:"handshake",to:e.from,from:e.to,body:{handshakePhase:"receiverAcknowledge"}},u.value=(0,f.encode)(n);var o=r._filterMessageToHash(O,"ok!!"+a,t.hypertyFrom.messageInfo);return r.crypto.hashHMAC(t.keys.hypertyFromHashKey,o)}).then(function(e){var r=(0,f.encode)({value:u.value,hash:(0,f.encode)(e),iv:u.iv});O.body.value=r,n({message:O,chatKeys:t})}).catch(function(e){o("On _doHandShakePhase from reporterSessionKey error: "+e)});break;case"receiverAcknowledge":y.log("receiverAcknowledge");var w=(0,f.decode)(e.body.value),k=(0,f.decodeToUint8Array)(w.hash);a=(0,f.decodeToUint8Array)(w.iv);var S=(0,f.decodeToUint8Array)(w.value);r.crypto.decryptAES(t.keys.hypertyToSessionKey,S,a).then(function(n){var o=r._filterMessageToHash(e,n+a);return r.crypto.verifyHMAC(t.keys.hypertyToHashKey,o,k)}).then(function(e){var r=t.callback;r&&r("handShakeEnd"),n("handShakeEnd")}).catch(function(e){o("On _doHandShakePhase from receiverAcknowledge error: "+e)});break;default:o(e)}})}},{key:"_filterMessageToHash",value:function(e,t,r){return{type:e.type,from:e.from,to:e.to,body:{identity:r||e.body.identity,value:t||e.body.value,handshakePhase:e.body.handshakePhase}}}},{key:"_newChatCrypto",value:function(e,t,r){var n=this,o=r?e.to:e.from,i=r?e.from:e.to,a=n._idm.getIdentity(t);return{hypertyFrom:{hyperty:o,userID:a.userProfile.userURL,assertion:a.assertion,messageInfo:a},hypertyTo:{hyperty:i,userID:void 0,publicKey:void 0,assertion:void 0},keys:{hypertyToSessionKey:void 0,hypertyFromSessionKey:void 0,hypertyToHashKey:void 0,hypertyFromHashKey:void 0,toRandom:void 0,fromRandom:void 0,premasterKey:void 0,masterKey:void 0},handshakeHistory:{senderHello:void 0,receiverHello:void 0,senderCertificate:void 0,receiverFinishedMessage:void 0},initialMessage:e.body.ignore?void 0:e,callback:e.callback,authenticated:!1,dataObjectURL:e.dataObjectURL}}},{key:"getMyPublicKey",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.userDefaultKeyRef,t=this;return new o.default(function(r,n){t.storageManager.get(e).then(function(o){if(o)return r(o.public);t._generateAndStoreNewAsymetricKey(e).then(function(e){r(e.public)}).catch(function(e){y.error("[getMyPublicKey:_generateAndStoreNewAsymetricKey:err]: "+e.message),n(e)})}).catch(function(e){y.error("[getMyPublicKey:storageManager:err]: "+e.message),n(e)})})}},{key:"getMyPrivateKey",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.userDefaultKeyRef,t=this;return new o.default(function(r,n){t.storageManager.get(e).then(function(o){if(o)return r(o.private);t._generateAndStoreNewAsymetricKey(e).then(function(e){r(e.private)}).catch(function(e){y.error("[getMyPrivateKey:_generateAndStoreNewAsymetricKey:err]: "+e.message),n(e)})}).catch(function(e){y.error("[getMyPrivateKey:storageManager:err]: "+e.message),n(e)})})}},{key:"_generateAndStoreNewAsymetricKey",value:function(e){var t=this,r=void 0;return new o.default(function(n,o){t.crypto.generateRSAKeyPair().then(function(n){return y.log("_generateAndStoreNewAsymetricKey:userAsymmetricKeyGenerated",n),r=n,t.storageManager.set(e,0,n)}).then(function(e){y.log("_generateAndStoreNewAsymetricKey:userAsymmetricKeySuccess",e),n(r)}).catch(function(e){y.error("[_generateAndStoreNewAsymetricKey:err]: "+e.message),o(e)})})}},{key:"messageBus",get:function(){return this._messageBus},set:function(e){var t=this;t._messageBus=e,t.addCryptoGUIListeners()}},{key:"coreDiscovery",get:function(){return this._coreDiscovery},set:function(e){this._coreDiscovery=e}},{key:"registry",get:function(){return this._registry},set:function(e){this._registry=e}}]),CryptoManager}();t.default=new h,e.exports=t.default},function(e,t,r){var n=r(9),o=r(7).document,i=n(o)&&n(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,r){var n=r(7),o=r(31),i=r(48),a=r(156),s=r(13).f;e.exports=function(e){var t=o.Symbol||(o.Symbol=i?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,r){var n=r(83)("keys"),o=r(53);e.exports=function(e){return n[e]||(n[e]=o(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(7).document;e.exports=n&&n.documentElement},function(e,t,r){var n=r(9),o=r(5),i=function(e,t){if(o(e),!n(t)&&null!==t)throw TypeError(t+": can't set as prototype!")};e.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(e,t,n){try{n=r(32)(Function.call,r(29).f(Object.prototype,"__proto__").set,2),n(e,[]),t=!(e instanceof Array)}catch(e){t=!0}return function(e,r){return i(e,r),t?e.__proto__=r:n(e,r),e}}({},!1):void 0),check:i}},function(e,t){e.exports="\t\n\v\f\r   ᠎              \u2028\u2029\ufeff"},function(e,t,r){var n=r(9),o=r(111).set;e.exports=function(e,t,r){var i,a=t.constructor;return a!==r&&"function"==typeof a&&(i=a.prototype)!==r.prototype&&n(i)&&o&&o(e,i),e}},function(e,t,r){"use strict";var n=r(38),o=r(37);e.exports=function(e){var t=String(o(this)),r="",i=n(e);if(i<0||i==1/0)throw RangeError("Count can't be negative");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(r+=t);return r}},function(e,t){e.exports=Math.sign||function(e){return 0==(e=+e)||e!=e?e:e<0?-1:1}},function(e,t){var r=Math.expm1;e.exports=!r||r(10)>22025.465794806718||r(10)<22025.465794806718||-2e-17!=r(-2e-17)?function(e){return 0==(e=+e)?e:e>-1e-6&&e<1e-6?e+e*e/2:Math.exp(e)-1}:r},function(e,t,r){var n=r(38),o=r(37);e.exports=function(e){return function(t,r){var i,a,s=String(o(t)),u=n(r),c=s.length;return u<0||u>=c?e?"":void 0:(i=s.charCodeAt(u),i<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?e?s.charAt(u):i:e?s.slice(u,u+2):a-56320+(i-55296<<10)+65536)}}},function(e,t,r){"use strict";var n=r(48),o=r(0),i=r(24),a=r(23),s=r(66),u=r(119),c=r(64),l=r(30),f=r(10)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,r,y,h,v,g){u(r,t,y);var b,_,m,R=function(e){if(!d&&e in S)return S[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},O=t+" Iterator",w="values"==h,k=!1,S=e.prototype,P=S[f]||S["@@iterator"]||h&&S[h],D=P||R(h),M=h?w?R("entries"):D:void 0,L="Array"==t?S.entries||P:P;if(L&&(m=l(L.call(new e)))!==Object.prototype&&m.next&&(c(m,O,!0),n||"function"==typeof m[f]||a(m,f,p)),w&&P&&"values"!==P.name&&(k=!0,D=function(){return P.call(this)}),n&&!g||!d&&!k&&S[f]||a(S,f,D),s[t]=D,s[O]=p,h)if(b={values:w?D:R("values"),keys:v?D:R("keys"),entries:M},g)for(_ in b)_ in S||i(S,_,b[_]);else o(o.P+o.F*(d||k),t,b);return b}},function(e,t,r){"use strict";var n=r(56),o=r(52),i=r(64),a={};r(23)(a,r(10)("iterator"),function(){return this}),e.exports=function(e,t,r){e.prototype=n(a,{next:o(1,r)}),i(e,t+" Iterator")}},function(e,t,r){var n=r(87),o=r(37);e.exports=function(e,t,r){if(n(t))throw TypeError("String#"+r+" doesn't accept regex!");return String(o(e))}},function(e,t,r){var n=r(10)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,!"/./"[e](t)}catch(e){}}return!0}},function(e,t,r){var n=r(66),o=r(10)("iterator"),i=Array.prototype;e.exports=function(e){return void 0!==e&&(n.Array===e||i[o]===e)}},function(e,t,r){"use strict";var n=r(13),o=r(52);e.exports=function(e,t,r){t in e?n.f(e,t,o(0,r)):e[t]=r}},function(e,t,r){var n=r(75),o=r(10)("iterator"),i=r(66);e.exports=r(31).getIteratorMethod=function(e){if(void 0!=e)return e[o]||e["@@iterator"]||i[n(e)]}},function(e,t,r){var n=r(315);e.exports=function(e,t){return new(n(e))(t)}},function(e,t,r){"use strict";var n=r(19),o=r(55),i=r(14);e.exports=function(e){for(var t=n(this),r=i(t.length),a=arguments.length,s=o(a>1?arguments[1]:void 0,r),u=a>2?arguments[2]:void 0,c=void 0===u?r:o(u,r);c>s;)t[s++]=e;return t}},function(e,t,r){"use strict";var n=r(49),o=r(172),i=r(66),a=r(28);e.exports=r(118)(Array,"Array",function(e,t){this._t=a(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,r=this._i++;return!e||r>=e.length?(this._t=void 0,o(1)):"keys"==t?o(0,r):"values"==t?o(0,e[r]):o(0,[r,e[r]])},"values"),i.Arguments=i.Array,n("keys"),n("values"),n("entries")},function(e,t,r){var n,o,i,a=r(32),s=r(162),u=r(110),c=r(106),l=r(7),f=l.process,d=l.setImmediate,p=l.clearImmediate,y=l.MessageChannel,h=l.Dispatch,v=0,g={},b=function(){var e=+this;if(g.hasOwnProperty(e)){var t=g[e];delete g[e],t()}},_=function(e){b.call(e.data)};d&&p||(d=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return g[++v]=function(){s("function"==typeof e?e:Function(e),t)},n(v),v},p=function(e){delete g[e]},"process"==r(33)(f)?n=function(e){f.nextTick(a(b,e,1))}:h&&h.now?n=function(e){h.now(a(b,e,1))}:y?(o=new y,i=o.port2,o.port1.onmessage=_,n=a(i.postMessage,i,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(n=function(e){l.postMessage(e+"","*")},l.addEventListener("message",_,!1)):n="onreadystatechange"in c("script")?function(e){u.appendChild(c("script")).onreadystatechange=function(){u.removeChild(this),b.call(e)}}:function(e){setTimeout(a(b,e,1),0)}),e.exports={set:d,clear:p}},function(e,t,r){var n=r(7),o=r(128).set,i=n.MutationObserver||n.WebKitMutationObserver,a=n.process,s=n.Promise,u="process"==r(33)(a);e.exports=function(){var e,t,r,c=function(){var n,o;for(u&&(n=a.domain)&&n.exit();e;){o=e.fn,e=e.next;try{o()}catch(n){throw e?r():t=void 0,n}}t=void 0,n&&n.enter()};if(u)r=function(){a.nextTick(c)};else if(!i||n.navigator&&n.navigator.standalone)if(s&&s.resolve){var l=s.resolve(void 0);r=function(){l.then(c)}}else r=function(){o.call(n,c)};else{var f=!0,d=document.createTextNode("");new i(c).observe(d,{characterData:!0}),r=function(){d.data=f=!f}}return function(n){var o={fn:n,next:void 0};t&&(t.next=o),e||(e=o,r()),t=o}}},function(e,t,r){"use strict";function PromiseCapability(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=n(t),this.reject=n(r)}var n=r(20);e.exports.f=function(e){return new PromiseCapability(e)}},function(e,t,r){"use strict";function packIEEE754(e,t,r){var n,o,i,a=new Array(r),s=8*r-t-1,u=(1<>1,l=23===t?D(2,-24)-D(2,-77):0,f=0,d=e<0||0===e&&1/e<0?1:0;for(e=P(e),e!=e||e===k?(o=e!=e?1:0,n=u):(n=M(L(e)/j),e*(i=D(2,-n))<1&&(n--,i*=2),e+=n+c>=1?l/i:l*D(2,1-c),e*i>=2&&(n++,i/=2),n+c>=u?(o=0,n=u):n+c>=1?(o=(e*i-1)*D(2,t),n+=c):(o=e*D(2,c-1)*D(2,t),n=0));t>=8;a[f++]=255&o,o/=256,t-=8);for(n=n<0;a[f++]=255&n,n/=256,s-=8);return a[--f]|=128*d,a}function unpackIEEE754(e,t,r){var n,o=8*r-t-1,i=(1<>1,s=o-7,u=r-1,c=e[u--],l=127&c;for(c>>=7;s>0;l=256*l+e[u],u--,s-=8);for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;n=256*n+e[u],u--,s-=8);if(0===l)l=1-a;else{if(l===i)return n?NaN:c?-k:k;n+=D(2,t),l-=a}return(c?-1:1)*n*D(2,l-t)}function unpackI32(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function packI8(e){return[255&e]}function packI16(e){return[255&e,e>>8&255]}function packI32(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function packF64(e){return packIEEE754(e,52,8)}function packF32(e){return packIEEE754(e,23,4)}function addGetter(e,t,r){h(e[b],t,{get:function(){return this[r]}})}function get(e,t,r,n){var o=+r,i=p(o);if(i+t>e[E])throw w(_);var a=e[U]._b,s=i+e[x],u=a.slice(s,s+t);return n?u:u.reverse()}function set(e,t,r,n,o,i){var a=+r,s=p(a);if(s+t>e[E])throw w(_);for(var u=e[U]._b,c=s+e[x],l=n(+o),f=0;fT;)(A=C[T++])in m||s(m,A,S[A]);i||(I.constructor=m)}var q=new R(new m(2)),H=R[b].setInt8;q.setInt8(0,2147483648),q.setInt8(1,2147483649),!q.getInt8(0)&&q.getInt8(1)||u(R[b],{setInt8:function(e,t){H.call(this,e,t<<24>>24)},setUint8:function(e,t){H.call(this,e,t<<24>>24)}},!0)}else m=function(e){l(this,m,"ArrayBuffer");var t=p(e);this._b=v.call(new Array(t),0),this[E]=t},R=function(e,t,r){l(this,R,"DataView"),l(e,m,"DataView");var n=e[E],o=f(t);if(o<0||o>n)throw w("Wrong offset!");if(r=void 0===r?n-o:d(r),o+r>n)throw w("Wrong length!");this[U]=e,this[x]=o,this[E]=r},o&&(addGetter(m,"byteLength","_l"),addGetter(R,"buffer","_b"),addGetter(R,"byteLength","_l"),addGetter(R,"byteOffset","_o")),u(R[b],{getInt8:function(e){return get(this,1,e)[0]<<24>>24},getUint8:function(e){return get(this,1,e)[0]},getInt16:function(e){var t=get(this,2,e,arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=get(this,2,e,arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return unpackI32(get(this,4,e,arguments[1]))},getUint32:function(e){return unpackI32(get(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return unpackIEEE754(get(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return unpackIEEE754(get(this,8,e,arguments[1]),52,8)},setInt8:function(e,t){set(this,1,e,packI8,t)},setUint8:function(e,t){set(this,1,e,packI8,t)},setInt16:function(e,t){set(this,2,e,packI16,t,arguments[2])},setUint16:function(e,t){set(this,2,e,packI16,t,arguments[2])},setInt32:function(e,t){set(this,4,e,packI32,t,arguments[2])},setUint32:function(e,t){set(this,4,e,packI32,t,arguments[2])},setFloat32:function(e,t){set(this,4,e,packF32,t,arguments[2])},setFloat64:function(e,t){set(this,8,e,packF64,t,arguments[2])}});g(m,"ArrayBuffer"),g(R,"DataView"),s(R[b],a.VIEW,!0),t.ArrayBuffer=m,t.DataView=R},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var n=r(134),o=Math.min;e.exports=function(e){return e>0?o(n(e),9007199254740991):0}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(136)("keys"),o=r(98);e.exports=function(e){return n[e]||(n[e]=o(e))}},function(e,t,r){var n=r(11),o=r(21),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(78)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,r){var n=r(26),o=r(11),i=r(70);e.exports=function(e,t){var r=(o.Object||{})[e]||Object[e],a={};a[e]=t(r),n(n.S+n.F*i(function(){r(1)}),"Object",a)}},function(e,t,r){var n=r(45),o=r(21).document,i=n(o)&&n(o.createElement);e.exports=function(e){return i?o.createElement(e):{}}},function(e,t,r){var n=r(45);e.exports=function(e,t){if(!n(e))return e;var r,o;if(t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;if("function"==typeof(r=e.valueOf)&&!n(o=r.call(e)))return o;if(!t&&"function"==typeof(r=e.toString)&&!n(o=r.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){var n=r(41),o=r(433),i=r(137),a=r(135)("IE_PROTO"),s=function(){},u=function(){var e,t=r(139)("iframe"),n=i.length;for(t.style.display="none",r(195).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("