您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
This userscript provides an API to modify the viewing experience of Inoreader
- // ==UserScript==
- // @name Inoreader: viewing API for userscripts
- // @version 0.0.1
- // @namespace http://tampermonkey.net/
- // @description This userscript provides an API to modify the viewing experience of Inoreader
- // @homepage https://github.com/pboymt/userscript-typescript-template#readme
- // @license https://opensource.org/licenses/MIT
- // @match https://*.inoreader.com/feed*
- // @match https://*.inoreader.com/article*
- // @match https://*.inoreader.com/folder*
- // @match https://*.inoreader.com/starred*
- // @match https://*.inoreader.com/library*
- // @match https://*.inoreader.com/dashboard*
- // @match https://*.inoreader.com/web_pages*
- // @match https://*.inoreader.com/trending*
- // @match https://*.inoreader.com/commented*
- // @match https://*.inoreader.com/recent*
- // @match https://*.inoreader.com/search*
- // @match https://*.inoreader.com/channel*
- // @match https://*.inoreader.com/teams*
- // @match https://*.inoreader.com/dashboard*
- // @match https://*.inoreader.com/pocket*
- // @match https://*.inoreader.com/liked*
- // @match https://*.inoreader.com/tags*
- // @run-at document-end
- // ==/UserScript==
- /******/ (() => { // webpackBootstrap
- /******/ var __webpack_modules__ = ([
- /* 0 */,
- /* 1 */
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
- /*! *****************************************************************************
- Copyright (C) Microsoft. All rights reserved.
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
- this file except in compliance with the License. You may obtain a copy of the
- License at http://www.apache.org/licenses/LICENSE-2.0
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
- MERCHANTABLITY OR NON-INFRINGEMENT.
- See the Apache Version 2.0 License for specific language governing permissions
- and limitations under the License.
- ***************************************************************************** */
- var Reflect;
- (function (Reflect) {
- // Metadata Proposal
- // https://rbuckton.github.io/reflect-metadata/
- (function (factory) {
- var root = typeof __webpack_require__.g === "object" ? __webpack_require__.g :
- typeof self === "object" ? self :
- typeof this === "object" ? this :
- Function("return this;")();
- var exporter = makeExporter(Reflect);
- if (typeof root.Reflect === "undefined") {
- root.Reflect = Reflect;
- }
- else {
- exporter = makeExporter(root.Reflect, exporter);
- }
- factory(exporter);
- function makeExporter(target, previous) {
- return function (key, value) {
- if (typeof target[key] !== "function") {
- Object.defineProperty(target, key, { configurable: true, writable: true, value: value });
- }
- if (previous)
- previous(key, value);
- };
- }
- })(function (exporter) {
- var hasOwn = Object.prototype.hasOwnProperty;
- // feature test for Symbol support
- var supportsSymbol = typeof Symbol === "function";
- var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
- var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
- var supportsCreate = typeof Object.create === "function"; // feature test for Object.create support
- var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support
- var downLevel = !supportsCreate && !supportsProto;
- var HashMap = {
- // create an object in dictionary mode (a.k.a. "slow" mode in v8)
- create: supportsCreate
- ? function () { return MakeDictionary(Object.create(null)); }
- : supportsProto
- ? function () { return MakeDictionary({ __proto__: null }); }
- : function () { return MakeDictionary({}); },
- has: downLevel
- ? function (map, key) { return hasOwn.call(map, key); }
- : function (map, key) { return key in map; },
- get: downLevel
- ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }
- : function (map, key) { return map[key]; },
- };
- // Load global or shim versions of Map, Set, and WeakMap
- var functionPrototype = Object.getPrototypeOf(Function);
- var usePolyfill = typeof process === "object" && process.env && process.env["REFLECT_METADATA_USE_MAP_POLYFILL"] === "true";
- var _Map = !usePolyfill && typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
- var _Set = !usePolyfill && typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
- var _WeakMap = !usePolyfill && typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
- // [[Metadata]] internal slot
- // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots
- var Metadata = new _WeakMap();
- /**
- * Applies a set of decorators to a property of a target object.
- * @param decorators An array of decorators.
- * @param target The target object.
- * @param propertyKey (Optional) The property key to decorate.
- * @param attributes (Optional) The property descriptor for the target key.
- * @remarks Decorators are applied in reverse order.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * Example = Reflect.decorate(decoratorsArray, Example);
- *
- * // property (on constructor)
- * Reflect.decorate(decoratorsArray, Example, "staticProperty");
- *
- * // property (on prototype)
- * Reflect.decorate(decoratorsArray, Example.prototype, "property");
- *
- * // method (on constructor)
- * Object.defineProperty(Example, "staticMethod",
- * Reflect.decorate(decoratorsArray, Example, "staticMethod",
- * Object.getOwnPropertyDescriptor(Example, "staticMethod")));
- *
- * // method (on prototype)
- * Object.defineProperty(Example.prototype, "method",
- * Reflect.decorate(decoratorsArray, Example.prototype, "method",
- * Object.getOwnPropertyDescriptor(Example.prototype, "method")));
- *
- */
- function decorate(decorators, target, propertyKey, attributes) {
- if (!IsUndefined(propertyKey)) {
- if (!IsArray(decorators))
- throw new TypeError();
- if (!IsObject(target))
- throw new TypeError();
- if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
- throw new TypeError();
- if (IsNull(attributes))
- attributes = undefined;
- propertyKey = ToPropertyKey(propertyKey);
- return DecorateProperty(decorators, target, propertyKey, attributes);
- }
- else {
- if (!IsArray(decorators))
- throw new TypeError();
- if (!IsConstructor(target))
- throw new TypeError();
- return DecorateConstructor(decorators, target);
- }
- }
- exporter("decorate", decorate);
- // 4.1.2 Reflect.metadata(metadataKey, metadataValue)
- // https://rbuckton.github.io/reflect-metadata/#reflect.metadata
- /**
- * A default metadata decorator factory that can be used on a class, class member, or parameter.
- * @param metadataKey The key for the metadata entry.
- * @param metadataValue The value for the metadata entry.
- * @returns A decorator function.
- * @remarks
- * If `metadataKey` is already defined for the target and target key, the
- * metadataValue for that key will be overwritten.
- * @example
- *
- * // constructor
- * @Reflect.metadata(key, value)
- * class Example {
- * }
- *
- * // property (on constructor, TypeScript only)
- * class Example {
- * @Reflect.metadata(key, value)
- * static staticProperty;
- * }
- *
- * // property (on prototype, TypeScript only)
- * class Example {
- * @Reflect.metadata(key, value)
- * property;
- * }
- *
- * // method (on constructor)
- * class Example {
- * @Reflect.metadata(key, value)
- * static staticMethod() { }
- * }
- *
- * // method (on prototype)
- * class Example {
- * @Reflect.metadata(key, value)
- * method() { }
- * }
- *
- */
- function metadata(metadataKey, metadataValue) {
- function decorator(target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
- throw new TypeError();
- OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
- }
- return decorator;
- }
- exporter("metadata", metadata);
- /**
- * Define a unique metadata entry on the target.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param metadataValue A value that contains attached metadata.
- * @param target The target object on which to define metadata.
- * @param propertyKey (Optional) The property key for the target.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * Reflect.defineMetadata("custom:annotation", options, Example);
- *
- * // property (on constructor)
- * Reflect.defineMetadata("custom:annotation", options, Example, "staticProperty");
- *
- * // property (on prototype)
- * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "property");
- *
- * // method (on constructor)
- * Reflect.defineMetadata("custom:annotation", options, Example, "staticMethod");
- *
- * // method (on prototype)
- * Reflect.defineMetadata("custom:annotation", options, Example.prototype, "method");
- *
- * // decorator factory as metadata-producing annotation.
- * function MyAnnotation(options): Decorator {
- * return (target, key?) => Reflect.defineMetadata("custom:annotation", options, target, key);
- * }
- *
- */
- function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
- }
- exporter("defineMetadata", defineMetadata);
- /**
- * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.hasMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.hasMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.hasMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.hasMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function hasMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryHasMetadata(metadataKey, target, propertyKey);
- }
- exporter("hasMetadata", hasMetadata);
- /**
- * Gets a value indicating whether the target object has the provided metadata key defined.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.hasOwnMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.hasOwnMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function hasOwnMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
- }
- exporter("hasOwnMetadata", hasOwnMetadata);
- /**
- * Gets the metadata value for the provided metadata key on the target object or its prototype chain.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.getMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function getMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryGetMetadata(metadataKey, target, propertyKey);
- }
- exporter("getMetadata", getMetadata);
- /**
- * Gets the metadata value for the provided metadata key on the target object.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns The metadata value for the metadata key if found; otherwise, `undefined`.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getOwnMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getOwnMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getOwnMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function getOwnMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
- }
- exporter("getOwnMetadata", getOwnMetadata);
- /**
- * Gets the metadata keys defined on the target object or its prototype chain.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns An array of unique metadata keys.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getMetadataKeys(Example);
- *
- * // property (on constructor)
- * result = Reflect.getMetadataKeys(Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getMetadataKeys(Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getMetadataKeys(Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getMetadataKeys(Example.prototype, "method");
- *
- */
- function getMetadataKeys(target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryMetadataKeys(target, propertyKey);
- }
- exporter("getMetadataKeys", getMetadataKeys);
- /**
- * Gets the unique metadata keys defined on the target object.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns An array of unique metadata keys.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.getOwnMetadataKeys(Example);
- *
- * // property (on constructor)
- * result = Reflect.getOwnMetadataKeys(Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.getOwnMetadataKeys(Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.getOwnMetadataKeys(Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.getOwnMetadataKeys(Example.prototype, "method");
- *
- */
- function getOwnMetadataKeys(target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- return OrdinaryOwnMetadataKeys(target, propertyKey);
- }
- exporter("getOwnMetadataKeys", getOwnMetadataKeys);
- /**
- * Deletes the metadata entry from the target object with the provided key.
- * @param metadataKey A key used to store and retrieve metadata.
- * @param target The target object on which the metadata is defined.
- * @param propertyKey (Optional) The property key for the target.
- * @returns `true` if the metadata entry was found and deleted; otherwise, false.
- * @example
- *
- * class Example {
- * // property declarations are not part of ES6, though they are valid in TypeScript:
- * // static staticProperty;
- * // property;
- *
- * constructor(p) { }
- * static staticMethod(p) { }
- * method(p) { }
- * }
- *
- * // constructor
- * result = Reflect.deleteMetadata("custom:annotation", Example);
- *
- * // property (on constructor)
- * result = Reflect.deleteMetadata("custom:annotation", Example, "staticProperty");
- *
- * // property (on prototype)
- * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "property");
- *
- * // method (on constructor)
- * result = Reflect.deleteMetadata("custom:annotation", Example, "staticMethod");
- *
- * // method (on prototype)
- * result = Reflect.deleteMetadata("custom:annotation", Example.prototype, "method");
- *
- */
- function deleteMetadata(metadataKey, target, propertyKey) {
- if (!IsObject(target))
- throw new TypeError();
- if (!IsUndefined(propertyKey))
- propertyKey = ToPropertyKey(propertyKey);
- var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return false;
- if (!metadataMap.delete(metadataKey))
- return false;
- if (metadataMap.size > 0)
- return true;
- var targetMetadata = Metadata.get(target);
- targetMetadata.delete(propertyKey);
- if (targetMetadata.size > 0)
- return true;
- Metadata.delete(target);
- return true;
- }
- exporter("deleteMetadata", deleteMetadata);
- function DecorateConstructor(decorators, target) {
- for (var i = decorators.length - 1; i >= 0; --i) {
- var decorator = decorators[i];
- var decorated = decorator(target);
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
- if (!IsConstructor(decorated))
- throw new TypeError();
- target = decorated;
- }
- }
- return target;
- }
- function DecorateProperty(decorators, target, propertyKey, descriptor) {
- for (var i = decorators.length - 1; i >= 0; --i) {
- var decorator = decorators[i];
- var decorated = decorator(target, propertyKey, descriptor);
- if (!IsUndefined(decorated) && !IsNull(decorated)) {
- if (!IsObject(decorated))
- throw new TypeError();
- descriptor = decorated;
- }
- }
- return descriptor;
- }
- function GetOrCreateMetadataMap(O, P, Create) {
- var targetMetadata = Metadata.get(O);
- if (IsUndefined(targetMetadata)) {
- if (!Create)
- return undefined;
- targetMetadata = new _Map();
- Metadata.set(O, targetMetadata);
- }
- var metadataMap = targetMetadata.get(P);
- if (IsUndefined(metadataMap)) {
- if (!Create)
- return undefined;
- metadataMap = new _Map();
- targetMetadata.set(P, metadataMap);
- }
- return metadataMap;
- }
- // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata
- function OrdinaryHasMetadata(MetadataKey, O, P) {
- var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
- if (hasOwn)
- return true;
- var parent = OrdinaryGetPrototypeOf(O);
- if (!IsNull(parent))
- return OrdinaryHasMetadata(MetadataKey, parent, P);
- return false;
- }
- // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata
- function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return false;
- return ToBoolean(metadataMap.has(MetadataKey));
- }
- // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata
- function OrdinaryGetMetadata(MetadataKey, O, P) {
- var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);
- if (hasOwn)
- return OrdinaryGetOwnMetadata(MetadataKey, O, P);
- var parent = OrdinaryGetPrototypeOf(O);
- if (!IsNull(parent))
- return OrdinaryGetMetadata(MetadataKey, parent, P);
- return undefined;
- }
- // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata
- function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return undefined;
- return metadataMap.get(MetadataKey);
- }
- // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata
- function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);
- metadataMap.set(MetadataKey, MetadataValue);
- }
- // 3.1.6.1 OrdinaryMetadataKeys(O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys
- function OrdinaryMetadataKeys(O, P) {
- var ownKeys = OrdinaryOwnMetadataKeys(O, P);
- var parent = OrdinaryGetPrototypeOf(O);
- if (parent === null)
- return ownKeys;
- var parentKeys = OrdinaryMetadataKeys(parent, P);
- if (parentKeys.length <= 0)
- return ownKeys;
- if (ownKeys.length <= 0)
- return parentKeys;
- var set = new _Set();
- var keys = [];
- for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {
- var key = ownKeys_1[_i];
- var hasKey = set.has(key);
- if (!hasKey) {
- set.add(key);
- keys.push(key);
- }
- }
- for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {
- var key = parentKeys_1[_a];
- var hasKey = set.has(key);
- if (!hasKey) {
- set.add(key);
- keys.push(key);
- }
- }
- return keys;
- }
- // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)
- // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys
- function OrdinaryOwnMetadataKeys(O, P) {
- var keys = [];
- var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);
- if (IsUndefined(metadataMap))
- return keys;
- var keysObj = metadataMap.keys();
- var iterator = GetIterator(keysObj);
- var k = 0;
- while (true) {
- var next = IteratorStep(iterator);
- if (!next) {
- keys.length = k;
- return keys;
- }
- var nextValue = IteratorValue(next);
- try {
- keys[k] = nextValue;
- }
- catch (e) {
- try {
- IteratorClose(iterator);
- }
- finally {
- throw e;
- }
- }
- k++;
- }
- }
- // 6 ECMAScript Data Typ0es and Values
- // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values
- function Type(x) {
- if (x === null)
- return 1 /* Null */;
- switch (typeof x) {
- case "undefined": return 0 /* Undefined */;
- case "boolean": return 2 /* Boolean */;
- case "string": return 3 /* String */;
- case "symbol": return 4 /* Symbol */;
- case "number": return 5 /* Number */;
- case "object": return x === null ? 1 /* Null */ : 6 /* Object */;
- default: return 6 /* Object */;
- }
- }
- // 6.1.1 The Undefined Type
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type
- function IsUndefined(x) {
- return x === undefined;
- }
- // 6.1.2 The Null Type
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type
- function IsNull(x) {
- return x === null;
- }
- // 6.1.5 The Symbol Type
- // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type
- function IsSymbol(x) {
- return typeof x === "symbol";
- }
- // 6.1.7 The Object Type
- // https://tc39.github.io/ecma262/#sec-object-type
- function IsObject(x) {
- return typeof x === "object" ? x !== null : typeof x === "function";
- }
- // 7.1 Type Conversion
- // https://tc39.github.io/ecma262/#sec-type-conversion
- // 7.1.1 ToPrimitive(input [, PreferredType])
- // https://tc39.github.io/ecma262/#sec-toprimitive
- function ToPrimitive(input, PreferredType) {
- switch (Type(input)) {
- case 0 /* Undefined */: return input;
- case 1 /* Null */: return input;
- case 2 /* Boolean */: return input;
- case 3 /* String */: return input;
- case 4 /* Symbol */: return input;
- case 5 /* Number */: return input;
- }
- var hint = PreferredType === 3 /* String */ ? "string" : PreferredType === 5 /* Number */ ? "number" : "default";
- var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
- if (exoticToPrim !== undefined) {
- var result = exoticToPrim.call(input, hint);
- if (IsObject(result))
- throw new TypeError();
- return result;
- }
- return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
- }
- // 7.1.1.1 OrdinaryToPrimitive(O, hint)
- // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive
- function OrdinaryToPrimitive(O, hint) {
- if (hint === "string") {
- var toString_1 = O.toString;
- if (IsCallable(toString_1)) {
- var result = toString_1.call(O);
- if (!IsObject(result))
- return result;
- }
- var valueOf = O.valueOf;
- if (IsCallable(valueOf)) {
- var result = valueOf.call(O);
- if (!IsObject(result))
- return result;
- }
- }
- else {
- var valueOf = O.valueOf;
- if (IsCallable(valueOf)) {
- var result = valueOf.call(O);
- if (!IsObject(result))
- return result;
- }
- var toString_2 = O.toString;
- if (IsCallable(toString_2)) {
- var result = toString_2.call(O);
- if (!IsObject(result))
- return result;
- }
- }
- throw new TypeError();
- }
- // 7.1.2 ToBoolean(argument)
- // https://tc39.github.io/ecma262/2016/#sec-toboolean
- function ToBoolean(argument) {
- return !!argument;
- }
- // 7.1.12 ToString(argument)
- // https://tc39.github.io/ecma262/#sec-tostring
- function ToString(argument) {
- return "" + argument;
- }
- // 7.1.14 ToPropertyKey(argument)
- // https://tc39.github.io/ecma262/#sec-topropertykey
- function ToPropertyKey(argument) {
- var key = ToPrimitive(argument, 3 /* String */);
- if (IsSymbol(key))
- return key;
- return ToString(key);
- }
- // 7.2 Testing and Comparison Operations
- // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations
- // 7.2.2 IsArray(argument)
- // https://tc39.github.io/ecma262/#sec-isarray
- function IsArray(argument) {
- return Array.isArray
- ? Array.isArray(argument)
- : argument instanceof Object
- ? argument instanceof Array
- : Object.prototype.toString.call(argument) === "[object Array]";
- }
- // 7.2.3 IsCallable(argument)
- // https://tc39.github.io/ecma262/#sec-iscallable
- function IsCallable(argument) {
- // NOTE: This is an approximation as we cannot check for [[Call]] internal method.
- return typeof argument === "function";
- }
- // 7.2.4 IsConstructor(argument)
- // https://tc39.github.io/ecma262/#sec-isconstructor
- function IsConstructor(argument) {
- // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.
- return typeof argument === "function";
- }
- // 7.2.7 IsPropertyKey(argument)
- // https://tc39.github.io/ecma262/#sec-ispropertykey
- function IsPropertyKey(argument) {
- switch (Type(argument)) {
- case 3 /* String */: return true;
- case 4 /* Symbol */: return true;
- default: return false;
- }
- }
- // 7.3 Operations on Objects
- // https://tc39.github.io/ecma262/#sec-operations-on-objects
- // 7.3.9 GetMethod(V, P)
- // https://tc39.github.io/ecma262/#sec-getmethod
- function GetMethod(V, P) {
- var func = V[P];
- if (func === undefined || func === null)
- return undefined;
- if (!IsCallable(func))
- throw new TypeError();
- return func;
- }
- // 7.4 Operations on Iterator Objects
- // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects
- function GetIterator(obj) {
- var method = GetMethod(obj, iteratorSymbol);
- if (!IsCallable(method))
- throw new TypeError(); // from Call
- var iterator = method.call(obj);
- if (!IsObject(iterator))
- throw new TypeError();
- return iterator;
- }
- // 7.4.4 IteratorValue(iterResult)
- // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue
- function IteratorValue(iterResult) {
- return iterResult.value;
- }
- // 7.4.5 IteratorStep(iterator)
- // https://tc39.github.io/ecma262/#sec-iteratorstep
- function IteratorStep(iterator) {
- var result = iterator.next();
- return result.done ? false : result;
- }
- // 7.4.6 IteratorClose(iterator, completion)
- // https://tc39.github.io/ecma262/#sec-iteratorclose
- function IteratorClose(iterator) {
- var f = iterator["return"];
- if (f)
- f.call(iterator);
- }
- // 9.1 Ordinary Object Internal Methods and Internal Slots
- // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots
- // 9.1.1.1 OrdinaryGetPrototypeOf(O)
- // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof
- function OrdinaryGetPrototypeOf(O) {
- var proto = Object.getPrototypeOf(O);
- if (typeof O !== "function" || O === functionPrototype)
- return proto;
- // TypeScript doesn't set __proto__ in ES5, as it's non-standard.
- // Try to determine the superclass constructor. Compatible implementations
- // must either set __proto__ on a subclass constructor to the superclass constructor,
- // or ensure each class has a valid `constructor` property on its prototype that
- // points back to the constructor.
- // If this is not the same as Function.[[Prototype]], then this is definately inherited.
- // This is the case when in ES6 or when using __proto__ in a compatible browser.
- if (proto !== functionPrototype)
- return proto;
- // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.
- var prototype = O.prototype;
- var prototypeProto = prototype && Object.getPrototypeOf(prototype);
- if (prototypeProto == null || prototypeProto === Object.prototype)
- return proto;
- // If the constructor was not a function, then we cannot determine the heritage.
- var constructor = prototypeProto.constructor;
- if (typeof constructor !== "function")
- return proto;
- // If we have some kind of self-reference, then we cannot determine the heritage.
- if (constructor === O)
- return proto;
- // we have a pretty good guess at the heritage.
- return constructor;
- }
- // naive Map shim
- function CreateMapPolyfill() {
- var cacheSentinel = {};
- var arraySentinel = [];
- var MapIterator = /** @class */ (function () {
- function MapIterator(keys, values, selector) {
- this._index = 0;
- this._keys = keys;
- this._values = values;
- this._selector = selector;
- }
- MapIterator.prototype["@@iterator"] = function () { return this; };
- MapIterator.prototype[iteratorSymbol] = function () { return this; };
- MapIterator.prototype.next = function () {
- var index = this._index;
- if (index >= 0 && index < this._keys.length) {
- var result = this._selector(this._keys[index], this._values[index]);
- if (index + 1 >= this._keys.length) {
- this._index = -1;
- this._keys = arraySentinel;
- this._values = arraySentinel;
- }
- else {
- this._index++;
- }
- return { value: result, done: false };
- }
- return { value: undefined, done: true };
- };
- MapIterator.prototype.throw = function (error) {
- if (this._index >= 0) {
- this._index = -1;
- this._keys = arraySentinel;
- this._values = arraySentinel;
- }
- throw error;
- };
- MapIterator.prototype.return = function (value) {
- if (this._index >= 0) {
- this._index = -1;
- this._keys = arraySentinel;
- this._values = arraySentinel;
- }
- return { value: value, done: true };
- };
- return MapIterator;
- }());
- return /** @class */ (function () {
- function Map() {
- this._keys = [];
- this._values = [];
- this._cacheKey = cacheSentinel;
- this._cacheIndex = -2;
- }
- Object.defineProperty(Map.prototype, "size", {
- get: function () { return this._keys.length; },
- enumerable: true,
- configurable: true
- });
- Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };
- Map.prototype.get = function (key) {
- var index = this._find(key, /*insert*/ false);
- return index >= 0 ? this._values[index] : undefined;
- };
- Map.prototype.set = function (key, value) {
- var index = this._find(key, /*insert*/ true);
- this._values[index] = value;
- return this;
- };
- Map.prototype.delete = function (key) {
- var index = this._find(key, /*insert*/ false);
- if (index >= 0) {
- var size = this._keys.length;
- for (var i = index + 1; i < size; i++) {
- this._keys[i - 1] = this._keys[i];
- this._values[i - 1] = this._values[i];
- }
- this._keys.length--;
- this._values.length--;
- if (key === this._cacheKey) {
- this._cacheKey = cacheSentinel;
- this._cacheIndex = -2;
- }
- return true;
- }
- return false;
- };
- Map.prototype.clear = function () {
- this._keys.length = 0;
- this._values.length = 0;
- this._cacheKey = cacheSentinel;
- this._cacheIndex = -2;
- };
- Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };
- Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };
- Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };
- Map.prototype["@@iterator"] = function () { return this.entries(); };
- Map.prototype[iteratorSymbol] = function () { return this.entries(); };
- Map.prototype._find = function (key, insert) {
- if (this._cacheKey !== key) {
- this._cacheIndex = this._keys.indexOf(this._cacheKey = key);
- }
- if (this._cacheIndex < 0 && insert) {
- this._cacheIndex = this._keys.length;
- this._keys.push(key);
- this._values.push(undefined);
- }
- return this._cacheIndex;
- };
- return Map;
- }());
- function getKey(key, _) {
- return key;
- }
- function getValue(_, value) {
- return value;
- }
- function getEntry(key, value) {
- return [key, value];
- }
- }
- // naive Set shim
- function CreateSetPolyfill() {
- return /** @class */ (function () {
- function Set() {
- this._map = new _Map();
- }
- Object.defineProperty(Set.prototype, "size", {
- get: function () { return this._map.size; },
- enumerable: true,
- configurable: true
- });
- Set.prototype.has = function (value) { return this._map.has(value); };
- Set.prototype.add = function (value) { return this._map.set(value, value), this; };
- Set.prototype.delete = function (value) { return this._map.delete(value); };
- Set.prototype.clear = function () { this._map.clear(); };
- Set.prototype.keys = function () { return this._map.keys(); };
- Set.prototype.values = function () { return this._map.values(); };
- Set.prototype.entries = function () { return this._map.entries(); };
- Set.prototype["@@iterator"] = function () { return this.keys(); };
- Set.prototype[iteratorSymbol] = function () { return this.keys(); };
- return Set;
- }());
- }
- // naive WeakMap shim
- function CreateWeakMapPolyfill() {
- var UUID_SIZE = 16;
- var keys = HashMap.create();
- var rootKey = CreateUniqueKey();
- return /** @class */ (function () {
- function WeakMap() {
- this._key = CreateUniqueKey();
- }
- WeakMap.prototype.has = function (target) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ false);
- return table !== undefined ? HashMap.has(table, this._key) : false;
- };
- WeakMap.prototype.get = function (target) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ false);
- return table !== undefined ? HashMap.get(table, this._key) : undefined;
- };
- WeakMap.prototype.set = function (target, value) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ true);
- table[this._key] = value;
- return this;
- };
- WeakMap.prototype.delete = function (target) {
- var table = GetOrCreateWeakMapTable(target, /*create*/ false);
- return table !== undefined ? delete table[this._key] : false;
- };
- WeakMap.prototype.clear = function () {
- // NOTE: not a real clear, just makes the previous data unreachable
- this._key = CreateUniqueKey();
- };
- return WeakMap;
- }());
- function CreateUniqueKey() {
- var key;
- do
- key = "@@WeakMap@@" + CreateUUID();
- while (HashMap.has(keys, key));
- keys[key] = true;
- return key;
- }
- function GetOrCreateWeakMapTable(target, create) {
- if (!hasOwn.call(target, rootKey)) {
- if (!create)
- return undefined;
- Object.defineProperty(target, rootKey, { value: HashMap.create() });
- }
- return target[rootKey];
- }
- function FillRandomBytes(buffer, size) {
- for (var i = 0; i < size; ++i)
- buffer[i] = Math.random() * 0xff | 0;
- return buffer;
- }
- function GenRandomBytes(size) {
- if (typeof Uint8Array === "function") {
- if (typeof crypto !== "undefined")
- return crypto.getRandomValues(new Uint8Array(size));
- if (typeof msCrypto !== "undefined")
- return msCrypto.getRandomValues(new Uint8Array(size));
- return FillRandomBytes(new Uint8Array(size), size);
- }
- return FillRandomBytes(new Array(size), size);
- }
- function CreateUUID() {
- var data = GenRandomBytes(UUID_SIZE);
- // mark as random - RFC 4122 § 4.4
- data[6] = data[6] & 0x4f | 0x40;
- data[8] = data[8] & 0xbf | 0x80;
- var result = "";
- for (var offset = 0; offset < UUID_SIZE; ++offset) {
- var byte = data[offset];
- if (offset === 4 || offset === 6 || offset === 8)
- result += "-";
- if (byte < 16)
- result += "0";
- result += byte.toString(16).toLowerCase();
- }
- return result;
- }
- }
- // uses a heuristic used by v8 and chakra to force an object into dictionary mode.
- function MakeDictionary(obj) {
- obj.__ = undefined;
- delete obj.__;
- return obj;
- }
- });
- })(Reflect || (Reflect = {}));
- /***/ }),
- /* 2 */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.App = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const app_facade_1 = __webpack_require__(37);
- const logger_1 = __webpack_require__(43);
- class App {
- constructor() {
- logger_1.Logger.log("🔵 Script is initialized!");
- this.facadeInstance = tsyringe_1.container.resolve(app_facade_1.AppFacade);
- this.initializeFeatures();
- }
- initializeFeatures() {
- }
- }
- exports.App = App;
- /***/ }),
- /* 3 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Lifecycle": () => (/* reexport safe */ _types__WEBPACK_IMPORTED_MODULE_0__.Lifecycle),
- /* harmony export */ "autoInjectable": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.autoInjectable),
- /* harmony export */ "container": () => (/* reexport safe */ _dependency_container__WEBPACK_IMPORTED_MODULE_5__.instance),
- /* harmony export */ "delay": () => (/* reexport safe */ _lazy_helpers__WEBPACK_IMPORTED_MODULE_4__.delay),
- /* harmony export */ "inject": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.inject),
- /* harmony export */ "injectAll": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectAll),
- /* harmony export */ "injectAllWithTransform": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectAllWithTransform),
- /* harmony export */ "injectWithTransform": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectWithTransform),
- /* harmony export */ "injectable": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.injectable),
- /* harmony export */ "instanceCachingFactory": () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.instanceCachingFactory),
- /* harmony export */ "instancePerContainerCachingFactory": () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.instancePerContainerCachingFactory),
- /* harmony export */ "isClassProvider": () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isClassProvider),
- /* harmony export */ "isFactoryProvider": () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isFactoryProvider),
- /* harmony export */ "isNormalToken": () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isNormalToken),
- /* harmony export */ "isTokenProvider": () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isTokenProvider),
- /* harmony export */ "isValueProvider": () => (/* reexport safe */ _providers__WEBPACK_IMPORTED_MODULE_3__.isValueProvider),
- /* harmony export */ "predicateAwareClassFactory": () => (/* reexport safe */ _factories__WEBPACK_IMPORTED_MODULE_2__.predicateAwareClassFactory),
- /* harmony export */ "registry": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.registry),
- /* harmony export */ "scoped": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.scoped),
- /* harmony export */ "singleton": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.singleton)
- /* harmony export */ });
- /* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
- /* harmony import */ var _decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
- /* harmony import */ var _factories__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(33);
- /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
- /* harmony import */ var _lazy_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(14);
- /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9);
- if (typeof Reflect === "undefined" || !Reflect.getMetadata) {
- throw new Error("tsyringe requires a reflect polyfill. Please add 'import \"reflect-metadata\"' to the top of your entry point.");
- }
- /***/ }),
- /* 4 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "Lifecycle": () => (/* reexport safe */ _lifecycle__WEBPACK_IMPORTED_MODULE_0__["default"])
- /* harmony export */ });
- /* harmony import */ var _lifecycle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
- /***/ }),
- /* 5 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var Lifecycle;
- (function (Lifecycle) {
- Lifecycle[Lifecycle["Transient"] = 0] = "Transient";
- Lifecycle[Lifecycle["Singleton"] = 1] = "Singleton";
- Lifecycle[Lifecycle["ResolutionScoped"] = 2] = "ResolutionScoped";
- Lifecycle[Lifecycle["ContainerScoped"] = 3] = "ContainerScoped";
- })(Lifecycle || (Lifecycle = {}));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Lifecycle);
- /***/ }),
- /* 6 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "autoInjectable": () => (/* reexport safe */ _auto_injectable__WEBPACK_IMPORTED_MODULE_0__["default"]),
- /* harmony export */ "inject": () => (/* reexport safe */ _inject__WEBPACK_IMPORTED_MODULE_1__["default"]),
- /* harmony export */ "injectAll": () => (/* reexport safe */ _inject_all__WEBPACK_IMPORTED_MODULE_5__["default"]),
- /* harmony export */ "injectAllWithTransform": () => (/* reexport safe */ _inject_all_with_transform__WEBPACK_IMPORTED_MODULE_6__["default"]),
- /* harmony export */ "injectWithTransform": () => (/* reexport safe */ _inject_with_transform__WEBPACK_IMPORTED_MODULE_7__["default"]),
- /* harmony export */ "injectable": () => (/* reexport safe */ _injectable__WEBPACK_IMPORTED_MODULE_2__["default"]),
- /* harmony export */ "registry": () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_3__["default"]),
- /* harmony export */ "scoped": () => (/* reexport safe */ _scoped__WEBPACK_IMPORTED_MODULE_8__["default"]),
- /* harmony export */ "singleton": () => (/* reexport safe */ _singleton__WEBPACK_IMPORTED_MODULE_4__["default"])
- /* harmony export */ });
- /* harmony import */ var _auto_injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
- /* harmony import */ var _inject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25);
- /* harmony import */ var _injectable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
- /* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(27);
- /* harmony import */ var _singleton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28);
- /* harmony import */ var _inject_all__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(29);
- /* harmony import */ var _inject_all_with_transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(30);
- /* harmony import */ var _inject_with_transform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(31);
- /* harmony import */ var _scoped__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(32);
- /***/ }),
- /* 7 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(15);
- /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
- /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
- /* harmony import */ var _providers_injection_token__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
- /* harmony import */ var _error_helpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22);
- function autoInjectable() {
- return function (target) {
- var paramInfo = (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.getParamInfo)(target);
- return (function (_super) {
- (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__extends)(class_1, _super);
- function class_1() {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- return _super.apply(this, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)(args.concat(paramInfo.slice(args.length).map(function (type, index) {
- var _a, _b, _c;
- try {
- if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTokenDescriptor)(type)) {
- if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(type)) {
- return type.multiple
- ? (_a = _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.transform)).transform.apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)([_dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolveAll(type.token)], type.transformArgs)) : (_b = _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.transform)).transform.apply(_b, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)([_dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.token)], type.transformArgs));
- }
- else {
- return type.multiple
- ? _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolveAll(type.token)
- : _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.token);
- }
- }
- else if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(type)) {
- return (_c = _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.transform)).transform.apply(_c, (0,tslib__WEBPACK_IMPORTED_MODULE_4__.__spread)([_dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type.token)], type.transformArgs));
- }
- return _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.resolve(type);
- }
- catch (e) {
- var argIndex = index + args.length;
- throw new Error((0,_error_helpers__WEBPACK_IMPORTED_MODULE_3__.formatErrorCtor)(target, argIndex, e));
- }
- })))) || this;
- }
- return class_1;
- }(target));
- };
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (autoInjectable);
- /***/ }),
- /* 8 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "INJECTION_TOKEN_METADATA_KEY": () => (/* binding */ INJECTION_TOKEN_METADATA_KEY),
- /* harmony export */ "defineInjectionTokenMetadata": () => (/* binding */ defineInjectionTokenMetadata),
- /* harmony export */ "getParamInfo": () => (/* binding */ getParamInfo)
- /* harmony export */ });
- var INJECTION_TOKEN_METADATA_KEY = "injectionTokens";
- function getParamInfo(target) {
- var params = Reflect.getMetadata("design:paramtypes", target) || [];
- var injectionTokens = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};
- Object.keys(injectionTokens).forEach(function (key) {
- params[+key] = injectionTokens[key];
- });
- return params;
- }
- function defineInjectionTokenMetadata(data, transform) {
- return function (target, _propertyKey, parameterIndex) {
- var descriptors = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {};
- descriptors[parameterIndex] = transform
- ? {
- token: data,
- transform: transform.transformToken,
- transformArgs: transform.args || []
- }
- : data;
- Reflect.defineMetadata(INJECTION_TOKEN_METADATA_KEY, descriptors, target);
- };
- }
- /***/ }),
- /* 9 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
- /* harmony export */ "instance": () => (/* binding */ instance),
- /* harmony export */ "typeInfo": () => (/* binding */ typeInfo)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(15);
- /* harmony import */ var _providers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(10);
- /* harmony import */ var _providers_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
- /* harmony import */ var _providers_injection_token__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
- /* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(19);
- /* harmony import */ var _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5);
- /* harmony import */ var _resolution_context__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(21);
- /* harmony import */ var _error_helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(22);
- /* harmony import */ var _lazy_helpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(14);
- /* harmony import */ var _types_disposable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(23);
- /* harmony import */ var _interceptors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(24);
- var typeInfo = new Map();
- var InternalDependencyContainer = (function () {
- function InternalDependencyContainer(parent) {
- this.parent = parent;
- this._registry = new _registry__WEBPACK_IMPORTED_MODULE_3__["default"]();
- this.interceptors = new _interceptors__WEBPACK_IMPORTED_MODULE_9__["default"]();
- this.disposed = false;
- this.disposables = new Set();
- }
- InternalDependencyContainer.prototype.register = function (token, providerOrConstructor, options) {
- if (options === void 0) { options = { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Transient }; }
- this.ensureNotDisposed();
- var provider;
- if (!(0,_providers_provider__WEBPACK_IMPORTED_MODULE_1__.isProvider)(providerOrConstructor)) {
- provider = { useClass: providerOrConstructor };
- }
- else {
- provider = providerOrConstructor;
- }
- if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isTokenProvider)(provider)) {
- var path = [token];
- var tokenProvider = provider;
- while (tokenProvider != null) {
- var currentToken = tokenProvider.useToken;
- if (path.includes(currentToken)) {
- throw new Error("Token registration cycle detected! " + (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)(path, [currentToken]).join(" -> "));
- }
- path.push(currentToken);
- var registration = this._registry.get(currentToken);
- if (registration && (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isTokenProvider)(registration.provider)) {
- tokenProvider = registration.provider;
- }
- else {
- tokenProvider = null;
- }
- }
- }
- if (options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton ||
- options.lifecycle == _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped ||
- options.lifecycle == _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ResolutionScoped) {
- if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isValueProvider)(provider) || (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isFactoryProvider)(provider)) {
- throw new Error("Cannot use lifecycle \"" + _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"][options.lifecycle] + "\" with ValueProviders or FactoryProviders");
- }
- }
- this._registry.set(token, { provider: provider, options: options });
- return this;
- };
- InternalDependencyContainer.prototype.registerType = function (from, to) {
- this.ensureNotDisposed();
- if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(to)) {
- return this.register(from, {
- useToken: to
- });
- }
- return this.register(from, {
- useClass: to
- });
- };
- InternalDependencyContainer.prototype.registerInstance = function (token, instance) {
- this.ensureNotDisposed();
- return this.register(token, {
- useValue: instance
- });
- };
- InternalDependencyContainer.prototype.registerSingleton = function (from, to) {
- this.ensureNotDisposed();
- if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(from)) {
- if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(to)) {
- return this.register(from, {
- useToken: to
- }, { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton });
- }
- else if (to) {
- return this.register(from, {
- useClass: to
- }, { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton });
- }
- throw new Error('Cannot register a type name as a singleton without a "to" token');
- }
- var useClass = from;
- if (to && !(0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(to)) {
- useClass = to;
- }
- return this.register(from, {
- useClass: useClass
- }, { lifecycle: _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton });
- };
- InternalDependencyContainer.prototype.resolve = function (token, context) {
- if (context === void 0) { context = new _resolution_context__WEBPACK_IMPORTED_MODULE_5__["default"](); }
- this.ensureNotDisposed();
- var registration = this.getRegistration(token);
- if (!registration && (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(token)) {
- throw new Error("Attempted to resolve unregistered dependency token: \"" + token.toString() + "\"");
- }
- this.executePreResolutionInterceptor(token, "Single");
- if (registration) {
- var result = this.resolveRegistration(registration, context);
- this.executePostResolutionInterceptor(token, result, "Single");
- return result;
- }
- if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isConstructorToken)(token)) {
- var result = this.construct(token, context);
- this.executePostResolutionInterceptor(token, result, "Single");
- return result;
- }
- throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.");
- };
- InternalDependencyContainer.prototype.executePreResolutionInterceptor = function (token, resolutionType) {
- var e_1, _a;
- if (this.interceptors.preResolution.has(token)) {
- var remainingInterceptors = [];
- try {
- for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this.interceptors.preResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) {
- var interceptor = _c.value;
- if (interceptor.options.frequency != "Once") {
- remainingInterceptors.push(interceptor);
- }
- interceptor.callback(token, resolutionType);
- }
- }
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
- finally {
- try {
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
- }
- finally { if (e_1) throw e_1.error; }
- }
- this.interceptors.preResolution.setAll(token, remainingInterceptors);
- }
- };
- InternalDependencyContainer.prototype.executePostResolutionInterceptor = function (token, result, resolutionType) {
- var e_2, _a;
- if (this.interceptors.postResolution.has(token)) {
- var remainingInterceptors = [];
- try {
- for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this.interceptors.postResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) {
- var interceptor = _c.value;
- if (interceptor.options.frequency != "Once") {
- remainingInterceptors.push(interceptor);
- }
- interceptor.callback(token, result, resolutionType);
- }
- }
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
- finally {
- try {
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
- }
- finally { if (e_2) throw e_2.error; }
- }
- this.interceptors.postResolution.setAll(token, remainingInterceptors);
- }
- };
- InternalDependencyContainer.prototype.resolveRegistration = function (registration, context) {
- this.ensureNotDisposed();
- if (registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ResolutionScoped &&
- context.scopedResolutions.has(registration)) {
- return context.scopedResolutions.get(registration);
- }
- var isSingleton = registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].Singleton;
- var isContainerScoped = registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped;
- var returnInstance = isSingleton || isContainerScoped;
- var resolved;
- if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isValueProvider)(registration.provider)) {
- resolved = registration.provider.useValue;
- }
- else if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isTokenProvider)(registration.provider)) {
- resolved = returnInstance
- ? registration.instance ||
- (registration.instance = this.resolve(registration.provider.useToken, context))
- : this.resolve(registration.provider.useToken, context);
- }
- else if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isClassProvider)(registration.provider)) {
- resolved = returnInstance
- ? registration.instance ||
- (registration.instance = this.construct(registration.provider.useClass, context))
- : this.construct(registration.provider.useClass, context);
- }
- else if ((0,_providers__WEBPACK_IMPORTED_MODULE_0__.isFactoryProvider)(registration.provider)) {
- resolved = registration.provider.useFactory(this);
- }
- else {
- resolved = this.construct(registration.provider, context);
- }
- if (registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ResolutionScoped) {
- context.scopedResolutions.set(registration, resolved);
- }
- return resolved;
- };
- InternalDependencyContainer.prototype.resolveAll = function (token, context) {
- var _this = this;
- if (context === void 0) { context = new _resolution_context__WEBPACK_IMPORTED_MODULE_5__["default"](); }
- this.ensureNotDisposed();
- var registrations = this.getAllRegistrations(token);
- if (!registrations && (0,_providers__WEBPACK_IMPORTED_MODULE_0__.isNormalToken)(token)) {
- throw new Error("Attempted to resolve unregistered dependency token: \"" + token.toString() + "\"");
- }
- this.executePreResolutionInterceptor(token, "All");
- if (registrations) {
- var result_1 = registrations.map(function (item) {
- return _this.resolveRegistration(item, context);
- });
- this.executePostResolutionInterceptor(token, result_1, "All");
- return result_1;
- }
- var result = [this.construct(token, context)];
- this.executePostResolutionInterceptor(token, result, "All");
- return result;
- };
- InternalDependencyContainer.prototype.isRegistered = function (token, recursive) {
- if (recursive === void 0) { recursive = false; }
- this.ensureNotDisposed();
- return (this._registry.has(token) ||
- (recursive &&
- (this.parent || false) &&
- this.parent.isRegistered(token, true)));
- };
- InternalDependencyContainer.prototype.reset = function () {
- this.ensureNotDisposed();
- this._registry.clear();
- this.interceptors.preResolution.clear();
- this.interceptors.postResolution.clear();
- };
- InternalDependencyContainer.prototype.clearInstances = function () {
- var e_3, _a;
- this.ensureNotDisposed();
- try {
- for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
- var _d = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__read)(_c.value, 2), token = _d[0], registrations = _d[1];
- this._registry.setAll(token, registrations
- .filter(function (registration) { return !(0,_providers__WEBPACK_IMPORTED_MODULE_0__.isValueProvider)(registration.provider); })
- .map(function (registration) {
- registration.instance = undefined;
- return registration;
- }));
- }
- }
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
- finally {
- try {
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
- }
- finally { if (e_3) throw e_3.error; }
- }
- };
- InternalDependencyContainer.prototype.createChildContainer = function () {
- var e_4, _a;
- this.ensureNotDisposed();
- var childContainer = new InternalDependencyContainer(this);
- try {
- for (var _b = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__values)(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {
- var _d = (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__read)(_c.value, 2), token = _d[0], registrations = _d[1];
- if (registrations.some(function (_a) {
- var options = _a.options;
- return options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped;
- })) {
- childContainer._registry.setAll(token, registrations.map(function (registration) {
- if (registration.options.lifecycle === _types_lifecycle__WEBPACK_IMPORTED_MODULE_4__["default"].ContainerScoped) {
- return {
- provider: registration.provider,
- options: registration.options
- };
- }
- return registration;
- }));
- }
- }
- }
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
- finally {
- try {
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
- }
- finally { if (e_4) throw e_4.error; }
- }
- return childContainer;
- };
- InternalDependencyContainer.prototype.beforeResolution = function (token, callback, options) {
- if (options === void 0) { options = { frequency: "Always" }; }
- this.interceptors.preResolution.set(token, {
- callback: callback,
- options: options
- });
- };
- InternalDependencyContainer.prototype.afterResolution = function (token, callback, options) {
- if (options === void 0) { options = { frequency: "Always" }; }
- this.interceptors.postResolution.set(token, {
- callback: callback,
- options: options
- });
- };
- InternalDependencyContainer.prototype.dispose = function () {
- return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__awaiter)(this, void 0, void 0, function () {
- var promises;
- return (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__generator)(this, function (_a) {
- switch (_a.label) {
- case 0:
- this.disposed = true;
- promises = [];
- this.disposables.forEach(function (disposable) {
- var maybePromise = disposable.dispose();
- if (maybePromise) {
- promises.push(maybePromise);
- }
- });
- return [4, Promise.all(promises)];
- case 1:
- _a.sent();
- return [2];
- }
- });
- });
- };
- InternalDependencyContainer.prototype.getRegistration = function (token) {
- if (this.isRegistered(token)) {
- return this._registry.get(token);
- }
- if (this.parent) {
- return this.parent.getRegistration(token);
- }
- return null;
- };
- InternalDependencyContainer.prototype.getAllRegistrations = function (token) {
- if (this.isRegistered(token)) {
- return this._registry.getAll(token);
- }
- if (this.parent) {
- return this.parent.getAllRegistrations(token);
- }
- return null;
- };
- InternalDependencyContainer.prototype.construct = function (ctor, context) {
- var _this = this;
- if (ctor instanceof _lazy_helpers__WEBPACK_IMPORTED_MODULE_7__.DelayedConstructor) {
- return ctor.createProxy(function (target) {
- return _this.resolve(target, context);
- });
- }
- var instance = (function () {
- var paramInfo = typeInfo.get(ctor);
- if (!paramInfo || paramInfo.length === 0) {
- if (ctor.length === 0) {
- return new ctor();
- }
- else {
- throw new Error("TypeInfo not known for \"" + ctor.name + "\"");
- }
- }
- var params = paramInfo.map(_this.resolveParams(context, ctor));
- return new (ctor.bind.apply(ctor, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([void 0], params)))();
- })();
- if ((0,_types_disposable__WEBPACK_IMPORTED_MODULE_8__.isDisposable)(instance)) {
- this.disposables.add(instance);
- }
- return instance;
- };
- InternalDependencyContainer.prototype.resolveParams = function (context, ctor) {
- var _this = this;
- return function (param, idx) {
- var _a, _b, _c;
- try {
- if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTokenDescriptor)(param)) {
- if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(param)) {
- return param.multiple
- ? (_a = _this.resolve(param.transform)).transform.apply(_a, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([_this.resolveAll(param.token)], param.transformArgs)) : (_b = _this.resolve(param.transform)).transform.apply(_b, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([_this.resolve(param.token, context)], param.transformArgs));
- }
- else {
- return param.multiple
- ? _this.resolveAll(param.token)
- : _this.resolve(param.token, context);
- }
- }
- else if ((0,_providers_injection_token__WEBPACK_IMPORTED_MODULE_2__.isTransformDescriptor)(param)) {
- return (_c = _this.resolve(param.transform, context)).transform.apply(_c, (0,tslib__WEBPACK_IMPORTED_MODULE_10__.__spread)([_this.resolve(param.token, context)], param.transformArgs));
- }
- return _this.resolve(param, context);
- }
- catch (e) {
- throw new Error((0,_error_helpers__WEBPACK_IMPORTED_MODULE_6__.formatErrorCtor)(ctor, idx, e));
- }
- };
- };
- InternalDependencyContainer.prototype.ensureNotDisposed = function () {
- if (this.disposed) {
- throw new Error("This container has been disposed, you cannot interact with a disposed container");
- }
- };
- return InternalDependencyContainer;
- }());
- var instance = new InternalDependencyContainer();
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (instance);
- /***/ }),
- /* 10 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isClassProvider": () => (/* reexport safe */ _class_provider__WEBPACK_IMPORTED_MODULE_0__.isClassProvider),
- /* harmony export */ "isFactoryProvider": () => (/* reexport safe */ _factory_provider__WEBPACK_IMPORTED_MODULE_1__.isFactoryProvider),
- /* harmony export */ "isNormalToken": () => (/* reexport safe */ _injection_token__WEBPACK_IMPORTED_MODULE_2__.isNormalToken),
- /* harmony export */ "isTokenProvider": () => (/* reexport safe */ _token_provider__WEBPACK_IMPORTED_MODULE_3__.isTokenProvider),
- /* harmony export */ "isValueProvider": () => (/* reexport safe */ _value_provider__WEBPACK_IMPORTED_MODULE_4__.isValueProvider)
- /* harmony export */ });
- /* harmony import */ var _class_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
- /* harmony import */ var _factory_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12);
- /* harmony import */ var _injection_token__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
- /* harmony import */ var _token_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16);
- /* harmony import */ var _value_provider__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17);
- /***/ }),
- /* 11 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isClassProvider": () => (/* binding */ isClassProvider)
- /* harmony export */ });
- function isClassProvider(provider) {
- return !!provider.useClass;
- }
- /***/ }),
- /* 12 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isFactoryProvider": () => (/* binding */ isFactoryProvider)
- /* harmony export */ });
- function isFactoryProvider(provider) {
- return !!provider.useFactory;
- }
- /***/ }),
- /* 13 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isConstructorToken": () => (/* binding */ isConstructorToken),
- /* harmony export */ "isNormalToken": () => (/* binding */ isNormalToken),
- /* harmony export */ "isTokenDescriptor": () => (/* binding */ isTokenDescriptor),
- /* harmony export */ "isTransformDescriptor": () => (/* binding */ isTransformDescriptor)
- /* harmony export */ });
- /* harmony import */ var _lazy_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14);
- function isNormalToken(token) {
- return typeof token === "string" || typeof token === "symbol";
- }
- function isTokenDescriptor(descriptor) {
- return (typeof descriptor === "object" &&
- "token" in descriptor &&
- "multiple" in descriptor);
- }
- function isTransformDescriptor(descriptor) {
- return (typeof descriptor === "object" &&
- "token" in descriptor &&
- "transform" in descriptor);
- }
- function isConstructorToken(token) {
- return typeof token === "function" || token instanceof _lazy_helpers__WEBPACK_IMPORTED_MODULE_0__.DelayedConstructor;
- }
- /***/ }),
- /* 14 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "DelayedConstructor": () => (/* binding */ DelayedConstructor),
- /* harmony export */ "delay": () => (/* binding */ delay)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
- var DelayedConstructor = (function () {
- function DelayedConstructor(wrap) {
- this.wrap = wrap;
- this.reflectMethods = [
- "get",
- "getPrototypeOf",
- "setPrototypeOf",
- "getOwnPropertyDescriptor",
- "defineProperty",
- "has",
- "set",
- "deleteProperty",
- "apply",
- "construct",
- "ownKeys"
- ];
- }
- DelayedConstructor.prototype.createProxy = function (createObject) {
- var _this = this;
- var target = {};
- var init = false;
- var value;
- var delayedObject = function () {
- if (!init) {
- value = createObject(_this.wrap());
- init = true;
- }
- return value;
- };
- return new Proxy(target, this.createHandler(delayedObject));
- };
- DelayedConstructor.prototype.createHandler = function (delayedObject) {
- var handler = {};
- var install = function (name) {
- handler[name] = function () {
- var args = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- args[_i] = arguments[_i];
- }
- args[0] = delayedObject();
- var method = Reflect[name];
- return method.apply(void 0, (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spread)(args));
- };
- };
- this.reflectMethods.forEach(install);
- return handler;
- };
- return DelayedConstructor;
- }());
- function delay(wrappedConstructor) {
- if (typeof wrappedConstructor === "undefined") {
- throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");
- }
- return new DelayedConstructor(wrappedConstructor);
- }
- /***/ }),
- /* 15 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "__assign": () => (/* binding */ __assign),
- /* harmony export */ "__asyncDelegator": () => (/* binding */ __asyncDelegator),
- /* harmony export */ "__asyncGenerator": () => (/* binding */ __asyncGenerator),
- /* harmony export */ "__asyncValues": () => (/* binding */ __asyncValues),
- /* harmony export */ "__await": () => (/* binding */ __await),
- /* harmony export */ "__awaiter": () => (/* binding */ __awaiter),
- /* harmony export */ "__classPrivateFieldGet": () => (/* binding */ __classPrivateFieldGet),
- /* harmony export */ "__classPrivateFieldSet": () => (/* binding */ __classPrivateFieldSet),
- /* harmony export */ "__createBinding": () => (/* binding */ __createBinding),
- /* harmony export */ "__decorate": () => (/* binding */ __decorate),
- /* harmony export */ "__exportStar": () => (/* binding */ __exportStar),
- /* harmony export */ "__extends": () => (/* binding */ __extends),
- /* harmony export */ "__generator": () => (/* binding */ __generator),
- /* harmony export */ "__importDefault": () => (/* binding */ __importDefault),
- /* harmony export */ "__importStar": () => (/* binding */ __importStar),
- /* harmony export */ "__makeTemplateObject": () => (/* binding */ __makeTemplateObject),
- /* harmony export */ "__metadata": () => (/* binding */ __metadata),
- /* harmony export */ "__param": () => (/* binding */ __param),
- /* harmony export */ "__read": () => (/* binding */ __read),
- /* harmony export */ "__rest": () => (/* binding */ __rest),
- /* harmony export */ "__spread": () => (/* binding */ __spread),
- /* harmony export */ "__spreadArrays": () => (/* binding */ __spreadArrays),
- /* harmony export */ "__values": () => (/* binding */ __values)
- /* harmony export */ });
- /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, Promise */
- var extendStatics = function(d, b) {
- extendStatics = Object.setPrototypeOf ||
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
- return extendStatics(d, b);
- };
- function __extends(d, b) {
- extendStatics(d, b);
- function __() { this.constructor = d; }
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
- }
- var __assign = function() {
- __assign = Object.assign || function __assign(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
- }
- return t;
- }
- return __assign.apply(this, arguments);
- }
- function __rest(s, e) {
- var t = {};
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
- t[p] = s[p];
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
- t[p[i]] = s[p[i]];
- }
- return t;
- }
- function __decorate(decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- }
- function __param(paramIndex, decorator) {
- return function (target, key) { decorator(target, key, paramIndex); }
- }
- function __metadata(metadataKey, metadataValue) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
- }
- function __awaiter(thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- }
- function __generator(thisArg, body) {
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
- function verb(n) { return function (v) { return step([n, v]); }; }
- function step(op) {
- if (f) throw new TypeError("Generator is already executing.");
- while (_) try {
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
- if (y = 0, t) op = [op[0] & 2, t.value];
- switch (op[0]) {
- case 0: case 1: t = op; break;
- case 4: _.label++; return { value: op[1], done: false };
- case 5: _.label++; y = op[1]; op = [0]; continue;
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
- default:
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
- if (t[2]) _.ops.pop();
- _.trys.pop(); continue;
- }
- op = body.call(thisArg, _);
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
- }
- }
- function __createBinding(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
- }
- function __exportStar(m, exports) {
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p];
- }
- function __values(o) {
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
- if (m) return m.call(o);
- if (o && typeof o.length === "number") return {
- next: function () {
- if (o && i >= o.length) o = void 0;
- return { value: o && o[i++], done: !o };
- }
- };
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
- }
- function __read(o, n) {
- var m = typeof Symbol === "function" && o[Symbol.iterator];
- if (!m) return o;
- var i = m.call(o), r, ar = [], e;
- try {
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
- }
- catch (error) { e = { error: error }; }
- finally {
- try {
- if (r && !r.done && (m = i["return"])) m.call(i);
- }
- finally { if (e) throw e.error; }
- }
- return ar;
- }
- function __spread() {
- for (var ar = [], i = 0; i < arguments.length; i++)
- ar = ar.concat(__read(arguments[i]));
- return ar;
- }
- function __spreadArrays() {
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
- r[k] = a[j];
- return r;
- };
- function __await(v) {
- return this instanceof __await ? (this.v = v, this) : new __await(v);
- }
- function __asyncGenerator(thisArg, _arguments, generator) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
- function fulfill(value) { resume("next", value); }
- function reject(value) { resume("throw", value); }
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
- }
- function __asyncDelegator(o) {
- var i, p;
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
- }
- function __asyncValues(o) {
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
- var m = o[Symbol.asyncIterator], i;
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
- }
- function __makeTemplateObject(cooked, raw) {
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
- return cooked;
- };
- function __importStar(mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
- result.default = mod;
- return result;
- }
- function __importDefault(mod) {
- return (mod && mod.__esModule) ? mod : { default: mod };
- }
- function __classPrivateFieldGet(receiver, privateMap) {
- if (!privateMap.has(receiver)) {
- throw new TypeError("attempted to get private field on non-instance");
- }
- return privateMap.get(receiver);
- }
- function __classPrivateFieldSet(receiver, privateMap, value) {
- if (!privateMap.has(receiver)) {
- throw new TypeError("attempted to set private field on non-instance");
- }
- privateMap.set(receiver, value);
- return value;
- }
- /***/ }),
- /* 16 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isTokenProvider": () => (/* binding */ isTokenProvider)
- /* harmony export */ });
- function isTokenProvider(provider) {
- return !!provider.useToken;
- }
- /***/ }),
- /* 17 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isValueProvider": () => (/* binding */ isValueProvider)
- /* harmony export */ });
- function isValueProvider(provider) {
- return provider.useValue != undefined;
- }
- /***/ }),
- /* 18 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isProvider": () => (/* binding */ isProvider)
- /* harmony export */ });
- /* harmony import */ var _class_provider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(11);
- /* harmony import */ var _value_provider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
- /* harmony import */ var _token_provider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16);
- /* harmony import */ var _factory_provider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12);
- function isProvider(provider) {
- return ((0,_class_provider__WEBPACK_IMPORTED_MODULE_0__.isClassProvider)(provider) ||
- (0,_value_provider__WEBPACK_IMPORTED_MODULE_1__.isValueProvider)(provider) ||
- (0,_token_provider__WEBPACK_IMPORTED_MODULE_2__.isTokenProvider)(provider) ||
- (0,_factory_provider__WEBPACK_IMPORTED_MODULE_3__.isFactoryProvider)(provider));
- }
- /***/ }),
- /* 19 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
- /* harmony import */ var _registry_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
- var Registry = (function (_super) {
- (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(Registry, _super);
- function Registry() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return Registry;
- }(_registry_base__WEBPACK_IMPORTED_MODULE_0__["default"]));
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Registry);
- /***/ }),
- /* 20 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var RegistryBase = (function () {
- function RegistryBase() {
- this._registryMap = new Map();
- }
- RegistryBase.prototype.entries = function () {
- return this._registryMap.entries();
- };
- RegistryBase.prototype.getAll = function (key) {
- this.ensure(key);
- return this._registryMap.get(key);
- };
- RegistryBase.prototype.get = function (key) {
- this.ensure(key);
- var value = this._registryMap.get(key);
- return value[value.length - 1] || null;
- };
- RegistryBase.prototype.set = function (key, value) {
- this.ensure(key);
- this._registryMap.get(key).push(value);
- };
- RegistryBase.prototype.setAll = function (key, value) {
- this._registryMap.set(key, value);
- };
- RegistryBase.prototype.has = function (key) {
- this.ensure(key);
- return this._registryMap.get(key).length > 0;
- };
- RegistryBase.prototype.clear = function () {
- this._registryMap.clear();
- };
- RegistryBase.prototype.ensure = function (key) {
- if (!this._registryMap.has(key)) {
- this._registryMap.set(key, []);
- }
- };
- return RegistryBase;
- }());
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RegistryBase);
- /***/ }),
- /* 21 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- var ResolutionContext = (function () {
- function ResolutionContext() {
- this.scopedResolutions = new Map();
- }
- return ResolutionContext;
- }());
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ResolutionContext);
- /***/ }),
- /* 22 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "formatErrorCtor": () => (/* binding */ formatErrorCtor)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15);
- function formatDependency(params, idx) {
- if (params === null) {
- return "at position #" + idx;
- }
- var argName = params.split(",")[idx].trim();
- return "\"" + argName + "\" at position #" + idx;
- }
- function composeErrorMessage(msg, e, indent) {
- if (indent === void 0) { indent = " "; }
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__spread)([msg], e.message.split("\n").map(function (l) { return indent + l; })).join("\n");
- }
- function formatErrorCtor(ctor, paramIdx, error) {
- var _a = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__read)(ctor.toString().match(/constructor\(([\w, ]+)\)/) || [], 2), _b = _a[1], params = _b === void 0 ? null : _b;
- var dep = formatDependency(params, paramIdx);
- return composeErrorMessage("Cannot inject the dependency " + dep + " of \"" + ctor.name + "\" constructor. Reason:", error);
- }
- /***/ }),
- /* 23 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "isDisposable": () => (/* binding */ isDisposable)
- /* harmony export */ });
- function isDisposable(value) {
- if (typeof value.dispose !== "function")
- return false;
- var disposeFun = value.dispose;
- if (disposeFun.length > 0) {
- return false;
- }
- return true;
- }
- /***/ }),
- /* 24 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "PostResolutionInterceptors": () => (/* binding */ PostResolutionInterceptors),
- /* harmony export */ "PreResolutionInterceptors": () => (/* binding */ PreResolutionInterceptors),
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
- /* harmony import */ var _registry_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20);
- var PreResolutionInterceptors = (function (_super) {
- (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(PreResolutionInterceptors, _super);
- function PreResolutionInterceptors() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return PreResolutionInterceptors;
- }(_registry_base__WEBPACK_IMPORTED_MODULE_0__["default"]));
- var PostResolutionInterceptors = (function (_super) {
- (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__extends)(PostResolutionInterceptors, _super);
- function PostResolutionInterceptors() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- return PostResolutionInterceptors;
- }(_registry_base__WEBPACK_IMPORTED_MODULE_0__["default"]));
- var Interceptors = (function () {
- function Interceptors() {
- this.preResolution = new PreResolutionInterceptors();
- this.postResolution = new PostResolutionInterceptors();
- }
- return Interceptors;
- }());
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Interceptors);
- /***/ }),
- /* 25 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
- function inject(token) {
- return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(token);
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (inject);
- /***/ }),
- /* 26 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
- /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
- function injectable() {
- return function (target) {
- _dependency_container__WEBPACK_IMPORTED_MODULE_1__.typeInfo.set(target, (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.getParamInfo)(target));
- };
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectable);
- /***/ }),
- /* 27 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(15);
- /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
- function registry(registrations) {
- if (registrations === void 0) { registrations = []; }
- return function (target) {
- registrations.forEach(function (_a) {
- var token = _a.token, options = _a.options, provider = (0,tslib__WEBPACK_IMPORTED_MODULE_1__.__rest)(_a, ["token", "options"]);
- return _dependency_container__WEBPACK_IMPORTED_MODULE_0__.instance.register(token, provider, options);
- });
- return target;
- };
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registry);
- /***/ }),
- /* 28 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
- /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
- function singleton() {
- return function (target) {
- (0,_injectable__WEBPACK_IMPORTED_MODULE_0__["default"])()(target);
- _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.registerSingleton(target);
- };
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (singleton);
- /***/ }),
- /* 29 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
- function injectAll(token) {
- var data = { token: token, multiple: true };
- return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(data);
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectAll);
- /***/ }),
- /* 30 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
- function injectAllWithTransform(token, transformer) {
- var args = [];
- for (var _i = 2; _i < arguments.length; _i++) {
- args[_i - 2] = arguments[_i];
- }
- var data = {
- token: token,
- multiple: true,
- transform: transformer,
- transformArgs: args
- };
- return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(data);
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectAllWithTransform);
- /***/ }),
- /* 31 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _reflection_helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
- function injectWithTransform(token, transformer) {
- var args = [];
- for (var _i = 2; _i < arguments.length; _i++) {
- args[_i - 2] = arguments[_i];
- }
- return (0,_reflection_helpers__WEBPACK_IMPORTED_MODULE_0__.defineInjectionTokenMetadata)(token, {
- transformToken: transformer,
- args: args
- });
- }
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (injectWithTransform);
- /***/ }),
- /* 32 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (/* binding */ scoped)
- /* harmony export */ });
- /* harmony import */ var _injectable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26);
- /* harmony import */ var _dependency_container__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
- function scoped(lifecycle, token) {
- return function (target) {
- (0,_injectable__WEBPACK_IMPORTED_MODULE_0__["default"])()(target);
- _dependency_container__WEBPACK_IMPORTED_MODULE_1__.instance.register(token || target, target, {
- lifecycle: lifecycle
- });
- };
- }
- /***/ }),
- /* 33 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "instanceCachingFactory": () => (/* reexport safe */ _instance_caching_factory__WEBPACK_IMPORTED_MODULE_0__["default"]),
- /* harmony export */ "instancePerContainerCachingFactory": () => (/* reexport safe */ _instance_per_container_caching_factory__WEBPACK_IMPORTED_MODULE_1__["default"]),
- /* harmony export */ "predicateAwareClassFactory": () => (/* reexport safe */ _predicate_aware_class_factory__WEBPACK_IMPORTED_MODULE_2__["default"])
- /* harmony export */ });
- /* harmony import */ var _instance_caching_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(34);
- /* harmony import */ var _instance_per_container_caching_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(35);
- /* harmony import */ var _predicate_aware_class_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(36);
- /***/ }),
- /* 34 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (/* binding */ instanceCachingFactory)
- /* harmony export */ });
- function instanceCachingFactory(factoryFunc) {
- var instance;
- return function (dependencyContainer) {
- if (instance == undefined) {
- instance = factoryFunc(dependencyContainer);
- }
- return instance;
- };
- }
- /***/ }),
- /* 35 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (/* binding */ instancePerContainerCachingFactory)
- /* harmony export */ });
- function instancePerContainerCachingFactory(factoryFunc) {
- var cache = new WeakMap();
- return function (dependencyContainer) {
- var instance = cache.get(dependencyContainer);
- if (instance == undefined) {
- instance = factoryFunc(dependencyContainer);
- cache.set(dependencyContainer, instance);
- }
- return instance;
- };
- }
- /***/ }),
- /* 36 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (/* binding */ predicateAwareClassFactory)
- /* harmony export */ });
- function predicateAwareClassFactory(predicate, trueConstructor, falseConstructor, useCaching) {
- if (useCaching === void 0) { useCaching = true; }
- var instance;
- var previousPredicate;
- return function (dependencyContainer) {
- var currentPredicate = predicate(dependencyContainer);
- if (!useCaching || previousPredicate !== currentPredicate) {
- if ((previousPredicate = currentPredicate)) {
- instance = dependencyContainer.resolve(trueConstructor);
- }
- else {
- instance = dependencyContainer.resolve(falseConstructor);
- }
- }
- return instance;
- };
- }
- /***/ }),
- /* 37 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __metadata = (this && this.__metadata) || function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.AppFacade = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const control_compose_service_1 = __webpack_require__(38);
- const modal_entries_1 = __webpack_require__(47);
- const custom_methods_service_1 = __webpack_require__(63);
- const element_find_service_1 = __webpack_require__(39);
- const render_service_1 = __webpack_require__(41);
- const styles_injecter_service_1 = __webpack_require__(67);
- let AppFacade = class AppFacade {
- constructor() {
- this.enabledFeatures = {};
- this.enableElementServices();
- this.enableRenderService();
- this.initCustomService();
- }
- enableStyles() {
- const instance = tsyringe_1.container.resolve(styles_injecter_service_1.StylesInjecterService);
- instance.injectInit();
- this.enabledFeatures.styles = true;
- }
- enableModal() {
- const instance = tsyringe_1.container.resolve(control_compose_service_1.ControlComposeService);
- instance.composeAndRender(modal_entries_1.modalControlEntry);
- this.enabledFeatures.styles = true;
- }
- enableElementServices() {
- const instance = tsyringe_1.container.resolve(element_find_service_1.ElementFindService);
- this.enabledFeatures.element = true;
- }
- enableRenderService() {
- const instance = tsyringe_1.container.resolve(render_service_1.RenderService);
- this.enabledFeatures.render = true;
- }
- initCustomService() {
- const instance = tsyringe_1.container.resolve(custom_methods_service_1.CustomMethodsService);
- }
- };
- AppFacade = __decorate([
- (0, tsyringe_1.singleton)(),
- __metadata("design:paramtypes", [])
- ], AppFacade);
- exports.AppFacade = AppFacade;
- /***/ }),
- /* 38 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.ControlComposeService = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const element_find_service_1 = __webpack_require__(39);
- const render_service_1 = __webpack_require__(41);
- let ControlComposeService = class ControlComposeService {
- composeAndRender(controlModel, renderAt) {
- const control = this.compose(controlModel);
- return this.render(control, renderAt !== null && renderAt !== void 0 ? renderAt : controlModel.defaultRenderAt, controlModel.guards);
- }
- compose(controlModel) {
- const control = new controlModel.class(controlModel.controlParams, controlModel.callback, controlModel.args);
- return control;
- }
- render(control, renderAt, guards) {
- var _a;
- const renderService = tsyringe_1.container.resolve(render_service_1.RenderService);
- const elementFindService = tsyringe_1.container.resolve(element_find_service_1.ElementFindService);
- const renderPayload = {
- element: (_a = control.element) !== null && _a !== void 0 ? _a : control.component,
- place: getRenderElement(renderAt.place),
- guards
- };
- if (renderAt.insertBefore) {
- renderPayload.renderBefore = getRenderElement(renderAt.insertBefore);
- }
- return renderService.render(renderPayload);
- function getRenderElement(place) {
- return typeof place === "string"
- ? elementFindService.getElementByQuerySingle(place)
- : elementFindService.getElementByElementCollectionSingle(place.id);
- }
- }
- };
- ControlComposeService = __decorate([
- (0, tsyringe_1.singleton)()
- ], ControlComposeService);
- exports.ControlComposeService = ControlComposeService;
- /***/ }),
- /* 39 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __metadata = (this && this.__metadata) || function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.GetElementCollection = exports.ElementFindService = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const element_collection_1 = __webpack_require__(40);
- let ElementFindService = class ElementFindService {
- constructor() {
- this.contextElement = document;
- }
- getElementByQuerySingle(query) {
- return this._queryGet(query);
- }
- getElementByQueryMultiple(query) {
- return this._queryGetMultiple(query);
- }
- getElementByElementCollectionSingle(query) {
- return this._getByElementCollection(GetElementCollection.get(query));
- }
- getElementByElementCollectionMultiple(query) {
- return this._getElementMultiple(GetElementCollection.get(query));
- }
- _queryGetMultiple(query) {
- return Array.from(this.contextElement.querySelectorAll(query));
- }
- _queryGet(query) {
- return this.contextElement.querySelector(query);
- }
- _getByElementCollection(query) {
- var _a, _b, _c;
- if (query.id !== element_collection_1.ElementCollection.Root) {
- const elem = (_c = (_b = (_a = this.contextElement
- .querySelector(".viewport__content-section .modal-body .panel-group")) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.parentNode) === null || _c === void 0 ? void 0 : _c.querySelector(".control-label");
- if (elem) {
- return elem;
- }
- }
- return this.contextElement.querySelector(query.selector);
- }
- _getElementMultiple(query) {
- return Array.from(this.contextElement.querySelectorAll(query.selector));
- }
- };
- ElementFindService = __decorate([
- (0, tsyringe_1.singleton)(),
- __metadata("design:paramtypes", [])
- ], ElementFindService);
- exports.ElementFindService = ElementFindService;
- class GetElementCollection {
- static get(id) {
- return element_collection_1.elementCollectionList.find((element) => element.id === id);
- }
- }
- exports.GetElementCollection = GetElementCollection;
- /***/ }),
- /* 40 */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.elementCollectionList = exports.ElementCollection = void 0;
- var ElementCollection;
- (function (ElementCollection) {
- ElementCollection[ElementCollection["Root"] = 0] = "Root";
- })(ElementCollection = exports.ElementCollection || (exports.ElementCollection = {}));
- exports.elementCollectionList = [
- {
- id: ElementCollection.Root,
- selector: "body",
- preferredMode: "selectSingle"
- }
- ];
- /***/ }),
- /* 41 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.RenderService = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const element_existence_guard_1 = __webpack_require__(42);
- const route_guard_1 = __webpack_require__(45);
- const logger_1 = __webpack_require__(43);
- const render_model_1 = __webpack_require__(46);
- let RenderService = class RenderService {
- render(params) {
- var _a, _b;
- if (params.place && params.element) {
- if (params.guards === undefined || this.checkByGuards(params) === true) {
- if (params.renderBefore) {
- params.place.insertBefore(params.element, params.renderBefore);
- }
- else {
- params.place.appendChild(params.element);
- }
- logger_1.Logger.log(`ℹ️ Rendered "${((_a = params.element) === null || _a === void 0 ? void 0 : _a.innerText) || `an element with tag "${(_b = params.element) === null || _b === void 0 ? void 0 : _b.tagName}"`}"`);
- return params.element;
- }
- else {
- logger_1.Logger.log("🔴 Nothing was rendered. The most likely reason: guards", "warn");
- return render_model_1.RenderResult.FAIL;
- }
- }
- else {
- logger_1.Logger.log("🔴 Nothing was rendered. The most likely reason: no element to render in", "warn");
- return render_model_1.RenderResult.NOELEMENT;
- }
- }
- remove(elem) {
- var _a;
- if (elem) {
- (_a = elem.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(elem);
- return render_model_1.DeleteResult.SUCCESS;
- }
- else {
- return render_model_1.DeleteResult.NOELEMENT;
- }
- }
- checkByGuards(params) {
- function performCascadeCheck(checks) {
- return checks.every((check) => check());
- }
- const checks = [
- () => {
- var _a, _b, _c, _d, _e;
- return ((_a = params.guards) === null || _a === void 0 ? void 0 : _a.routes) !== undefined && Array.isArray((_b = params.guards) === null || _b === void 0 ? void 0 : _b.routes)
- ? ((_c = params.guards) === null || _c === void 0 ? void 0 : _c.routes).length === 0
- ? true
- : ((_e = (_d = params.guards) === null || _d === void 0 ? void 0 : _d.routes.filter((route) => (0, route_guard_1.routeGuardIncludesFunction)(route) === true)) === null || _e === void 0 ? void 0 : _e.length) > 0
- : true;
- },
- () => { var _a, _b, _c; return (_c = (_b = (_a = params.guards) === null || _a === void 0 ? void 0 : _a.elementShouldExist) === null || _b === void 0 ? void 0 : _b.every((elem) => (0, element_existence_guard_1.elementShouldExistGuardFunction)(elem.selector) === true)) !== null && _c !== void 0 ? _c : true; },
- () => { var _a, _b, _c; return (_c = (_b = (_a = params.guards) === null || _a === void 0 ? void 0 : _a.elementShouldNotExist) === null || _b === void 0 ? void 0 : _b.every((elem) => (0, element_existence_guard_1.elementShouldNotExistGuardFunction)(elem.selector) === true)) !== null && _c !== void 0 ? _c : true; },
- () => {
- var _a, _b;
- return ((_a = params.guards) === null || _a === void 0 ? void 0 : _a.unique) === true
- ? (0, element_existence_guard_1.elementShouldNotExistGuardFunction)(((_b = params.element) === null || _b === void 0 ? void 0 : _b.id) ? `#${params.element.id}` : ``) === true
- : true;
- }
- ];
- let result = false;
- if (performCascadeCheck(checks)) {
- result = true;
- }
- return result;
- }
- };
- RenderService = __decorate([
- (0, tsyringe_1.singleton)()
- ], RenderService);
- exports.RenderService = RenderService;
- /***/ }),
- /* 42 */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.elementShouldExistGuardFunction = exports.elementShouldNotExistGuardFunction = exports.elementShouldExistGuard = exports.elementShouldNotExistGuard = void 0;
- const logger_1 = __webpack_require__(43);
- const elementShouldNotExistGuard = (selector) => (target, propertyKey, descriptor) => {
- const originalMethod = descriptor.value;
- descriptor.value = function (...args) {
- if (selector) {
- const url = new URL(location.href);
- if (document.querySelector(selector) === null) {
- logger_1.Logger.log(`🟢 Checking element with selector "${selector}" should not have been existing... Element not existed... Function shall proceed to execute`);
- originalMethod.apply(this, args);
- }
- else {
- logger_1.Logger.log(`🟠 Checking element with selector "${selector}" should not have been existing... Element existed... Function shall not execute`);
- return;
- }
- }
- return;
- };
- return descriptor;
- };
- exports.elementShouldNotExistGuard = elementShouldNotExistGuard;
- const elementShouldExistGuard = (selector) => (target, propertyKey, descriptor) => {
- const originalMethod = descriptor.value;
- descriptor.value = function (...args) {
- if (selector) {
- if (document.querySelector(selector) !== null) {
- logger_1.Logger.log(`🟢 Checking element with selector "${selector}" should have been existing... Element exists... Function shall proceed to execute`);
- originalMethod.apply(this, args);
- }
- else {
- logger_1.Logger.log(`🟠 Checking element with selector "${selector}" should have been existing... Element does not exist... Function shall not execute`);
- return;
- }
- }
- return;
- };
- return descriptor;
- };
- exports.elementShouldExistGuard = elementShouldExistGuard;
- const elementShouldNotExistGuardFunction = (selector) => {
- let result = false;
- if (selector) {
- if (document.querySelector(selector) === null) {
- result = true;
- logger_1.Logger.log(`🟢 Checking element with selector "${selector}" should not have been existing... Element not existed... Function shall proceed to execute`);
- }
- else {
- logger_1.Logger.log(`🟠 Checking element with selector "${selector}" should not have been existing... Element existed... Function shall not execute`);
- }
- }
- return result;
- };
- exports.elementShouldNotExistGuardFunction = elementShouldNotExistGuardFunction;
- const elementShouldExistGuardFunction = (selector) => {
- let result = false;
- if (selector) {
- if (document.querySelector(selector) !== null) {
- result = true;
- logger_1.Logger.log(`🟢 Checking element with selector "${selector}" should have been existing... Element exists... Function shall proceed to execute`);
- }
- else {
- logger_1.Logger.log(`🟠 Checking element with selector "${selector}" should have been existing... Element does not exist... Function shall not execute`);
- }
- }
- return result;
- };
- exports.elementShouldExistGuardFunction = elementShouldExistGuardFunction;
- /***/ }),
- /* 43 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __metadata = (this && this.__metadata) || function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.Logger = void 0;
- const only_env_guard_1 = __webpack_require__(44);
- class Logger {
- static error(message) {
- console.error(message);
- }
- static logProd(message, level = "log") {
- Logger.log(message, level);
- }
- static log(message, level = "log") {
- switch (level) {
- case "log":
- console.log(message);
- break;
- case "info":
- console.info(message);
- break;
- case "warn":
- console.warn(message);
- break;
- default:
- console.log(message);
- break;
- }
- }
- }
- __decorate([
- (0, only_env_guard_1.EnvGuard)(["development", "production"]),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object, String]),
- __metadata("design:returntype", void 0)
- ], Logger, "logProd", null);
- __decorate([
- (0, only_env_guard_1.EnvGuard)(["development"]),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [Object, String]),
- __metadata("design:returntype", void 0)
- ], Logger, "log", null);
- exports.Logger = Logger;
- /***/ }),
- /* 44 */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.EnvGuardFunction = exports.EnvGuard = void 0;
- const EnvGuard = (envs) => (target, propertyKey, descriptor) => {
- const originalMethod = descriptor.value;
- descriptor.value = function (...args) {
- const url = new URL(location.href);
- if (envs.includes({"ENV":"production"}.ENV)) {
- originalMethod.apply(this, args);
- }
- else {
- return;
- }
- };
- return descriptor;
- };
- exports.EnvGuard = EnvGuard;
- const EnvGuardFunction = (envs) => {
- let result = false;
- const url = new URL(location.href);
- if (envs.includes({"ENV":"production"}.ENV)) {
- result = true;
- }
- return result;
- };
- exports.EnvGuardFunction = EnvGuardFunction;
- /***/ }),
- /* 45 */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.routeGuardIncludesFunction = exports.routeGuardExactFunction = exports.routeGuardIncludes = exports.routeGuardExact = void 0;
- const logger_1 = __webpack_require__(43);
- const routeGuardExact = (route) => (target, propertyKey, descriptor) => {
- const originalMethod = descriptor.value;
- descriptor.value = function (...args) {
- const url = new URL(location.href);
- if (url.pathname + url.hash === route || url.href === route) {
- originalMethod.apply(this, args);
- }
- else {
- return;
- }
- };
- return descriptor;
- };
- exports.routeGuardExact = routeGuardExact;
- const routeGuardIncludes = (route) => (target, propertyKey, descriptor) => {
- const originalMethod = descriptor.value;
- descriptor.value = function (...args) {
- const url = new URL(location.href);
- if (url.toString().includes(route)) {
- originalMethod.apply(this, args);
- }
- else {
- return;
- }
- };
- return descriptor;
- };
- exports.routeGuardIncludes = routeGuardIncludes;
- const routeGuardExactFunction = (route) => {
- let result = false;
- const url = new URL(location.href);
- if (url.pathname + url.hash === route || url.href === route) {
- result = true;
- }
- return result;
- };
- exports.routeGuardExactFunction = routeGuardExactFunction;
- const routeGuardIncludesFunction = (route) => {
- let result = false;
- const url = new URL(location.href);
- if (url.toString().includes(route)) {
- logger_1.Logger.log(`🟢 Provided routes match with current path ${url.toString()}`);
- result = true;
- }
- else {
- logger_1.Logger.log(`🟠 Provided routes do not match with current path ${url.toString()}`, "warn");
- }
- return result;
- };
- exports.routeGuardIncludesFunction = routeGuardIncludesFunction;
- /***/ }),
- /* 46 */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.DeleteResult = exports.RenderResult = void 0;
- var RenderResult;
- (function (RenderResult) {
- RenderResult[RenderResult["SUCCESS"] = 0] = "SUCCESS";
- RenderResult[RenderResult["FAIL"] = 1] = "FAIL";
- RenderResult[RenderResult["NOELEMENT"] = 2] = "NOELEMENT";
- })(RenderResult = exports.RenderResult || (exports.RenderResult = {}));
- var DeleteResult;
- (function (DeleteResult) {
- DeleteResult[DeleteResult["SUCCESS"] = 0] = "SUCCESS";
- DeleteResult[DeleteResult["FAIL"] = 1] = "FAIL";
- DeleteResult[DeleteResult["NOELEMENT"] = 2] = "NOELEMENT";
- })(DeleteResult = exports.DeleteResult || (exports.DeleteResult = {}));
- /***/ }),
- /* 47 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.modalControlEntry = void 0;
- const modal_control_1 = __webpack_require__(48);
- const modal_control_html_1 = __importDefault(__webpack_require__(52));
- const modal_control_scss_1 = __importDefault(__webpack_require__(53));
- exports.modalControlEntry = {
- class: modal_control_1.ModalControl,
- controlParams: {
- tag: "div",
- id: "modal",
- html: modal_control_html_1.default,
- scss: modal_control_scss_1.default,
- },
- callback: () => { },
- args: {},
- guards: {
- routes: [],
- elementShouldExist: [],
- unique: true
- },
- defaultRenderAt: {
- place: "body"
- }
- };
- /***/ }),
- /* 48 */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.ModalControl = void 0;
- const modal_base_control_1 = __webpack_require__(49);
- class ModalControl extends modal_base_control_1.ModalBaseControl {
- constructor() {
- super(...arguments);
- this.modalWrapper = document.querySelector("#inoreader-viewing-api-for-userscripts-modal");
- }
- switchModalstate() {
- const modalContainer = this.modalWrapper.querySelector(".modal-container");
- modalContainer === null || modalContainer === void 0 ? void 0 : modalContainer.classList.toggle("modal-open");
- }
- onSetHtml() {
- const button = this.modalWrapper.querySelector(".extension-settings-shortcut-button");
- if (button) {
- button.addEventListener("click", () => this.switchModalstate());
- }
- }
- }
- exports.ModalControl = ModalControl;
- /***/ }),
- /* 49 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- var desc = Object.getOwnPropertyDescriptor(m, k);
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
- desc = { enumerable: true, get: function() { return m[k]; } };
- }
- Object.defineProperty(o, k2, desc);
- }) : (function(o, m, k, k2) {
- if (k2 === undefined) k2 = k;
- o[k2] = m[k];
- }));
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
- Object.defineProperty(o, "default", { enumerable: true, value: v });
- }) : function(o, v) {
- o["default"] = v;
- });
- var __importStar = (this && this.__importStar) || function (mod) {
- if (mod && mod.__esModule) return mod;
- var result = {};
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
- __setModuleDefault(result, mod);
- return result;
- };
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.ModalBaseControl = void 0;
- const logger_1 = __webpack_require__(43);
- const control_base_control_1 = __webpack_require__(50);
- class ModalBaseControl extends control_base_control_1.ControlBase {
- constructor(params, callback, args) {
- super(params);
- this.params = params;
- if (params.html) {
- }
- if (params.styles) {
- }
- this.addEventListener(this.element, callback, args);
- }
- addEventListener(modal, callback, args) {
- modal.addEventListener("click", callback.bind(this, args), false);
- }
- setHtml(html) {
- try {
- this.element.innerHTML = html;
- this.onSetHtml();
- }
- catch (error) {
- logger_1.Logger.error(error);
- }
- }
- onSetHtml() { }
- getHtml() {
- return __awaiter(this, void 0, void 0, function* () {
- var _a;
- logger_1.Logger.log("# Getting node:" + this.params.html);
- try {
- return (yield (_a = `${this.params.html}`, Promise.resolve().then(() => __importStar(__webpack_require__(51)(_a))))).default;
- }
- catch (error) {
- console.log("[error] fail to build DOM node with error", error);
- }
- return Promise.reject("[error] fail to build DOM node with error. Error: No template found");
- });
- }
- }
- exports.ModalBaseControl = ModalBaseControl;
- /***/ }),
- /* 50 */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.ControlBase = void 0;
- class ControlBase {
- constructor(params) {
- var _a;
- const paramsDefault = params;
- this.element = this.createElement((_a = paramsDefault.tag) !== null && _a !== void 0 ? _a : "button");
- if (paramsDefault.classes) {
- this.setClasses(paramsDefault.classes);
- }
- if (paramsDefault.text && !paramsDefault.html) {
- this.setInnerText(paramsDefault.text);
- }
- if (paramsDefault.html && !paramsDefault.text) {
- this.setInnerHtml(paramsDefault.html);
- }
- if (paramsDefault.attributes) {
- this.setAttributes(paramsDefault.attributes);
- }
- if (paramsDefault.styles) {
- this.setStyles(paramsDefault.styles);
- }
- if (paramsDefault.id) {
- this.setId(paramsDefault.id);
- }
- }
- createElement(element) {
- return document.createElement(element);
- }
- setInnerText(text = "Ошибка: текст не был назначен") {
- this.element.innerText = text;
- }
- setInnerHtml(html = "Ошибка: HTML-разметка не была назначена") {
- this.element.innerHTML = html;
- }
- setId(id) {
- if (id) {
- this.element.id = id;
- }
- }
- setClasses(classes) {
- classes.forEach((element) => {
- this.element.classList.add(element);
- });
- }
- setAttributes(attributes) {
- Object.entries(attributes).forEach(([key, value]) => {
- this.element.setAttribute(key, value);
- });
- }
- setStyles(styles) {
- styles === null || styles === void 0 ? void 0 : styles.forEach((style) => {
- if (style.selector) {
- this.element.querySelector(style.selector).style.setProperty(style.key, style.value);
- }
- else {
- this.element.style.setProperty(style.key, style.value);
- }
- });
- }
- }
- exports.ControlBase = ControlBase;
- /***/ }),
- /* 51 */
- /***/ ((module) => {
- function webpackEmptyContext(req) {
- var e = new Error("Cannot find module '" + req + "'");
- e.code = 'MODULE_NOT_FOUND';
- throw e;
- }
- webpackEmptyContext.keys = () => ([]);
- webpackEmptyContext.resolve = webpackEmptyContext;
- webpackEmptyContext.id = 51;
- module.exports = webpackEmptyContext;
- /***/ }),
- /* 52 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- // Module
- var code = "<div class=\"modal-wrapper\" id=\"inoreader-viewing-api-for-userscripts-modal\">\n <div class=\"modal-container\">\n <div class=\"modal-close-background\"></div>\n <div class=\"modal-content\">\n <div class=\"modal-header\">\n <div class=\"container-header\"></div>\n </div>\n <div class=\"modal-body\">\n <div class=\"container-body\">ПИДОРАС</div>\n </div>\n <div class=\"modal-footer\">\n <div class=\"container-footer\"></div>\n </div>\n </div>\n </div>\n <div class=\"extension-settings-shortcut-container\">\n <button class=\"extension-settings-shortcut-button\">Настройки расширения</button>\n </div>\n</div>";
- // Exports
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);
- /***/ }),
- /* 53 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_modal_control_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(60);
- var options = {};
- options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
- options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
- options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
- options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
- options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
- var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_modal_control_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_modal_control_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_modal_control_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_modal_control_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
- /***/ }),
- /* 54 */
- /***/ ((module) => {
- "use strict";
- var stylesInDOM = [];
- function getIndexByIdentifier(identifier) {
- var result = -1;
- for (var i = 0; i < stylesInDOM.length; i++) {
- if (stylesInDOM[i].identifier === identifier) {
- result = i;
- break;
- }
- }
- return result;
- }
- function modulesToDom(list, options) {
- var idCountMap = {};
- var identifiers = [];
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- var id = options.base ? item[0] + options.base : item[0];
- var count = idCountMap[id] || 0;
- var identifier = "".concat(id, " ").concat(count);
- idCountMap[id] = count + 1;
- var indexByIdentifier = getIndexByIdentifier(identifier);
- var obj = {
- css: item[1],
- media: item[2],
- sourceMap: item[3],
- supports: item[4],
- layer: item[5]
- };
- if (indexByIdentifier !== -1) {
- stylesInDOM[indexByIdentifier].references++;
- stylesInDOM[indexByIdentifier].updater(obj);
- } else {
- var updater = addElementStyle(obj, options);
- options.byIndex = i;
- stylesInDOM.splice(i, 0, {
- identifier: identifier,
- updater: updater,
- references: 1
- });
- }
- identifiers.push(identifier);
- }
- return identifiers;
- }
- function addElementStyle(obj, options) {
- var api = options.domAPI(options);
- api.update(obj);
- var updater = function updater(newObj) {
- if (newObj) {
- if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
- return;
- }
- api.update(obj = newObj);
- } else {
- api.remove();
- }
- };
- return updater;
- }
- module.exports = function (list, options) {
- options = options || {};
- list = list || [];
- var lastIdentifiers = modulesToDom(list, options);
- return function update(newList) {
- newList = newList || [];
- for (var i = 0; i < lastIdentifiers.length; i++) {
- var identifier = lastIdentifiers[i];
- var index = getIndexByIdentifier(identifier);
- stylesInDOM[index].references--;
- }
- var newLastIdentifiers = modulesToDom(newList, options);
- for (var _i = 0; _i < lastIdentifiers.length; _i++) {
- var _identifier = lastIdentifiers[_i];
- var _index = getIndexByIdentifier(_identifier);
- if (stylesInDOM[_index].references === 0) {
- stylesInDOM[_index].updater();
- stylesInDOM.splice(_index, 1);
- }
- }
- lastIdentifiers = newLastIdentifiers;
- };
- };
- /***/ }),
- /* 55 */
- /***/ ((module) => {
- "use strict";
- /* istanbul ignore next */
- function apply(styleElement, options, obj) {
- var css = "";
- if (obj.supports) {
- css += "@supports (".concat(obj.supports, ") {");
- }
- if (obj.media) {
- css += "@media ".concat(obj.media, " {");
- }
- var needLayer = typeof obj.layer !== "undefined";
- if (needLayer) {
- css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
- }
- css += obj.css;
- if (needLayer) {
- css += "}";
- }
- if (obj.media) {
- css += "}";
- }
- if (obj.supports) {
- css += "}";
- }
- var sourceMap = obj.sourceMap;
- if (sourceMap && typeof btoa !== "undefined") {
- css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
- } // For old IE
- /* istanbul ignore if */
- options.styleTagTransform(css, styleElement, options.options);
- }
- function removeStyleElement(styleElement) {
- // istanbul ignore if
- if (styleElement.parentNode === null) {
- return false;
- }
- styleElement.parentNode.removeChild(styleElement);
- }
- /* istanbul ignore next */
- function domAPI(options) {
- var styleElement = options.insertStyleElement(options);
- return {
- update: function update(obj) {
- apply(styleElement, options, obj);
- },
- remove: function remove() {
- removeStyleElement(styleElement);
- }
- };
- }
- module.exports = domAPI;
- /***/ }),
- /* 56 */
- /***/ ((module) => {
- "use strict";
- var memo = {};
- /* istanbul ignore next */
- function getTarget(target) {
- if (typeof memo[target] === "undefined") {
- var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
- try {
- // This will throw an exception if access to iframe is blocked
- // due to cross-origin restrictions
- styleTarget = styleTarget.contentDocument.head;
- } catch (e) {
- // istanbul ignore next
- styleTarget = null;
- }
- }
- memo[target] = styleTarget;
- }
- return memo[target];
- }
- /* istanbul ignore next */
- function insertBySelector(insert, style) {
- var target = getTarget(insert);
- if (!target) {
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
- }
- target.appendChild(style);
- }
- module.exports = insertBySelector;
- /***/ }),
- /* 57 */
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
- "use strict";
- /* istanbul ignore next */
- function setAttributesWithoutAttributes(styleElement) {
- var nonce = true ? __webpack_require__.nc : 0;
- if (nonce) {
- styleElement.setAttribute("nonce", nonce);
- }
- }
- module.exports = setAttributesWithoutAttributes;
- /***/ }),
- /* 58 */
- /***/ ((module) => {
- "use strict";
- /* istanbul ignore next */
- function insertStyleElement(options) {
- var element = document.createElement("style");
- options.setAttributes(element, options.attributes);
- options.insert(element, options.options);
- return element;
- }
- module.exports = insertStyleElement;
- /***/ }),
- /* 59 */
- /***/ ((module) => {
- "use strict";
- /* istanbul ignore next */
- function styleTagTransform(css, styleElement) {
- if (styleElement.styleSheet) {
- styleElement.styleSheet.cssText = css;
- } else {
- while (styleElement.firstChild) {
- styleElement.removeChild(styleElement.firstChild);
- }
- styleElement.appendChild(document.createTextNode(css));
- }
- }
- module.exports = styleTagTransform;
- /***/ }),
- /* 60 */
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61);
- /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62);
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
- // Imports
- var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
- // Module
- ___CSS_LOADER_EXPORT___.push([module.id, "#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container {\n position: fixed;\n opacity: 0;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n transition: all 0.25s;\n z-index: -1000;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container .modal-close-background {\n position: absolute;\n background-color: black;\n width: 100%;\n height: 100%;\n opacity: 0.4;\n cursor: pointer;\n display: none;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container .modal-content {\n position: absolute;\n background-color: gray;\n min-width: 400px;\n min-height: 225px;\n max-width: 500px;\n max-height: 280px;\n width: 40%;\n height: 40%;\n opacity: 1;\n flex-direction: column;\n align-items: center;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n transition: all 0.25s;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container .modal-content .modal-body {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n flex: 1;\n width: 100%;\n overflow: auto;\n font-family: consolas;\n background-color: #edeef0;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container.modal-open {\n opacity: 1;\n visibility: visible;\n z-index: 9999999;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container.modal-open .modal-close-background {\n display: block;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .modal-container.modal-open .modal-close-background .modal-content {\n bottom: 0;\n transition: all 0.25s;\n display: flex;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .extension-settings-shortcut-button {\n position: fixed;\n bottom: 20px;\n right: 20px;\n background-color: #4caf50;\n color: white;\n border: none;\n padding: 10px 20px;\n font-size: 16px;\n border-radius: 5px;\n box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);\n transition: all 0.3s ease;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .extension-settings-shortcut-button:hover {\n background-color: #3e8e41;\n box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);\n transform: scale(1.1);\n cursor: pointer;\n}\n#inoreader-viewing-api-for-userscripts-modal.modal-wrapper .extension-settings-shortcut-button:active {\n transform: scale(0.9);\n}", ""]);
- // Exports
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
- /***/ }),
- /* 61 */
- /***/ ((module) => {
- "use strict";
- module.exports = function (i) {
- return i[1];
- };
- /***/ }),
- /* 62 */
- /***/ ((module) => {
- "use strict";
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
- module.exports = function (cssWithMappingToString) {
- var list = [];
- // return the list of modules as css string
- list.toString = function toString() {
- return this.map(function (item) {
- var content = "";
- var needLayer = typeof item[5] !== "undefined";
- if (item[4]) {
- content += "@supports (".concat(item[4], ") {");
- }
- if (item[2]) {
- content += "@media ".concat(item[2], " {");
- }
- if (needLayer) {
- content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
- }
- content += cssWithMappingToString(item);
- if (needLayer) {
- content += "}";
- }
- if (item[2]) {
- content += "}";
- }
- if (item[4]) {
- content += "}";
- }
- return content;
- }).join("");
- };
- // import a list of modules into the list
- list.i = function i(modules, media, dedupe, supports, layer) {
- if (typeof modules === "string") {
- modules = [[null, modules, undefined]];
- }
- var alreadyImportedModules = {};
- if (dedupe) {
- for (var k = 0; k < this.length; k++) {
- var id = this[k][0];
- if (id != null) {
- alreadyImportedModules[id] = true;
- }
- }
- }
- for (var _k = 0; _k < modules.length; _k++) {
- var item = [].concat(modules[_k]);
- if (dedupe && alreadyImportedModules[item[0]]) {
- continue;
- }
- if (typeof layer !== "undefined") {
- if (typeof item[5] === "undefined") {
- item[5] = layer;
- } else {
- item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
- item[5] = layer;
- }
- }
- if (media) {
- if (!item[2]) {
- item[2] = media;
- } else {
- item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
- item[2] = media;
- }
- }
- if (supports) {
- if (!item[4]) {
- item[4] = "".concat(supports);
- } else {
- item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
- item[4] = supports;
- }
- }
- list.push(item);
- }
- };
- return list;
- };
- /***/ }),
- /* 63 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __metadata = (this && this.__metadata) || function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.CustomMethodsService = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const custom_event_model_1 = __webpack_require__(64);
- const events_model_1 = __webpack_require__(65);
- const watcher_service_1 = __webpack_require__(66);
- let CustomMethodsService = class CustomMethodsService {
- constructor() {
- this.init();
- }
- init() {
- const articleCreated = (element) => {
- const payload = createEventPayload(element);
- const events = this.createArticleEventFactory(payload);
- events.forEach((event) => {
- document.dispatchEvent(event);
- });
- };
- const articleMediaLoaded = (element, loadedSuccessfully) => {
- const payload = createEventPayload(element);
- const events = this.createArticleMediaEventFactory(payload, loadedSuccessfully);
- events.forEach((event) => {
- document.dispatchEvent(event);
- });
- console.log(`Media loaded for element with id ${payload.details.id}`, payload);
- };
- const watcherService = tsyringe_1.container.resolve(watcher_service_1.WatcherService);
- watcherService.callbackItemAnyCreated = articleCreated;
- watcherService.callbackItemMediaLoadCompleted = articleMediaLoaded;
- watcherService.watchNewItems();
- document.addEventListener("tm_inoreader-viewing-api-for-userscripts_elementModified", (e) => {
- const customEvent = e;
- const modifiedElement = customEvent.detail.element;
- const { label, info, buttons } = customEvent.detail.properties;
- modifiedElement.querySelector(".label").textContent = label;
- modifiedElement.querySelector(".info").textContent = info;
- const buttonContainer = modifiedElement.querySelector(".button-container");
- buttonContainer.innerHTML = "";
- buttons === null || buttons === void 0 ? void 0 : buttons.forEach((button) => {
- const btn = document.createElement("button");
- btn.textContent = button.text;
- btn.addEventListener("click", button.onClick);
- buttonContainer.appendChild(btn);
- });
- });
- function createEventPayload(element) {
- return {
- details: {
- id: element.getAttribute("data-aid"),
- element,
- parent: element.parentElement,
- title: element.querySelector(".article_tile_title").textContent,
- description: element.querySelector(".article_tile_content").textContent,
- link: element.querySelector(".article_tile_title > a[href]").getAttribute("href"),
- lastUpdated: element.querySelector(".article_tile_header_date").textContent,
- isRead: element.getAttribute("data-read") === "1" ||
- element.querySelector(".article_btns.btns_article_unread") === null,
- isBookmarked: element.querySelector(".article_btns .icon-save_empty") === null,
- feed: {
- name: element.querySelector(".article_tile_footer_feed_title").textContent,
- href: element.querySelector(".article_tile_footer_feed_title a[href]").getAttribute("href"),
- },
- hasVideo: element.querySelector(".article_video_div") !== null,
- hasImage: element.querySelector(".article_tile_picture[style*='background-image']") !== null,
- },
- _meta: {
- from: "tm_inoreader-viewing-api-for-userscripts",
- readOnly: false,
- returnedOnce: false,
- },
- };
- }
- }
- createArticleEventFactory(payload) {
- const events = [];
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleAdded));
- if (payload.details.isRead) {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleReadAdded));
- }
- else {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleNewAdded));
- }
- return events;
- }
- createArticleMediaEventFactory(payload, loadedSuccessfully) {
- const events = [];
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleMediaLoadCompleted));
- if (loadedSuccessfully) {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleMediaLoadSuccess));
- }
- else {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleMediaLoadFailed));
- }
- if (payload.details.isRead) {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleReadMediaLoadCompleted));
- if (loadedSuccessfully) {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleReadMediaLoadSuccess));
- }
- else {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleReadMediaLoadFailed));
- }
- }
- else {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleNewMediaLoadCompleted));
- if (loadedSuccessfully) {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleNewMediaLoadSuccess));
- }
- else {
- events.push((0, custom_event_model_1.createCustomEvent)(payload, events_model_1.CustomEventSuffix.articleNewMediaLoadFailed));
- }
- }
- return events;
- }
- };
- CustomMethodsService = __decorate([
- (0, tsyringe_1.singleton)(),
- __metadata("design:paramtypes", [])
- ], CustomMethodsService);
- exports.CustomMethodsService = CustomMethodsService;
- /***/ }),
- /* 64 */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.createCustomEvent = void 0;
- const logger_1 = __webpack_require__(43);
- const events_model_1 = __webpack_require__(65);
- function createCustomEvent(elementAddedModel, eventSuffix = events_model_1.CustomEventSuffix.articleAdded) {
- const eventName = `tm_inoreader-viewing-api-for-userscripts_${eventSuffix}`;
- logger_1.Logger.log(`Creating custom event: ${eventName} for element with id ${elementAddedModel.details.id}`, "info");
- return new CustomEvent(eventName, {
- detail: elementAddedModel,
- });
- }
- exports.createCustomEvent = createCustomEvent;
- /***/ }),
- /* 65 */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.CustomEventSuffix = void 0;
- var CustomEventSuffix;
- (function (CustomEventSuffix) {
- CustomEventSuffix["articleAdded"] = "articleAdded";
- CustomEventSuffix["articleNewAdded"] = "articleNewAdded";
- CustomEventSuffix["articleReadAdded"] = "articleReadAdded";
- CustomEventSuffix["articleMediaLoadCompleted"] = "articleMediaLoadCompleted";
- CustomEventSuffix["articleMediaLoadFailed"] = "articleMediaLoadFailed";
- CustomEventSuffix["articleMediaLoadSuccess"] = "articleMediaLoadSuccess";
- CustomEventSuffix["articleNewMediaLoadCompleted"] = "articleNewMediaLoadCompleted";
- CustomEventSuffix["articleNewMediaLoadFailed"] = "articleNewMediaLoadFailed";
- CustomEventSuffix["articleNewMediaLoadSuccess"] = "articleNewMediaLoadSuccess";
- CustomEventSuffix["articleReadMediaLoadCompleted"] = "articleReadMediaLoadCompleted";
- CustomEventSuffix["articleReadMediaLoadFailed"] = "articleReadMediaLoadFailed";
- CustomEventSuffix["articleReadMediaLoadSuccess"] = "articleReadMediaLoadSuccess";
- CustomEventSuffix["articleModified"] = "articleModified";
- })(CustomEventSuffix = exports.CustomEventSuffix || (exports.CustomEventSuffix = {}));
- /***/ }),
- /* 66 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
- return new (P || (P = Promise))(function (resolve, reject) {
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
- step((generator = generator.apply(thisArg, _arguments || [])).next());
- });
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.WatcherService = void 0;
- const tsyringe_1 = __webpack_require__(3);
- let WatcherService = class WatcherService {
- watchNewItems() {
- const targetNode = document.body;
- const mutationObserverGlobalConfig = {
- attributes: false,
- childList: true,
- subtree: true,
- };
- const callback = (mutationsList, observer) => {
- for (const mutation of mutationsList) {
- if (mutation.type === "childList") {
- mutation.addedNodes.forEach((node) => {
- var _a;
- if (node.nodeType === Node.ELEMENT_NODE) {
- const element = node;
- if (((_a = element.id) === null || _a === void 0 ? void 0 : _a.indexOf("article_")) !== -1 && element.classList.contains("ar")) {
- if (this.callbackItemAnyCreated) {
- this.callbackItemAnyCreated(element);
- if (this.callbackItemMediaLoadCompleted && (element === null || element === void 0 ? void 0 : element.querySelector(".article_tile_picture")) !== null) {
- void this.watchMediaCompletelyLoaded(element);
- }
- }
- }
- }
- });
- }
- }
- };
- const mutationObserverGlobal = new MutationObserver(callback);
- mutationObserverGlobal.observe(targetNode, mutationObserverGlobalConfig);
- }
- watchMediaCompletelyLoaded(element) {
- return __awaiter(this, void 0, void 0, function* () {
- const imageElement = this.getImageElement(element);
- if (imageElement) {
- const imageUrl = this.getImageLink(imageElement);
- if (imageUrl) {
- const isSuccessfullyLoaded = yield this.isSuccessfullyLoaded(imageUrl);
- if (this.callbackItemMediaLoadCompleted) {
- this.callbackItemMediaLoadCompleted(element, isSuccessfullyLoaded);
- }
- }
- }
- });
- }
- getImageElement(element) {
- const divImageElement = element.querySelector(".article_tile_picture[style*='background-image']");
- return divImageElement !== null && divImageElement !== void 0 ? divImageElement : null;
- }
- getImageLink(div) {
- const backgroundImageUrl = div === null || div === void 0 ? void 0 : div.style.backgroundImage;
- return this.commonGetUrlFromBackgroundImage(backgroundImageUrl);
- }
- commonGetUrlFromBackgroundImage(backgroundImageUrl) {
- var _a;
- let imageUrl;
- try {
- imageUrl = (_a = backgroundImageUrl === null || backgroundImageUrl === void 0 ? void 0 : backgroundImageUrl.match(/url\("(.*)"\)/)) === null || _a === void 0 ? void 0 : _a[1];
- }
- catch (error) {
- imageUrl = backgroundImageUrl === null || backgroundImageUrl === void 0 ? void 0 : backgroundImageUrl.slice(5, -2);
- }
- if (!imageUrl || imageUrl === undefined) {
- return null;
- }
- if (!(imageUrl === null || imageUrl === void 0 ? void 0 : imageUrl.startsWith("http"))) {
- console.error(`The image could not be parsed. Image URL: ${imageUrl}`);
- return null;
- }
- return imageUrl;
- }
- isSuccessfullyLoaded(imageUrl) {
- return new Promise((resolve, reject) => {
- const img = new Image();
- img.src = imageUrl;
- img.onload = function () {
- resolve(true);
- };
- img.onerror = function () {
- resolve(false);
- };
- });
- }
- };
- WatcherService = __decorate([
- (0, tsyringe_1.singleton)()
- ], WatcherService);
- exports.WatcherService = WatcherService;
- /***/ }),
- /* 67 */
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
- "use strict";
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
- return c > 3 && r && Object.defineProperty(target, key, r), r;
- };
- var __metadata = (this && this.__metadata) || function (k, v) {
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
- };
- var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.StylesInjecterService = void 0;
- const tsyringe_1 = __webpack_require__(3);
- const styles_scss_1 = __importDefault(__webpack_require__(68));
- const userscript_permissions_guard_1 = __webpack_require__(70);
- let StylesInjecterService = class StylesInjecterService {
- static inject(css) {
- GM_addStyle(css);
- }
- injectInit() {
- styles_scss_1.default;
- }
- };
- __decorate([
- (0, userscript_permissions_guard_1.checkUserscriptPermission)("GM_addStyle"),
- __metadata("design:type", Function),
- __metadata("design:paramtypes", [String]),
- __metadata("design:returntype", void 0)
- ], StylesInjecterService, "inject", null);
- StylesInjecterService = __decorate([
- (0, tsyringe_1.singleton)()
- ], StylesInjecterService);
- exports.StylesInjecterService = StylesInjecterService;
- /***/ }),
- /* 68 */
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(55);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(56);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(57);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(59);
- /* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
- /* harmony import */ var _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_styles_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(69);
- var options = {};
- options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
- options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());
- options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
- options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
- options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());
- var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"], options);
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_node_modules_sass_loader_dist_cjs_js_styles_scss__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);
- /***/ }),
- /* 69 */
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
- "use strict";
- __webpack_require__.r(__webpack_exports__);
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
- /* harmony export */ });
- /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(61);
- /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62);
- /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
- // Imports
- var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
- // Module
- ___CSS_LOADER_EXPORT___.push([module.id, ".some-non-existed-element {\n background: rgba(57, 125, 204, 0.15);\n}", ""]);
- // Exports
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
- /***/ }),
- /* 70 */
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.checkUserscriptPermissionFunction = exports.checkUserscriptPermission = void 0;
- const logger_1 = __webpack_require__(43);
- const checkUserscriptPermission = (permissionName) => (target, propertyKey, descriptor) => {
- const originalMethod = descriptor.value;
- descriptor.value = function (...args) {
- if (typeof window[permissionName] === "function") {
- originalMethod.apply(this, args);
- }
- else {
- logger_1.Logger.error(`${permissionName} is not defined`);
- return;
- }
- };
- return descriptor;
- };
- exports.checkUserscriptPermission = checkUserscriptPermission;
- const checkUserscriptPermissionFunction = (permissionName) => {
- let result = false;
- if (typeof window[permissionName] === "function") {
- result = true;
- }
- return result;
- };
- exports.checkUserscriptPermissionFunction = checkUserscriptPermissionFunction;
- /***/ }),
- /* 71 */
- /***/ ((__unused_webpack_module, exports) => {
- "use strict";
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- exports.stopScheduling = exports.startScheduling = void 0;
- let interval = null;
- const startScheduling = (app) => {
- interval = setInterval(function () {
- }, 5000);
- };
- exports.startScheduling = startScheduling;
- const stopScheduling = () => {
- clearInterval(interval);
- };
- exports.stopScheduling = stopScheduling;
- /***/ })
- /******/ ]);
- /************************************************************************/
- /******/ // The module cache
- /******/ var __webpack_module_cache__ = {};
- /******/
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
- /******/ if (cachedModule !== undefined) {
- /******/ return cachedModule.exports;
- /******/ }
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = __webpack_module_cache__[moduleId] = {
- /******/ id: moduleId,
- /******/ // no module.loaded needed
- /******/ exports: {}
- /******/ };
- /******/
- /******/ // Execute the module function
- /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/
- /************************************************************************/
- /******/ /* webpack/runtime/compat get default export */
- /******/ (() => {
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = (module) => {
- /******/ var getter = module && module.__esModule ?
- /******/ () => (module['default']) :
- /******/ () => (module);
- /******/ __webpack_require__.d(getter, { a: getter });
- /******/ return getter;
- /******/ };
- /******/ })();
- /******/
- /******/ /* webpack/runtime/define property getters */
- /******/ (() => {
- /******/ // define getter functions for harmony exports
- /******/ __webpack_require__.d = (exports, definition) => {
- /******/ for(var key in definition) {
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
- /******/ }
- /******/ }
- /******/ };
- /******/ })();
- /******/
- /******/ /* webpack/runtime/global */
- /******/ (() => {
- /******/ __webpack_require__.g = (function() {
- /******/ if (typeof globalThis === 'object') return globalThis;
- /******/ try {
- /******/ return this || new Function('return this')();
- /******/ } catch (e) {
- /******/ if (typeof window === 'object') return window;
- /******/ }
- /******/ })();
- /******/ })();
- /******/
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
- /******/ (() => {
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
- /******/ })();
- /******/
- /******/ /* webpack/runtime/make namespace object */
- /******/ (() => {
- /******/ // define __esModule on exports
- /******/ __webpack_require__.r = (exports) => {
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
- /******/ }
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
- /******/ };
- /******/ })();
- /******/
- /******/ /* webpack/runtime/nonce */
- /******/ (() => {
- /******/ __webpack_require__.nc = undefined;
- /******/ })();
- /******/
- /************************************************************************/
- var __webpack_exports__ = {};
- // This entry need to be wrapped in an IIFE because it need to be in strict mode.
- (() => {
- "use strict";
- var exports = __webpack_exports__;
- Object.defineProperty(exports, "__esModule", ({ value: true }));
- __webpack_require__(1);
- const app_1 = __webpack_require__(2);
- const scheduler_1 = __webpack_require__(71);
- const app = new app_1.App();
- (0, scheduler_1.startScheduling)(app);
- })();
- /******/ })()
- ;